{"id":55,"date":"2019-01-14T20:08:50","date_gmt":"2019-01-14T20:08:50","guid":{"rendered":"http:\/\/erdalpekel.de\/?p=55"},"modified":"2019-03-12T12:38:25","modified_gmt":"2019-03-12T12:38:25","slug":"integrating-franka-emika-panda-robot-into-gazebo","status":"publish","type":"post","link":"https:\/\/erdalpekel.de\/?p=55","title":{"rendered":"Integrating FRANKA EMIKA Panda robot into Gazebo"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p>I have recently integrated the FRANKA EMIKA Panda robot into a <em><a rel=\"noreferrer noopener\" aria-label=\"Gazebo (opens in a new tab)\" href=\"http:\/\/gazebosim.org\/\" target=\"_blank\">Gazebo<\/a><\/em> simulation and wanted to share my experience. The Panda robot is currently the flagship robot used in the MoveIt! tutorials and has both low- and high level open source libraries for integration with ROS.<\/p>\n\n\n\n<p>The low-level library is called <em><a href=\"https:\/\/github.com\/frankaemika\/libfranka\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"libfranka (opens in a new tab)\">libfranka<\/a><\/em> and can be used for fine-grained information retrieval from the robot and realtime manipulation with custom controllers.<\/p>\n\n\n\n<p>The high-level library is called <em><a href=\"https:\/\/github.com\/frankaemika\/franka_ros.git\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"franka_ros (opens in a new tab)\">franka_ros<\/a><\/em> and integrates tightly with the MoveIt! motion planning framework. It allows a more practical and abstract approach to controlling the robot for customers who are already deeply involved in the <em>ROS<\/em> + <em>MoveIt!<\/em> ecosystem and want to migrate or start out with minimal effort.<\/p>\n\n\n\n<p><em>Gazebo<\/em> is an open source dynamics simulation environment with support for various modules and packages that are required to interface with <em>ROS<\/em> for robot manipulation.<\/p>\n\n\n\n<p>The configuration of the robot for the high-level motion-planning library is called <a rel=\"noreferrer noopener\" aria-label=\"panda_moveit_config (opens in a new tab)\" href=\"https:\/\/github.com\/ros-planning\/panda_moveit_config.git\" target=\"_blank\"><em>panda_moveit_config<\/em><\/a> and was recently moved from the <em>franka_ros<\/em> package to <a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/github.com\/ros-planning\" target=\"_blank\"><em>ros<\/em>-planning.<\/a><\/p>\n\n\n\n<p>In the following I will outline a step-by-step procedure to simulate the Panda robot in <em>Gazebo<\/em> and connect it to <em>MoveIt!<\/em> for motion planning.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The procedure<\/h2>\n\n\n\n<p>For integration into <em>Gazebo<\/em> we need to <\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Fix the robot to the world coordinate system<\/li><li>Add damping to the joint specifications<\/li><li>Add inertia matrices to the links<\/li><li>Add mass to the links<\/li><li>Add friction to the links<\/li><li>Colorize the links<\/li><li>Configure the gazebo control plugin <em>gazebo_ros_control<\/em><\/li><li>Set initial controller gains<\/li><li>Add changes to parent xacro file<\/li><\/ol>\n\n\n\n<p>For <em>MoveIt!<\/em> integration we need to<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Add the Gazebo controller configuration to the MoveIt! configuration files<\/li><\/ol>\n\n\n\n<p>ROS integration<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Load the robot model onto the ROS parameter server<\/li><li>Launch Gazebo and spawn the robot model<\/li><li>Load the controller configurations and spawn the controllers with controller_manager<\/li><li>Run a robot state publisher to take the joint values and publish them to <em>tf<\/em><\/li><li>Launch the move_group files for MoveIt! path planning<\/li><li>Remap joint_states to joint_states_desired<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Gazebo integration<\/h2>\n\n\n\n<p>Looking at the robot model declaration in the franka_description module inside <em>franka_ros<\/em> we realize that the mass, friction and inertia declarations are missing. But there is more to the integration than adding those values. We will find out in the following.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Fix the robot to the world coordinate system<\/h3>\n\n\n\n<p>To fix the robot to the <em>Gazebo<\/em> world coordinate system we need to enter the following lines into <strong>src\/franka_ros\/franka_description\/robots\/panda_arm.xacro<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">&lt;link name=\"world\" \/>\n\n&lt;joint name=\"robot_to_world\" type=\"fixed\">\n  &lt;parent link=\"world\" \/>\n  &lt;child link=\"${arm_id}_link0\" \/>\n  &lt;origin xyz=\"0.0 0.0 0.0\" rpy=\"0.0 0.0 0.0\" \/>\n&lt;\/joint><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. Add damping to the joint specifications<\/h3>\n\n\n\n<p>In both the hand and arms xacro file, first add the damping variable definition and then add the <em>&lt;dynamics&gt;<\/em> tag with the damping variable to every joint(except for joint8) as demonstrated here for the above added robot_to_world joint:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">&lt;xacro:property name=\"joint_damping\" value=\"1.0\"\/>\n\n&lt;joint name=\"robot_to_world\" type=\"fixed\">\n  &lt;parent link=\"world\" \/>\n  &lt;child link=\"${arm_id}_link0\" \/>\n  &lt;origin xyz=\"0.0 0.0 0.0\" rpy=\"0.0 0.0 0.0\" \/>\n  &lt;dynamics damping=\"${joint_damping}\"\/>\n&lt;\/joint><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. Add inertia matrices to the links<\/h3>\n\n\n\n<p>Gazebo requires inertia matrices for each link for exact dynamic simulation. Unfortunately FRANKA EMIKA also doesn&#8217;t specify anything here. You could load the <em>stl<\/em> model files in an appropriate application that can compute inertia from polygon models but we will stick with a working guess. We will expand all links in the <em>franka_description<\/em> package as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">&lt;link name=\"${arm_id}_link0\">\n   &lt;visual>\n      &lt;geometry>\n         &lt;mesh filename=\"package:\/\/${description_pkg}\/meshes\/visual\/link0.dae\" \/>\n      &lt;\/geometry>\n   &lt;\/visual>\n   &lt;collision>\n      &lt;geometry>\n         &lt;mesh filename=\"package:\/\/${description_pkg}\/meshes\/collision\/link0.stl\" \/>\n      &lt;\/geometry>\n   &lt;\/collision>\n   &lt;inertial>\n      &lt;origin xyz=\"0 0 0\" rpy=\"0 0 0\" \/>\n      &lt;inertia ixx=\"0.3\" ixy=\"0.0\" ixz=\"0.0\" iyy=\"0.3\" iyz=\"0.0\" izz=\"0.3\" \/>\n   &lt;\/inertial>\n&lt;\/link><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">4. Add mass to the links<\/h3>\n\n\n\n<p>This is a tricky one, as FRANKA EMIKA does not specify the masses in the specification sheet. Before we outline the calculation let&#8217;s first add the mass to the link from above by expanding its inertia definition:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">&lt;inertial>\n    &lt;origin xyz=\"0 0 0\" rpy=\"0 0 0\" \/>\n    &lt;mass value=\"3.06\" \/>\n    &lt;inertia ixx=\"0.3\" ixy=\"0.0\" ixz=\"0.0\" iyy=\"0.3\" iyz=\"0.0\" izz=\"0.3\" \/>\n&lt;\/inertial><\/code><\/pre>\n\n\n\n<p>My mass calculations are based on the volumes of the links which I acquired by loading the models into <a rel=\"noreferrer noopener\" aria-label=\"meshlab (opens in a new tab)\" href=\"http:\/\/www.meshlab.net\/\" target=\"_blank\"><em>meshlab<\/em><\/a> which calculates the volume of the given link. When the visual model gave an error I loaded the collision model. Together with the mass of the complete arm(18 kg) and hand(0,7 kg) from the panda specification, I obtained these results: <\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>Link<\/td><td>Model<\/td><td>Volume<\/td><td><strong>Mass<\/strong><\/td><\/tr><tr><td>0<\/td><td>collision<\/td><td>0,002996<\/td><td><strong>3,06357<\/strong><\/td><\/tr><tr><td>1<\/td><td>visual<\/td><td>0,002293<\/td><td><strong>2,34471<\/strong><\/td><\/tr><tr><td>2<\/td><td>visual<\/td><td>0,002312<\/td><td><strong>2,36414<\/strong><\/td><\/tr><tr><td>3<\/td><td>collision<\/td><td>0,002328<\/td><td><strong>2,38050<\/strong><\/td><\/tr><tr><td>4<\/td><td>collision<\/td><td>0,002374<br><\/td><td><strong>2,42754<\/strong><\/td><\/tr><tr><td>5<\/td><td>collision<\/td><td>0,003419<\/td><td><strong>3,49611<\/strong><\/td><\/tr><tr><td>6<\/td><td>collision<\/td><td>0,001435<\/td><td><strong>1,46736<\/strong><\/td><\/tr><tr><td>7<\/td><td>collision<\/td><td>0,000446<\/td><td><strong>0,45606<\/strong><\/td><\/tr><tr><td><\/td><td><\/td><td>0,017603<\/td><td>18<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><td><\/td><\/tr><tr><td>hand<\/td><td>collision<\/td><td>0,000709<\/td><td><strong>0,67893<\/strong><\/td><\/tr><tr><td>finger1<\/td><td>visual<\/td><td>0,000011<\/td><td><strong>0,01053<\/strong><\/td><\/tr><tr><td>finger2<\/td><td>visual<\/td><td>0,000011<\/td><td><strong>0,01053<\/strong><\/td><\/tr><tr><td><\/td><td><\/td><td>0,000731<\/td><td>0,7<\/td><\/tr><\/tbody><\/table>\n\n\n\n<h3 class=\"wp-block-heading\">5. Add friction to the links<\/h3>\n\n\n\n<p>The Gazebo documentation which explains the friction parameter links to an <a rel=\"noreferrer noopener\" aria-label=\"online resource (opens in a new tab)\" href=\"https:\/\/www.engineeringtoolbox.com\/friction-coefficients-d_778.html\" target=\"_blank\">online resource<\/a> from which I chose the value for <em>Aluminium mild<\/em> : 0,61.<br>For the friction we will create a separate file in the same directory as the other xacro files: <strong>src\/franka_ros\/franka_description\/robots\/panda.gazebo.xacro<\/strong><br>In this file we define a <em>&lt;gazebo&gt;<\/em> tag for each link:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">&lt;gazebo reference=\"${robot_name}_link0\">\n   &lt;mu1>0.61&lt;\/mu1>\n   &lt;mu2>0.61&lt;\/mu2>\n&lt;\/gazebo><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">6. Colorize the links<\/h3>\n\n\n\n<p>We will define white color for the links. This can be useful for computer vision tasks in the future.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">&lt;gazebo reference=\"${robot_name}_link1\">\n   &lt;material>Gazebo\/White&lt;\/material>\n   &lt;mu1>0.2&lt;\/mu1>\n   &lt;mu2>0.2&lt;\/mu2>\n&lt;\/gazebo><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">7. Configure the gazebo control plugin <em>gazebo_ros_control<\/em><\/h3>\n\n\n\n<p>Now we add the Gazebo controller to the description in order to activate the controller in the simulation. For this we create a new file called <strong>panda.transmission.xacro<\/strong> in which we put all the information gazebo needs to simulate the control behavior. More specific information on all tags is provided in the <a rel=\"noreferrer noopener\" aria-label=\"documentation (opens in a new tab)\" href=\"http:\/\/gazebosim.org\/tutorials\/?tut=ros_control\" target=\"_blank\">documentation<\/a>. We load the <em>gazebo_ros_control<\/em> plugin and have the option to specify the namespace it is running in(commented out as not used in our case):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">&lt;gazebo>\n   &lt;plugin name=\"gazebo_ros_control\" filename=\"libgazebo_ros_control.so\">\n     &lt;!-- &lt;robotNamespace>\/${robot_name}&lt;\/robotNamespace> -->\n   &lt;\/plugin>\n&lt;\/gazebo><\/code><\/pre>\n\n\n\n<p>Subsequently, we need to define the controller and transmission type for each joint together with the actuator itself. The transmission links the actuator to the joint. Here is an example for joint1 which links link0 and link1:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">&lt;transmission name=\"${robot_name}_tran_1\">\n   &lt;type>transmission_interface\/SimpleTransmission&lt;\/type>\n   &lt;joint name=\"${robot_name}_joint1\">\n      &lt;hardwareInterface>hardware_interface\/EffortJointInterface&lt;\/hardwareInterface>\n   &lt;\/joint>\n   &lt;actuator name=\"${robot_name}_motor_1\">\n      &lt;hardwareInterface>hardware_interface\/EffortJointInterface&lt;\/hardwareInterface>\n      &lt;mechanicalReduction>1&lt;\/mechanicalReduction>\n   &lt;\/actuator>\n&lt;\/transmission><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">8. Set initial controller gains<\/h3>\n\n\n\n<p>Instead of guessing the initial controller gains I will share the perfect gains with you so that you don&#8217;t have to undergo the time-consuming parameter tuning step like I did. We will create a file called <strong>panda_control.yaml<\/strong> for this purpose:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">#panda:                    #useful if you use a namespace for the robot\n    # Publish joint states\n    joint_state_controller:\n        type: joint_state_controller\/JointStateController\n        publish_rate: 50\n\n    panda_arm_controller:\n        type: effort_controllers\/JointTrajectoryController\n        joints:\n            - panda_joint1\n            - panda_joint2\n            - panda_joint3\n            - panda_joint4\n            - panda_joint5\n            - panda_joint6\n            - panda_joint7\n\n        gains:\n            panda_joint1: { p: 12000, d: 50, i: 0.0, i_clamp: 10000 }\n            panda_joint2: { p: 30000, d: 100, i: 0.02, i_clamp: 10000 }\n            panda_joint3: { p: 18000, d: 50, i: 0.01, i_clamp: 1 }\n            panda_joint4: { p: 18000, d: 70, i: 0.01, i_clamp: 10000 }\n            panda_joint5: { p: 12000, d: 70, i: 0.01, i_clamp: 1 }\n            panda_joint6: { p: 7000, d: 50, i: 0.01, i_clamp: 1 }\n            panda_joint7: { p: 2000, d: 20, i: 0.0, i_clamp: 1 }\n\n        constraints:\n            goal_time: 2.0\n\n        state_publish_rate: 25\n\n    panda_hand_controller:\n        type: effort_controllers\/JointTrajectoryController\n        joints:\n            - panda_finger_joint1\n            - panda_finger_joint2\n\n        gains:\n            panda_finger_joint1: { p: 5, d: 3.0, i: 0, i_clamp: 1 }\n            panda_finger_joint2: { p: 5, d: 1.0, i: 0, i_clamp: 1 }\n\n        state_publish_rate: 25<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>joint_state_controller: Publishes the joint state to the ROS topics<\/li><li>panda_arm_controller: Sets the controller gains for the arm joints<\/li><li>panda_hand_controller: Sets the controller gains for the hand joints<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">9. Add changes to parent xacro file<\/h3>\n\n\n\n<p>Finally the new xacro files need to be added and called in <strong>panda_arm_hand.urdf.xacro:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">&lt;xacro:arg name=\"robot_name\" default=\"panda\" \/>\n\n&lt;xacro:include filename=\"$(find franka_description)\/robots\/panda_arm.xacro\" \/>\n&lt;xacro:include filename=\"$(find franka_description)\/robots\/hand.xacro\" \/>\n&lt;xacro:include filename=\"$(find franka_description)\/robots\/panda.gazebo.xacro\" \/>\n&lt;xacro:include filename=\"$(find franka_description)\/robots\/panda.transmission.xacro\" \/>\n\n&lt;xacro:panda_arm \/>\n&lt;xacro:hand ns=\"panda\" rpy=\"0 0 ${-pi\/4}\" connected_to=\"panda_link8\"\/>\n\n&lt;xacro:panda_gazebo robot_name=\"$(arg robot_name)\" \/>\n&lt;xacro:panda_transmission robot_name=\"$(arg robot_name)\" hardware_interface=\"$(arg hardware_interface)\" \/><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">MoveIt! integration<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Add the Gazebo controller configuration to the MoveIt! configuration files<\/h3>\n\n\n\n<p>We need to point the existing MoveIt! configuration to the controllers that we just defined and also modify their types to <em>follow_joint_trajectory<\/em> which is the type of controller that Gazebo expects and uses to control our robot. We do so by modifying <strong>panda_moveit_config\/config\/panda_controllers.yaml<\/strong> for the case where the user does not load the gripper<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">controller_list:\n  - name: panda_arm_controller\n    action_ns: follow_joint_trajectory\n    type: FollowJointTrajectory\n    default: true\n    joints:\n      - panda_joint1\n      - panda_joint2\n      - panda_joint3\n      - panda_joint4\n      - panda_joint5\n      - panda_joint6\n      - panda_joint7<\/code><\/pre>\n\n\n\n<p>and <strong>panda_moveit_config\/config\/panda_gripper_controllers.yaml<\/strong> for the standard use case where the robot is controlled together with the gripper<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">controller_list:\n  - name: panda_arm_controller\n    action_ns: follow_joint_trajectory\n    type: FollowJointTrajectory\n    default: true\n    joints:\n      - panda_joint1\n      - panda_joint2\n      - panda_joint3\n      - panda_joint4\n      - panda_joint5\n      - panda_joint6\n      - panda_joint7\n  - name: panda_hand_controller\n    action_ns: follow_joint_trajectory\n    type: FollowJointTrajectory\n    default: true\n    joints:\n      - panda_finger_joint1\n      - panda_finger_joint2<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">ROS integration<\/h2>\n\n\n\n<p>For the ROS integration we will write a launch file that starts the correct components.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Load the robot model onto the ROS parameter server<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">&lt;param name=\"robot_description\" command=\"$(find xacro)\/xacro --inorder $(find franka_description)\/robots\/panda_arm_hand.urdf.xacro\" \/><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. Launch Gazebo and spawn the robot model<\/h3>\n\n\n\n<p>Gazebo can be launched with <a rel=\"noreferrer noopener\" aria-label=\"numerous options. (opens in a new tab)\" href=\"https:\/\/github.com\/ros-simulation\/gazebo_ros_pkgs\/blob\/kinetic-devel\/gazebo_ros\/launch\/empty_world.launch\" target=\"_blank\">numerous options.<\/a> We will launch the empty world but will of course enable the <em>gui<\/em> option so that we can see the robot.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">&lt;!-- GAZEBO arguments -->\n&lt;arg name=\"paused\" default=\"false\"\/>\n&lt;arg name=\"use_sim_time\" default=\"true\"\/>\n&lt;arg name=\"gui\" default=\"true\"\/>\n&lt;arg name=\"headless\" default=\"false\"\/>\n&lt;arg name=\"debug\" default=\"false\"\/>\n\n&lt;!--launch GAZEBO with own world configuration -->\n&lt;include file=\"$(find gazebo_ros)\/launch\/empty_world.launch\">\n\t&lt;arg name=\"debug\" value=\"$(arg debug)\"\/>\n\t&lt;arg name=\"gui\" value=\"$(arg gui)\"\/>\n\t&lt;arg name=\"paused\" value=\"$(arg paused)\"\/>\n\t&lt;arg name=\"use_sim_time\" value=\"$(arg use_sim_time)\"\/>\n\t&lt;arg name=\"headless\" value=\"$(arg headless)\"\/>\n&lt;\/include>\n\n&lt;node name=\"spawn_urdf\" pkg=\"gazebo_ros\" type=\"spawn_model\" args=\"-param robot_description -urdf -model panda\"\/><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. Load the controller configurations and spawn the controllers with controller_manager<\/h3>\n\n\n\n<p>In order to launch the controllers we need to first load our custom controller configuration file onto the ROS parameter server. After that we are ready to spawn our three controllers:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">&lt;!-- Load joint controller configurations from YAML file to parameter server -->\n&lt;rosparam file=\"$(find robotics_assisted_tomography)\/config\/panda_control.yaml\" command=\"load\"\/>\n\n&lt;!-- load the controllers -->\n&lt;node name=\"controller_spawner\" pkg=\"controller_manager\" type=\"spawner\" respawn=\"false\" output=\"screen\" args=\"joint_state_controller panda_hand_controller panda_arm_controller\" \/><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">4. Run a robot state publisher to take the joint values and publish them to <em>tf<\/em><\/h3>\n\n\n\n<p>This node takes the joint values at any instant and publishes them to tf which in turn given the robots model computes all possible transforms between the links of the robot and the environment.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">&lt;node name=\"robot_state_publisher\" pkg=\"robot_state_publisher\" type=\"robot_state_publisher\" respawn=\"true\" output=\"screen\" \/><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">5. Launch the move_group files for MoveIt! path planning<\/h3>\n\n\n\n<p>In order to plan and execute paths with <em>MoveIt!<\/em> we need to start the preconfigured move_group files that start all nodes that are necessary for motion planning and trajectory execution for both the <em>panda_arm<\/em> and <em>hand<\/em> move_groups.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">&lt;include file=\"$(find panda_moveit_config)\/launch\/planning_context.launch\">\n  &lt;arg name=\"load_robot_description\" value=\"true\"\/>\n&lt;\/include>\n&lt;include file=\"$(find panda_moveit_config)\/launch\/move_group.launch\" \/>\n&lt;include file=\"$(find panda_moveit_config)\/launch\/moveit_rviz.launch\" \/><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">6. Remap joint_states to joint_states_desired<\/h3>\n\n\n\n<p>The launch file <strong>panda_moveit_config\/launch\/move_group.launch<\/strong> configures the node move_group so that it expects the joint states not to be published by the <em>joint_states<\/em> topic but by the  <em>joint_states_desired<\/em> topic(see line 78). Consequently we will remap the topic <em>joint_states<\/em> to <em>joint_states_desired<\/em> so that the communication to <em>MoveIt!<\/em> works. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"jsx\" class=\"language-jsx\">&lt;node name=\"joint_state_desired_publisher\" pkg=\"topic_tools\" type=\"relay\" args=\"joint_states joint_states_desired\" \/><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Results and screenshots<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"794\" src=\"https:\/\/erdalpekel.de\/wp-content\/uploads\/2019\/01\/image-1024x794.png\" alt=\"\" class=\"wp-image-78\" srcset=\"https:\/\/erdalpekel.de\/wp-content\/uploads\/2019\/01\/image-1024x794.png 1024w, https:\/\/erdalpekel.de\/wp-content\/uploads\/2019\/01\/image-300x232.png 300w, https:\/\/erdalpekel.de\/wp-content\/uploads\/2019\/01\/image-768x595.png 768w, https:\/\/erdalpekel.de\/wp-content\/uploads\/2019\/01\/image.png 1044w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1024\" height=\"749\" src=\"https:\/\/erdalpekel.de\/wp-content\/uploads\/2019\/01\/image-1-1024x749.png\" alt=\"\" class=\"wp-image-79\" srcset=\"https:\/\/erdalpekel.de\/wp-content\/uploads\/2019\/01\/image-1-1024x749.png 1024w, https:\/\/erdalpekel.de\/wp-content\/uploads\/2019\/01\/image-1-300x219.png 300w, https:\/\/erdalpekel.de\/wp-content\/uploads\/2019\/01\/image-1-768x562.png 768w, https:\/\/erdalpekel.de\/wp-content\/uploads\/2019\/01\/image-1.png 1503w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1024\" height=\"749\" src=\"https:\/\/erdalpekel.de\/wp-content\/uploads\/2019\/01\/image-2-1024x749.png\" alt=\"\" class=\"wp-image-81\" srcset=\"https:\/\/erdalpekel.de\/wp-content\/uploads\/2019\/01\/image-2-1024x749.png 1024w, https:\/\/erdalpekel.de\/wp-content\/uploads\/2019\/01\/image-2-300x219.png 300w, https:\/\/erdalpekel.de\/wp-content\/uploads\/2019\/01\/image-2-768x562.png 768w, https:\/\/erdalpekel.de\/wp-content\/uploads\/2019\/01\/image-2.png 1503w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"931\" height=\"967\" src=\"https:\/\/erdalpekel.de\/wp-content\/uploads\/2019\/01\/Peek-2019-01-14-17-00.gif\" alt=\"\" class=\"wp-image-83\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"929\" height=\"807\" src=\"https:\/\/erdalpekel.de\/wp-content\/uploads\/2019\/01\/Peek-2019-01-14-17-01.gif\" alt=\"\" class=\"wp-image-84\"\/><\/figure>\n\n\n\n<p>The custom <a rel=\"noreferrer noopener\" aria-label=\"ros repository (opens in a new tab)\" href=\"https:\/\/github.com\/erdalpekel\/panda_simulation\" target=\"_blank\">ROS package<\/a> as well as the modified <a rel=\"noreferrer noopener\" aria-label=\"franka_ros (opens in a new tab)\" href=\"https:\/\/github.com\/erdalpekel\/franka_ros\" target=\"_blank\">franka_ros<\/a> and <a rel=\"noreferrer noopener\" aria-label=\"panda_moveit_config (opens in a new tab)\" href=\"https:\/\/github.com\/erdalpekel\/panda_moveit_config\" target=\"_blank\">panda_moveit_config<\/a> repositories are available in my <a rel=\"noreferrer noopener\" aria-label=\"GitHub profile (opens in a new tab)\" href=\"https:\/\/github.com\/erdalpekel\" target=\"_blank\">GitHub profile<\/a>.<\/p>\n\n\n\n<p>The next part of this series is about writing a ROS node in C++ that communicates with the move_groups for motion planning. We will also discuss how different constraints such as collision objects(e.g. walls) can be integrated into <em>MoveIt!<\/em> such that these constraints are considered by the motion planning algorithm.<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post I will outline a step-by-step procedure to simulate the Panda robot in Gazebo and connect it to MoveIt! for motion planning.<\/p>\n","protected":false},"author":1,"featured_media":202,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,6,9,5,3,8,7,4],"tags":[13,14,15,12,11,16],"class_list":["post-55","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c","category-gazebo","category-moveit","category-robot-operating-system-ros","category-robotics","category-ros","category-simulation","category-software-development","tag-c","tag-gazebo","tag-moveit","tag-robot-operating-system","tag-ros","tag-simulation"],"_links":{"self":[{"href":"https:\/\/erdalpekel.de\/index.php?rest_route=\/wp\/v2\/posts\/55","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/erdalpekel.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/erdalpekel.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/erdalpekel.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/erdalpekel.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=55"}],"version-history":[{"count":56,"href":"https:\/\/erdalpekel.de\/index.php?rest_route=\/wp\/v2\/posts\/55\/revisions"}],"predecessor-version":[{"id":153,"href":"https:\/\/erdalpekel.de\/index.php?rest_route=\/wp\/v2\/posts\/55\/revisions\/153"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/erdalpekel.de\/index.php?rest_route=\/wp\/v2\/media\/202"}],"wp:attachment":[{"href":"https:\/\/erdalpekel.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=55"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/erdalpekel.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=55"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/erdalpekel.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=55"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}