Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup with ign_ros2_control #11

Closed
sjahr opened this issue Dec 8, 2021 · 6 comments · Fixed by AndrejOrsula/panda_ign_moveit2#7 or #12
Closed

Setup with ign_ros2_control #11

sjahr opened this issue Dec 8, 2021 · 6 comments · Fixed by AndrejOrsula/panda_ign_moveit2#7 or #12
Assignees

Comments

@sjahr
Copy link

sjahr commented Dec 8, 2021

Hi @AndrejOrsula,
this repository is a very useful example for combining ros2 and ignition, thank you for this great work! You mentioned in ign_ros2_control#1 that you successfully launched a robot with ros2_control in Gazebo Ignition. I've tried to get a Panda running but I was not able to successfully do it so far and wanted to ask if it is possible for you to share your setup?
Thanks a lot in advance!

@AndrejOrsula
Copy link
Owner

Hello @sjahr,

Unfortunately, I do not have a setup available at the moment. However, I am planning to create ign_ros2_control config for Franka Emika Panda relatively soon. It will be in the coming weeks, but I don't exactly know when I will have free time for it because it requires some refactoring to replace the current hacky setup.

I will also try to update the examples in this repository to use ign_ros2_control and deprecate the current approach using JointTrajectoryController Ignition plugin (I'll keep it in a separate branch in case someone ever needs it).


For now, feel free to post below a specific issue/problem that is blocking you. I will try to provide some answers if I know.

@AndrejOrsula AndrejOrsula self-assigned this Dec 8, 2021
@sjahr
Copy link
Author

sjahr commented Dec 8, 2021

Sounds great! Thanks for your quick reply. I'll share my blocker later with you. Let me know when you need a review/help with your work.

@AndrejOrsula
Copy link
Owner

AndrejOrsula commented Dec 13, 2021

@sjahr Yesterday, I added the basic support for Franka Emika Panda as a part of AndrejOrsula/panda_ign_moveit2#7. Ignition Gazebo example can be launched with ex_ign_control.launch.py. You can change what command interface(s) to use by modifying ex_ign_control.launch.py#L56. If you want to try it, use ex_fake_control.launch.py to make sure the rest of the system works.

Video of effort-control is below (fingers are oscillating because PIDs are not tuned).

panda_ign_moveit2_effort_control_v0.mp4

There are still several issues, namely:

  • Created new issue | In the default joint configuration that the robot is spawned in ([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]), the robot has one of the joints outside of its position limits and there is a self-collision of hand with one of the lower links.
    • I do not know any good way to spawn model into Gazebo with a specific non-default configuration. It can be done programatically through joint position reset though.
    • For now, I increased the default tolerance and disabled collision geometry for arm in the example.
  • Documented in README | [external issue (ros2_controllers)] For pure effort-control, you need to use [JTC] Implement effort-only command interface ros-controls/ros2_controllers#225. In both position and velocity mode, the commands otherwise bypass the physics engine.
  • Tuned a little bit and created a new issue | For effort-control, the PID gains require more tuning. I normally use large joint damping and friction so that I can reduce simulation step_size really low without the robot becoming unstable. Thus, these parameters also need to be tuned more.
  • [external issue (ign_ros2_control)] For effort-control, joint controllers seem to kick in only after sending the first command (the robot flops at the beginning).
  • No longer an issue | Xacro selection of command interface (e.g. panda.ros2_control#L40-L47) does not seem to be robust enough. It sometimes does not function properly. I am not sure what causes it to fail, maybe it's just some local issue I am having.

There might be others too. These are just the ones I noticed so far.


One more thing I would like to add into launch files:

  • Created new issue | Use xacro to generate also SDF before spawning it into Gazebo. This would enable passing of xacro arguments directly to SDF model from launch CLI. I already have a setup for it in a simple Python script, but I have not tried integrating it with any launch.py yet.

@sjahr
Copy link
Author

sjahr commented Dec 13, 2021

Awesome thank you! I'll test it and give you feedback

@AndrejOrsula
Copy link
Owner

AndrejOrsula commented Dec 19, 2021

The following point from the comment above is actually not an issue at all, it works all the time. One just must remember to update model.sdf when trying new command_interface (e.g. use scripts/xacro2sdf.bash). This is due to the controller parameters that are passed to the ignition_ros2_control::IgnitionROS2ControlPlugin plugin.

  • Xacro selection of command interface (e.g. panda.ros2_control#L40-L47) does not seem to be robust enough. It sometimes does not function properly. I am not sure what causes it to fail, maybe it's just some local issue I am having.

This won't be an issue once the following is added.

  • Use xacro to generate also SDF before spawning it into Gazebo. This would enable passing of xacro arguments directly to SDF model from launch CLI. I already have a setup for it in a simple Python script, but I have not tried integrating it with any launch.py yet.

@AndrejOrsula
Copy link
Owner

The following PRs are now merged in.

Some of the aforementioned points that are not yet fixed were converted into issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants