Coder Social home page Coder Social logo

chvmp / champ_setup_assistant Goto Github PK

View Code? Open in Web Editor NEW
80.0 7.0 23.0 10.24 MB

CHAMP Package Config Generator

License: BSD 3-Clause "New" or "Revised" License

CMake 0.95% Python 92.37% C 2.85% Shell 0.17% C++ 3.67%
ros robotics urdf legged-robotics legged-robots quadruped-robots quadruped-robot-gaits

champ_setup_assistant's Introduction

CHAMP Setup Assistant Build Status

This software auto generates a configuration package containing all the files necessary to make CHAMP walk.

CHAMP Setup Assistant

1. Installation

1.1. Clone and install all dependencies:

    sudo apt install -y python-rosdep
    cd <your_ws>/src
    git clone https://github.com/chvmp/champ_setup_assistant
    cd ..
    rosdep install --from-paths src --ignore-src -r -y

1.2. Build your workspace:

    cd <your_ws>
    catkin_make
    source <your_ws/>/devel/setup.bash

2. Quick Start

2.1. Run the setup assistant:

    roslaunch champ_setup_assistant setup_assistant.launch 

Configure your robot by loading a URDF or manually key in the configuration parameters. If you don't have a URDF now, you can download ANYmal or SpotMicro to try the package.

3. Leg Configuration

You can either use a URDF file or manually key in the origin of each actuator in the robot.

3.1. Using a URDF file:

