Skip to content

Commit

Permalink
Finish moveit-gazebo tutorial for panda arm.
Browse files Browse the repository at this point in the history
  • Loading branch information
tahsinkose committed Jun 7, 2020
1 parent e5a8198 commit abce82e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions doc/gazebo_simulation/gazebo_simulation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ After MoveIt Setup Assistant
This tutorial assumes that the robot is set up with `MoveIt Setup Assistant <../setup_assistant/setup_assistant_tutorial.html>`_,
so it is crucial to follow that document first. To the best of our knowledge, official FRANKA EMIKA Panda repository doesn't particularly consider Gazebo simulation
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. 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.
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**:

1. Fix the robot to the world coordinate system
Expand All @@ -39,7 +39,8 @@ It alone doesn't fix the problem, since now we need to provide a link with name
<link name="world" />
between lines 3 and 4.
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.

2. Add damping to the joint specifications
------------------------------------------
Expand Down Expand Up @@ -318,5 +319,33 @@ In terminal-2:

If you happen to find all these steps too tedious (you cannot be blamed for that), just clone `the franka_ros fork <https://github.com/tahsinkose/franka_ros>`_, that is created
particularly for this tutorial with the final versions of the files mentioned in the previous steps.
The changes made thus far in auto-generated :code:`panda_moveit_config` package is `in this repository <https://github.com/tahsinkose/panda_moveit_gazebo_config>`_.
The changes made thus far in auto-generated :code:`panda_moveit_config` package are `in this repository <https://github.com/tahsinkose/panda_moveit_gazebo_config>`_.
At the end, both repositories will have the updated and directly usable versions.

-------------------------------

Now it is time to integrate MoveIt to this work. Open :code:`panda_moveit_config/launch/demo_gazebo.launch` file
and replace line 61 with:

.. code-block:: xml
<arg name="rviz_config" value="$(find panda_moveit_config)/launch/moveit.rviz"/>
This will allow us to use juicy Motion Planning display of MoveIt in Rviz. There is a final minor issue in `demo_gazebo.launch` file. Remove
line 31 from that file, which contains unused :code:`urdf_path` argument. After that, launch:

.. code-block:: xml
roslaunch panda_moveit_config demo_gazebo.launch
.. figure:: moveit-gazebo.gif
:width: 700px

Panda arm controlled via MoveIt in Gazebo simulation.


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>`_
forks provide a ready-made work.
Binary file modified doc/gazebo_simulation/moveit-gazebo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit abce82e

Please sign in to comment.