-
Notifications
You must be signed in to change notification settings - Fork 698
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
Add MoveIt+Gazebo Integration tutorial for panda arm #499
Conversation
@tahsinkose do the changes you need only pertain to We have full control over the moveit_config: The description package requires going through Franka's team, but its not so difficult @fwalch. It looks like @erdalpekel has already opened a PR for this (now a year old): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this is a really great improvement to my stub tutorial!
To both.
Great. Going to make a PR in there.
When I rebased to the latest |
Hi, I can help with the merge/rebase procedure if it's mandatory to merge into a specific branch. Erdal |
Hi @erdalpekel hocam,
This is independent from any tutorials. MoveIt documentation depends on the latest
After these steps, both versions should have the simulatable robot 🙂 |
Hi @tahsinkose, I will try to fix the conflicts and merge with the branches that you mentioned. |
@erdalpekel according to frankaemika/franka_ros#52 (comment), merging changes into @davetcoleman I believe we should continue with what we have right now and merge this document, which is already a working piece of knowledge. In the followups, I'll first get a compromise on moveit/panda_moveit_config#68 and could possibly takeover frankaemika/franka_ros#52 from @erdalpekel if he couldn't find the cycles to do so 🙂 . |
@davetcoleman Can we merge this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for creating this tutorial--it's very helpful for a project I'm working on. There were some unclear steps, which I've noted.
such that the necessary components to properly simulate the robot in Gazebo are missing with respect to :code:`urdf` and :code:`xacro` files. This is a rare incident, since most other robots | ||
have those components out of the box. *If you have a custom robot, which already works well in Gazebo, you can skip the steps until Step-6.* Fortunately, there is already a good solution offered in `the blog post <https://erdalpekel.de/?p=55>`_ to this problem. For the sake of completion though, | ||
the procedure outlined in there will be repeated (with improvements) in here as well for preparing the robot for Gazebo simulation. | ||
**Note that these steps assume that you have cloned franka_ros repository from the source**: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be helpful to include a link to the repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It assumes that the user had followed the Setup Assistant tutorial, which has that link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**Note that these steps assume that you have cloned franka_ros repository from the source**: | |
**Note that these steps assume that you have cloned the `franka_ros repository <https://github.com/frankaemika/franka_ros>` from the source**: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does have the link, but it also recommends installing the package via apt-get
, so I didn't actually need the link until I got to this step, which is why I suggest adding the link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair 👍
<link name="world" /> | ||
|
||
between lines 3 and 4. Additionally, we should rename the fixed joint to :code:`virtual_joint` to properly match | ||
the SRDF specification created in previous tutorial. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this on line 8? It probably is, but it'd be very helpful to be more specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, it is on line 5 without the link name="world"
addition in above.
Moreover friction forces are added in order to have realistic dynamics. You can ignore them at all or change their values to experiment. | ||
Since the focus is MoveIt in this tutorial, we will just use the values from the provided solution. | ||
|
||
This step is a bit tedious to do manually, so the ultimate :code:`xacro` file is provided entirely in below: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this file go? What should it be called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I specified the file name as inline comment:: panda.gazebo.xacro
. It should be placed next to the xacro files. Added these to docu as well 👍
</xacro:macro> | ||
</robot> | ||
|
||
Then add the following block to the end of :code:`franka_description/robots/panda_arm_hand_urdf.xacro` file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before the </robot>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I mean, come on 😅
to control theoretically any type of robot. :code:`gazebo_ros_control` enables the ROS control to be used in Gazebo. | ||
See `its document <http://gazebosim.org/tutorials/?tut=ros_control>`_ for full details. | ||
|
||
Add the following to the newly created :code:`panda.gazebo.xacro` file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where in the file? Inside the <robot>
tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just before </robot>
. I assumed some level of intimacy..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a tutorial that many first-time users will read though, and it's easy to trip up and get lost on "that should be obvious" things. Better to err on the side of too much detail. Don't forget that if you can write a tutorial in the first place, you automatically tend to underestimate the difficulty.
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so"/> | ||
</gazebo> | ||
|
||
For transmissions and actuators we are going to create a new file, :code:`panda.control.xacro`. As before, I will provide the full content now: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this file go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to add the libgazebo_ros_contro.so
in a separate xacro file.
Inserting it in the panda.gazebo.xacro
will not allow to use multiple time the panda_gazebo
macro since we will instantiate multiple gazebo_ros_control plugin that can interfere one with the other. Having a separate macro to add the gazebo_ros_control plugin in my experience is an effective solution. So when you are building a robot you can call several time the panda_gazebo
macro with different arm_id and at the end you only add once the gazebo_plugin
I experienced this problem in constructing a cobot composed of a mobile base and a robotic arm. Both where loading the ros_control gazebo plugin and this was generating errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point @ValerioMa 👍
</xacro:macro> | ||
</robot> | ||
|
||
Similarly add the following line to the end of :code:`franka_description/robots/panda_arm_hand_urdf.xacro` file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, before </robot>
, correct? Please specify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really think end of means just before </robot>
in this context.
7. Adjust auto-generated ros_controllers.launch | ||
----------------------------------------------- | ||
|
||
Fill the :code:`args` in line 9 with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be helpful to say exactly where to find the ros_controllers.launch
file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair 👍
We have successfully integrated MoveIt and Gazebo ultimately. MoveIt Setup Assistant already does | ||
many work under the hood, but it still misses some parts to provide a proper Gazebo integration. After following | ||
this tutorial you should be able to reproduce this locally for any robot. In case you don't want to be | ||
bothered with all the details, `franka_ros <https://github.com/tahsinkose/franka_ros>`_ and `panda_moveit_config <https://github.com/tahsinkose/panda_moveit_gazebo_config>`_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link to https://github.com/tahsinkose/panda_moveit_gazebo_config
is broken--maybe you meant https://github.com/tahsinkose/panda_moveit_config
? Also, please say which branches should be used, or link directly to them. Looks like the simulation
branch on franka_ros
and the melodic-devel
branch on panda_moveit_config
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link to https://github.com/tahsinkose/panda_moveit_gazebo_config is broken--maybe you meant https://github.com/tahsinkose/panda_moveit_config?
Yes, thanks for notification 👍
Looks like the simulation branch on franka_ros and the melodic-devel branch on panda_moveit_config, right
Yes to both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bothered with all the details, `franka_ros <https://github.com/tahsinkose/franka_ros>`_ and `panda_moveit_config <https://github.com/tahsinkose/panda_moveit_gazebo_config>`_ | |
bothered with all the details, `franka_ros <https://github.com/tahsinkose/franka_ros/tree/simulation>`_ and `panda_moveit_config <https://github.com/tahsinkose/panda_moveit_config/tree/melodic-devel>`_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
||
<!-- panda.gazebo.xacro --> | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<robot xmlns:xacro="http://www.ros.org/wiki/xacro"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By a blind copy of the code-block (as I did) you get an error during the urdf generation from xacro file.
Xacro file have to start with <?xml version='1.0' encoding='utf-8'?>
.
I suggest therefore to swap line 1 with line 2. In this way we still have the information on the file name which is very useful, but the copy and paste will work.
joints: | ||
- panda_finger_joint1 | ||
- panda_finger_joint2 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
action_ns, type, default, joints should have the same indentation of name both in panda_arm_controller and panda_hand_controller otherwise by just copy and pasting users will get the following error:
ros_controllers.yaml contains invalid YAML:
mapping values are not allowed here
in "", line 63, column 18:
action_ns: follow_joint_trajectory
^
XML is
The traceback for the exception was written to the log file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy-pasting stuff between implicitly indented text editors (with their own rules, 2? 4? Or a tab, damn) is a long-lasting pain-in-the-neck for me 🤦♂️ Thanks for pointing it out 👍
Using the franka_description maintained by franka_emika generate wrong behavior in Gazebo. The problem is that they switched to a simplified collision profile generation (link) that increase the speed in planning since it is easier to detect collision. This work well with moveit since the collision check between subsequent link can be disabled. This can not be done in the gazebo environment and with this simplified collision profile the system will not behave correctly. |
We get regular posts about the Gazebo tutorial being out-of-date (moveit/moveit#2179, moveit/moveit#2237, moveit/moveit#2210), and I had trouble getting this to run today as well. @tahsinkose Any chance you could incorporate the review comments and confirm that the instructions still work? It would be great if this could be merged soon. @ValerioMa It shouldn't be a problem to use another URDF in |
Thanks for the detailed reviews @JStech and @ValerioMa! I have addressed almost all of them and made the defending arguments where the status quo seems better to me. @ValerioMa That's why I created my fork on top of MoveIt's fork. I tried to make things work with the latest franka upstream, but it turned out to be much more non-trivial than I first expected. Let's just try to improve MoveIt's fork 🤞 @felixvd I didn't try all the instructions back again, but checked the steps involving yamls with indentations and etc. They seem to work. Please retry the steps and write me explicitly via Discord, where the things got wrong, ofc if you could find any. |
@tahsinkose as we discussed on discord, we'll revisit this after my latest update and the approach I think makes the most sense is for you to provide a patch to our panda_moveit_config to support this tutorial. I'm responding here in case anyone else has a better idea for how to support this tutorial. We have other existing tutorial specific additions to panda_moveit_config for various tutorials and it seems like supporting the more complex collision environment would be a useful modification in this case. |
@tylerjw support patch is at moveit/panda_moveit_config#68. Please review that and let's merge this long-lasting PR. I followed the documentation once again and it is still working. |
…rameter speecification.
I created PTAL @ValerioMa @felixvd. |
Our main contact at Franka, Sebastian, does not seem to be there anymore (his mail bounced) and @fwalch isn't responding. I think we need to move forward for now assuming we won't have any support from Franka Emika, so having these changes here will probably have to stay. |
CI is passing... what if we just merge this as a first step to getting those gazebo tutorials usable? |
Closes #493 |
Congrats on getting your first MoveIt pull request merged and improving open source robotics! |
Please create follow up PRs as necessary to finish this, I just want to get some documentation out there on how to use Gazebo with MoveIt |
Thanks for finally merging this @davetcoleman! Followup PR in tutorial will basically involve removing the steps required to make Gazebo simulation work after the merge of frankaemika/franka_ros#126 and moveit/panda_moveit_config#68. |
* Create stub gazebo simulation tutorial * Finish pure-gazebo tutorial for panda arm. * Finish moveit-gazebo tutorial for panda arm. * Add the missing step regarding to auto-generated robot_description parameter speecification. * Update external links for panda_moveit_config package in Gazebo tutorial. Co-authored-by: Dave Coleman <[email protected]> Co-authored-by: Tahsincan Kose <[email protected]>
Description
Addresses #128. Takes over from #493.
Since the panda release used in Setup Assistant doesn't have proper Gazebo details, I had to include them with reference to an external blog. It turned out to be a bit more involved than I expected to be, but it gives a good (and working 🙂 ) sample.
I believe MoveIt Setup Assistant could be perfectionized based on this tutorial, so that the output could be directly usable. Might take a look in it too, but can't promise 😉