Skip to content

createmoveit

Salvo Virga edited this page Mar 12, 2016 · 11 revisions

Create a MoveIt! package with the new robot definition

We are going to create a ROS package that uses MoveIt! to control an IIWA equipped with the tool described HERE.
The final result is available HERE.

You can follow the same for any other tool previously defined in a URDF macro. Change all the name with the appropriate tool name, here is just "tool".

First we need to create a plain URDF from the xacro file, the MoveIt! setup assistant needs it.
Go to the folder containing the xacro file, in our case :
roscd iiwa_tool_description/urdf
Run this to expand the xacro file into a URDF (changing the file names accordingly to your needs): rosrun xacro xacro.py iiwa_tool.urdf.xacro hardware_interface:=PositionJointInterface robot_name:=iiwa > iiwa_tool.urdf

Now, start the MoveIt! setup assistant :
roslaunch moveit_setup_assistant setup_assistant.launch
Load the URDF file just created.
Generate the self-collision matrix. In the section Planning Groups select the following :

Then advance into "Add Kin. Chain" and select the following as base and tip links :

Go to "Configuration Files" and generate the package into the appropriate folder (name it iiwa_tool_moveit, with the approriate tool name)

You have already the package there, but some minor changes needed to be done.
Go to the launch folder of the package :
roscd iiwa_tool_moveit/launch

  1. Open planning_context.launch.
    Copy the content of the file with the same name in iiwa_moveit/launch into this one.
    Replace iiwa_description with iiwa_tool_description.
    Replace iiwa_moveit with iiwa_tool_moveit.
    Line 15, modify the file name "$(arg model)_tool_upload.launch" to match the one of the launch file you created for this robot description
    (e.g. $(arg model)_gripper_upload.launch)
    Line 22, modify the file name "$(arg model)_tool.srdf" to match the one corresponding to the name of your robotic description
    (e.g. $(arg model)_gripper.srdf)

  2. Open demo.launch
    Copy the content of the file with the same name in iiwa_moveit/launch into this one.
    Replace iiwa_moveit with iiwa_tool_moveit

  3. Open move_group.launch Copy the content of the file with the same name in iiwa_moveit/launch into this one.
    Replace iiwa_moveit with iiwa_tool_moveit EXCEPT FOR LINES 39 and 47.

  4. Copy the file moveit_planning_execution.launch from iiwa_moveit/launch to this folder.
    Replace iiwa_moveit with iiwa_tool_moveit

Build your workspace, source it and try :
roslaunch iiwa_tool_moveit moveit_planning_execution.launch sim:=false

RViZ - the ROS visualization tool - should pop up with the robot loaded in and MoveIt! ready to be used.

Clone this wiki locally