3.1.1 The following assumptions have been made to avoid fragmentation across different robots as there can be thousands of ways to create a robot's URDF. You need to modify your URDF if any of these assumptions are not met:

  • There are no rotation between frames (joint's origin-rpy are all set to zero).
  • Hip joints rotate in the X axis.
  • Upper Leg joints rotate in the Y axis.
  • Lower Leg joints rotate in the Y axis.
  • Origins of actuators' meshes are located at the center of rotation.
  • All joints at zero position will results the robot's legs to be fully stretched towards the ground. From frontal and sagittal view, all legs should be perpendicular to the ground.

You can use the image below as a reference.

AXES: +X: Red, +Y: Green, +Z: Blue CHAMP Setup Assistant

3.1.2 Load the URDF file:

  • Click the 'BROWSE URDF' button on the upper right corner and click the URDF file you want to use from the file browser. Double click the file or click 'Open' to load the URDF.

  • Click the 'LOAD' button. This will list down the links of the robot on the left pane and display the robot's meshes on the RVIZ widget. Take note that it may take a while for huge mesh files to load.

    CHAMP Setup Assistant

3.1.3 Select the namespace for each leg (auto-configuration):

  • Select the correct namespace for each leg on the drop-down menu.

    CHAMP Setup Assistant

    This namespace is the unique identifier used by the URDF's author to differentiate each leg. For instance, Anymal's hip links are named as LF_HIP (front left), LH_HIP (rear left), RF_HIP (right front), RH_HIP (rear right). The assistant will parse the namespaces as LF_, LH_, RF_, and RH_. After selecting the namespaces for all the legs, the assistant will automatically drag the links to its respective leg parts, emptying the left pane.

3.1.4 Manually adding links if auto-configuration in previous step (3.1.2) fails:

  • You can also add a link to each leg part manually by clicking on a leg tab (ie 'Left Front Leg'). Select a link on the left pane and click '>' to add. This would be useful if the assistant fails to parse the namespaces.

    CHAMP Setup Assistant

3.1.5 Verify the configuration:

  • To visualize a configured link for a leg part, click on one of the leg tabs (ie 'Left Front Leg') and select the part. The link should now be highlighted on the RVIZ widget. Check all the leg tabs if the configuration is correct.

    CHAMP Setup Assistant

3.2. Manual Joint Configuration:

This step is only required if you don't have a URDF file to use. In this step, you'll define the position of each actuator in your robot to help the controller find the relative position of each joints.

  • Click the 'Left Front Leg' tab and key in the position for each actuator. When defining an actuator's position, x, y, and z refers to:

    x: Translation in the x axis from a reference frame. + x to the front, -x to the back.

    y: Translation in the y axis from a reference frame. + y to the left, -y to the right.

    z: Translation in the z axis from a reference frame. + z up, -z down.

By reference frame, it means the previous part in this chain: base - hip - upper_leg - lower_leg - foot. For instance if you're defining the position of the actuator at the hip, the reference frame will be 'base' and if youre defining the position of the upper_leg then your reference frame will be 'hip'.

You can take a look at the diagram below to gain some intuition. Alway define these positions from a bird's eye view.

CHAMP Setup Assistant

Some axis won't allow you to define in a certain direction if the assistant thinks that it doesn't make sense to define the position towards that direction. For instance, you won't be able to define front right hip's actuator y value as positive as this actuator is always at the right side (-y) of the base.

Once you're done with the left-front leg, the assistant will somehow predict the rest of the actuators' position. You can click on the rest of the leg tabs to check if the predictions are correct. You can still define the position manually if the prediction is wrong.

4. Gait Configuration

Click on the 'Gait Configuration' tab to define the robot's walking parameters.

CHAMP Setup Assistant

  • Knee Orientation - How the knees should be bent. You can can configure the robot to follow the following orientation .>> .>< .<< .<> where dot is the front side of the robot.

  • Max Linear Velocity X (meters/second) - Robot's maximum forward/reverse speed.

  • Max Linear Velocity Y (meteres/second) - Robot's maximum speed when moving sideways.

  • Max Angular Velocity Z (radians/second)- Robot's maximum rotational speed.

  • Stance Duration (seconds)- How long should each leg spend on the ground while walking. You can set this to default(0.25) if you're not sure. The higher the stance duration the further the displacement is from the reference point.

  • Leg Swing Height (meters)- Trajectory height during swing phase.

  • Leg Stance Height (meters)- Trajectory depth during stance phase.

  • Robot Walking Height (meters) - Distance from hip to the ground while walking. Take note that setting this parameter too high can get your robot unstable.

  • CoM X Translation (meters) - You can use this parameter to move the reference point in the X axis. This is useful when you want to compensate for the weight if the center of mass is not in the middle of the robot (from front hip to rear hip). For instance, if you find that the robot is heavier at the back, you'll set a negative value to shift the reference point to the back.

  • Odometry Scaler - You can use this parameter as a multiplier to the calculated velocities for dead reckoning. This can be useful to compensate odometry errors on open-loop systems. Normally this value ranges from 1.0 to 1.20.

5. Generate Config Package

Before you generate the configuration package make sure you have configured all the legs and set the correct gait configurations.

  • Click the 'Generate Config' tab and key-in the robot name.

  • Click the 'Browse' button to choose the 'src' directory of your current catkin workspace.

  • Click 'Generate' button to create the configuration package.

    CHAMP Setup Assistant

champ_setup_assistant's People

Contributors

grassjelly avatar tiryoh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

champ_setup_assistant's Issues

[ROS Noetic] AttributeError: module 'rviz' has no attribute 'VisualizationFrame' (fixed)

~/catkin_ws$ roslaunch champ_setup_assistant setup_assistant.launch
 
... logging to /home/user/.ros/log/e8c9ff6a-b90d-11ed-9fec-b5b3893dba3e/roslaunch-myPC.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://myPC:32999/

SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.15.15

NODES
  /
    champ_setup_assistant (champ_setup_assistant/setup_assistant.py)

auto-starting new master
process[master]: started with pid [582802]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to e8c9ff6a-b90d-11ed-9fec-b5b3893dba3e
process[rosout-1]: started with pid [582823]
started core service [/rosout]
process[champ_setup_assistant-2]: started with pid [582826]
Traceback (most recent call last):
  File "/home/user/catkin_ws/src/champ_setup_assistant/scripts/setup_assistant.py", line 79, in <module>
    sa = SetupAssistant()
  File "/home/user/catkin_ws/src/champ_setup_assistant/scripts/setup_assistant.py", line 54, in __init__
    self.robot_viz = RvizWidget(self)
  File "/home/user/catkin_ws/src/champ_setup_assistant/scripts/rviz_widget.py", line 57, in __init__
    self.frame = rviz.VisualizationFrame()
AttributeError: module 'rviz' has no attribute 'VisualizationFrame'

The fix is to replace
import rviz
with
from rviz import bindings as rviz

in the file
champ_setup_assistant/scripts/setup_assistant.py

Setup Window

I'm running champ_setup_assistant on Ros Melodic on Hyper-V on Windows 10.
Can someone pls. tell me why am I not able to see complete window of setup assistant.
csa

URDF not loading

The robot model that I am trying to use with the setup assistant but I keep encountering the following error:
image

My robot has an extra joint compared to the one showed in the example, besides having a hip, knee, and foot, it has an ankle. Could that be causing the error? Or does anyone know what could be causing it?

How to generate a correct config file

#1 (comment)
I'm so sorry I didn't know the issue etiquette.

I tried to generate it with the URDF file of "https://github.com/ReactRobotics/DogBotV4/tree/master/ROS".
Then the following notice was displayed on the terminal.

[WARN] [1596091560.599070]: base_joint's xyz are not defined. Setting these values ​​to zero
[WARN] [1596091560.599573]: base_joint's rpy are not defined. Setting these values ​​to zero
[WARN] [1596091560.600328]: base_joint's xyz are not defined. Setting these values ​​to zero
[WARN] [1596091560.600689]: base_joint's rpy are not defined. Setting these values ​​to zero
[WARN] [1596091560.601352]: base_joint's xyz are not defined. Setting these values ​​to zero
[WARN] [1596091560.601682]: base_joint's rpy are not defined. Setting these values ​​to zero
[WARN] [1596091560.602307]: base_joint's xyz are not defined. Setting these values ​​to zero
[WARN] [1596091560.602631]: base_joint's rpy are not defined.Setting these values ​​to zero

When I try the generated file with the command: "$ roslaunch bringup.launch rviz:=true", it looks like the picture.
Do you know how to fix the error?
image

import error

Traceback (most recent call last):
File "/home/siddarth/spot_ws/src/champ_setup_assistant/scripts/setup_assistant.py", line 28, in
from python_qt_binding.QtGui import *
File "/opt/ros/noetic/lib/python3/dist-packages/python_qt_binding/init.py", line 55, in
from .binding_helper import loadUi, QT_BINDING, QT_BINDING_MODULES, QT_BINDING_VERSION # @UnusedImport
File "/opt/ros/noetic/lib/python3/dist-packages/python_qt_binding/binding_helper.py", line 276, in
getattr(sys, 'SELECT_QT_BINDING_ORDER', None),
File "/opt/ros/noetic/lib/python3/dist-packages/python_qt_binding/binding_helper.py", line 120, in _select_qt_binding
(', '.join(["'%s'" % b for b in binding_order]), '\n'.join(error_msgs)))
ImportError: Could not find Qt binding (looked for: 'pyqt', 'pyside'):
ImportError for 'pyqt': No module named PyQt5.QtCore
Traceback (most recent call last):
File "/opt/ros/noetic/lib/python3/dist-packages/python_qt_binding/binding_helper.py", line 108, in _select_qt_binding
QT_BINDING_VERSION = binding_loader(required_modules, optional_modules)
File "/opt/ros/noetic/lib/python3/dist-packages/python_qt_binding/binding_helper.py", line 153, in _load_pyqt
_named_import('PyQt5.%s' % module_name)
File "/opt/ros/noetic/lib/python3/dist-packages/python_qt_binding/binding_helper.py", line 133, in _named_import
module = builtins.import(name)
ImportError: No module named PyQt5.QtCore

ImportError for 'pyside': No module named PySide2.QtCore
Traceback (most recent call last):
File "/opt/ros/noetic/lib/python3/dist-packages/python_qt_binding/binding_helper.py", line 108, in _select_qt_binding
QT_BINDING_VERSION = binding_loader(required_modules, optional_modules)
File "/opt/ros/noetic/lib/python3/dist-packages/python_qt_binding/binding_helper.py", line 185, in _load_pyside
_named_import('PySide2.%s' % module_name)
File "/opt/ros/noetic/lib/python3/dist-packages/python_qt_binding/binding_helper.py", line 133, in _named_import
module = builtins.import(name)
ImportError: No module named PySide2.QtCore

[champ_setup_assistant-2] process has died [pid 5162, exit code 1, cmd /home/siddarth/spot_ws/src/champ_setup_assistant/scripts/setup_assistant.py __name:=champ_setup_assistant __log:=/home/siddarth/.ros/log/1c413f5c-8813-11ec-9d50-9bc8d25ccedf/champ_setup_assistant-2.log].
log file: /home/siddarth/.ros/log/1c413f5c-8813-11ec-9d50-9bc8d25ccedf/champ_setup_assistant-2*.log
^C[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

URDF rules that can be load

Hello.
Thank you for making a great tool.

Is there a rule in URDF that this tool can load?
The sample URDF, ANYMAL, loaded successfully.
However, I was not able to read the URDF of a completely different 3-axis robot arm.
The error message: "poll failed with error Interrupted system call" is displayed and the process ends.

Thank you.

[help wanted] config file isn't being generated properly

Screenshot from 2023-03-25 07-58-19

these are my gait configurations
knee_orientation : ">>"
pantograph_leg : false
odom_scaler: 1.0
max_linear_velocity_x : 0.5
max_linear_velocity_y : 0.25
max_angular_velocity_z : 1.0
com_x_translation : 0.0
swing_height : 0.012
stance_depth : 0.0
stance_duration : 0.25
nominal_height : 0.2

i need some urgent help on this
Screenshot from 2023-03-25 08-02-46

im using ubuntu 20.04, ros noetic, i made the necessary changes for the setup_assistant to work in noetic

In Python3, 'dict' object has no attribute 'has_key'

Traceback (most recent call last):
  File "/xxx/champ_setup_assistant/scripts/rviz_widget.py", line 121, in on_urdf_path_load
    self.main.robot.load_urdf(urdf_path)
  File "/xxx/champ_setup_assistant/scripts/urdf_parser.py", line 55, in load_urdf
    self.end_links = self.get_end_links()
  File "/xxx/champ_setup_assistant/scripts/urdf_parser.py", line 205, in get_end_links
    if not self.link_has_child(link) and not self.link_attached_to_base(link):
  File "/xxx/champ_setup_assistant/scripts/urdf_parser.py", line 174, in link_has_child
    return self.robot.child_map.has_key(link_name)
AttributeError: 'dict' object has no attribute 'has_key'

should change

return link_name in self.robot.child_map

to

return self.robot.child_map.has_key(link_name)

PluginlibFactory: The plugin for class 'champ/RobotState' failed to load

hello, on ros NOETIC, i'm facing this issue 👍
[ERROR] [1654418331.360235595]: PluginlibFactory: The plugin for class 'champ/RobotState' failed to load. Error: According to the loaded plugin descriptions the class champ/RobotState with base class type rviz::Display does not exist. Declared types are rviz/AccelStamped rviz/Axes rviz/Camera rviz/DepthCloud rviz/Effort rviz/FluidPressure rviz/Grid rviz/GridCells rviz/Illuminance rviz/Image rviz/InteractiveMarkers rviz/LaserScan rviz/Map rviz/Marker rviz/MarkerArray rviz/Odometry rviz/Path rviz/PointCloud rviz/PointCloud2 rviz/PointStamped rviz/Polygon rviz/Pose rviz/PoseArray rviz/PoseWithCovariance rviz/Range rviz/RelativeHumidity rviz/RobotModel rviz/TF rviz/Temperature rviz/TwistStamped rviz/WrenchStamped rviz_plugin_tutorials/Imu
Any idea ?

Loading Unitree GO2 URDF

has anyone successfully been able to load the GO2 urdf? When i do, i get the 3 joints for each leg, but no feet in the menu on the left hand side. I tried comparing to the GO1 and A1 urdf, and they have the feet and can be used in the config. Im using the URDF from the unitree_ros github

URDF not loading

urdf of my robot is not loading in champ setup assistant window

urdf joint rule

Screenshot from 2023-09-22 17-39-26
Screenshot from 2023-09-22 17-38-45
Which of the two pictures in the urdf household is it correspond to? If both are not applicable, can I force it to be vertical beyond the limit?

Can‘t visualize and control

Hi,
I followed guideline to generate the configuration file with ANYmal, but I can't visualize it in the rviz.
The result is like this:
1

And also I can't control it in the gazebo.
屏幕截图 2021-10-31 17:08:36

How can I fix this error? Thanks!

Robot is not visible in setup assistant.

I'm running it on ros melodic. After loading URDF file the robot is not visible. I've tried it with URDF I've made and also with open-quadruped and ANYmal.
Also there is an error of robot state publisher when I launch setup_assistant.

How to change my URDF file to follow your convention

Hello,

First of all, thank you for your work, this is good and well documented.
After I played around for a while with Champ and Spot, I tried to give it a try and generate the configuration for my own robot (popi).

I already have a URDF file, though it doesn't follow the assumptions you made (I created it following the modified Denavit-Hartemberg convention to fix my frames). It is still quite close, as you can see in the following screens :

Capture d’écran de 2020-10-09 19-21-11

Capture d’écran de 2020-10-09 19-21-38

Capture d’écran de 2020-10-09 19-42-12

The main difference I see is about the "zero" position, it was set with the legs fully bent. A friend of mines generated this URDF file using a solidworks to URDF exporter and defined the meshes origins and all the frames in the process. I am not really proficient with URDF, so I don't really know how I could change these settings directly in the URDF file. Is it even possible, or would I have to go through the exporter again to get a correct configuration ?

If you'd like to have a look at the URDF file, you can find it here

With regards,
Lucas

ROS 2 support

Dear developers,

I have made some changes to make champ_setup_assistant work with ROS 2, for my project with quadruped robot. This includes robot_state_plugin for visualisation.
You can find the changes in my repository

For rviz python bindings I used the project of another contributor https://github.com/jrgnicho/ros2_support_utilities
Please let me know if you are interested in using this code in your project, I would appreciate any guidance on how to clean up and improve the code.

unable to launch champ_setup_assistant

Hi after following the instructions. while running the setup assistant I am getting the below error can someone please tell me how to resolve this error. thank you
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.