The goals of this lab are

  • Introduction to the ROS’ motion planning framework MoveIt
  • Learning about different planning algorithms in the Open Motion Planning Library (OMPL)
  • Experimentally evaluate the performance of sampling-based path planners
  • Use a model of the ClamArm for testing


  • Design of a challenging motion-planning environment
  • Experimental evaluation of planning time and trajectory length using 3 different algorithms


  • 2 weeks
Deliverables are due on Monday after the last lab.
  1. Make sure your ROS environment is setup correctly and you have in your ~/.bashrc file this command:
    • source /opt/ros/groovy/setup.bash
      If you are confused by the “bashrc” part, Google it.
    • Make sure your software is up to date:
      sudo apt-get update && sudo apt-get dist-upgrade
    • To test your ROS installation, run the command “roscore”. If you get the error (for VM users most likely)
      IOError: [Errno 13] Permission denied: '/home/user/.ros/

      Then run the following command:

      sudo chmod 777 -R ~/.ros/
    • If needed, more details here, including instructions for installing from source if you are feeling adventurous.
  2. Setup the ClamArm packages on your computer. Follow the instructions on this page but you can skip the last section “Install Dynamixel2USB Controllers in Ubuntu”
  3. Test that the ClamArm simulation works on your computer:
    • Run in terminal:
      roslaunch clam_bringup clam_simulation.launch
    • You should see something like the following. Make sure you find the popup box titled “Joint State Publisher” and play with the sliders in that box to move the robot arm around. Note: the workspace is based on Dave’s desk area in the lab
      Simulated ClamArm
    • If you have issues with Rviz segfaulting or not running, make sure the command glxinfo does not return any errors. If it does, your computer doesn’t have its video cards / 3d hardware acceleration setup correctly. You should look into this on your own. Other wise see Rviz Troubleshooting or ROS Answers
  4. Run the MoveIt Setup Assistant for the ClamArm by following the instructions* on this page. *Read the notes below:
    • You can skip the pre-requisites for the PR2 because we will be running the Setup Assistant for the ClamArm. We are not using the full PR2 robot in simulation because it is too computationally intensive to run on laptops and many computers, and is also just overall more complicated for beginners.
    • When it tells you to navigate to the “pr2.urdf” file, instead find the clam.urdf file located in:
    • In general adapt the instructions for our robot instead of the PR2 and try to understand the robot semantics required for motion planning…
      • For the Virtual Joints screen, use these settings: Virtual Joint Name: “vjoint1”, Child Link: “base_link”, Parent Frame Name: “vframe1”, Joint Type: “fixed”
      • For the Planning Groups screen, create one group named “arm” using the KDL solver and default Kin values. Add a “Chain” that goes from the “base_link” to the “gripper_roll_link”. Also add a group named “gripper” that has the three gripper links named gripper_f*
      • For the End Effectors screen, make up a name, choose gripper_roll_link for parent link, “gripper” for group and set the parent group as “arm”
      • There are no passive joints
    • On the “Configuration Files” screen save the package path to
    • Before continuing to Step 5, you need to manually edit the move_group.launch file so that MoveIt doesn’t look for actual robot hardware:
      • Open to edit the XML file ~/ros/catkin_ws/src/clam_moveit_config_new/launch/move_group.launch
      • Change allow_trajectory_execution to false
      • Change moveit_manage_controllers to false
  5. Explore the MoveIt Rviz Motion Planning Plugin by doing the following. If you get stuck or need more documentation at one point, take a look at the instructions for the PR2
    • You should already have the simulated ClamArm running in a terminal, as described in Step 4. If not, re-start that
    • Start the MoveIt move_group node in a new terminal. This is the “brains” of the motion planning framework and communicates with Rviz. You will not need to do anything further in this terminal after launching this:
      roslaunch clam_moveit_config_new move_group.launch
    • Rviz plugin motion planning add.pngNow switch over to Rviz – the screen that shows the robot visually
    • At the bottom left click the big “Add” button and choose the “MotionPlanning” plugin from within the “moveit_ros_visualization” group. Click OK to add it to Rviz. (See image on right)
    • You should now see a large panel at the bottom left of the screen – this is the MoveIt Rviz Motion Planning Plugin that allows you to test different motion plans. It should have the words OMPL in green – indicated you are connected to a planning library. You should see something like this:
    • Choose an algorithm from the drop down box to the left of OMPL to specify what type of algorithm you want to use. Remember how to do this for later.
    • Start configuring the plugin for the ClamArm. Click on “MotionPlanning” in “Displays”.
      • Make sure the Robot Description field is set to “robot_description”
      • Make sure the Planning Scene Topic field is set to “planning_scene”.
      • In Planning Request, change the Planning Group to “right_arm”.
      • Set the Trajectory Topic in the Planned Path tab to “/move_group/display_planned_path”.
  6. Rviz plugin visualize robots.pngPlay with visualized robots
    • There are four different visualizations active here currently:
      1. The start state for motion planning (the planned group is represented in green).
      2. The goal state for motion planning (the planned group is represented in orange).
      3. The robot’s configuration in the planning scene/ planning environment
      4. The planned path for the robot
    • The display states for each of these visualizations can be toggled on and off using checkboxes.
      1. The start state using the “Query Start State” checkbox in the “Planning Request” tab.
      2. The goal state using the “Query Goal State” checkbox in the “Planning Request” tab.
      3. The planning scene robot using the “Show Scene Robot” checkbox in the “Scene Robot” tab.
      4. The planned path using the “Show Robot Visual” checkbox in the “Planned Path” tab.
  7. Interact with ClamArm
    • Press Interact in the top menu of rviz. You should see a couple of interactive markers appear for the arm

      • One marker (corresponding to the orange colored right arm) will be used to set the “Goal State” for motion planning. Another marker corresponding to a green colored representation of the right arm will be used to set the “Start State” for motion planning.
      • You will be able to use these markers (which are attached to the tip link of each arm) to drag the arm around and change its orientation.
    • Note what happens when you try to move the arm into collision with itself or the workspace. The two links that are in collision will turn red.
    • The “Use Collision-Aware IK” checkbox in the Motion Planning box on the Context tab allows you to toggle the behavior of the IK solver. When the checkbox is ticked, the solver will keep attempting to find a collision-free solution for the desired end-effector pose. When it is unticked, the solver will allow collisions to happen in the solution. The links in collision will always still be visualized in red, regardless of the state of the checkbox.
    • Note also what happens when you try to move the end-effector out of its reachable workspace (sometimes the access denied sign will not appear).
  8. Use motion planning
    • You can start motion planning with the ClamArm in the MoveIt! Rviz Plugin.
      • Move the Start State to a desired location.
      • Move the Goal State to another desired location.
      • Make sure both states are not in collision with the robot itself.
      • Make sure the Planned Path is being visualized. Also check the “Show Trail” checkbox in the Planned Path tab.
    • In the Planning tab (at the bottom left box), press the Plan button. You should be able to see a visualization of the arm moving and a trail.
    • Try changing the algorithm being used to solve the motion planning problem (Context tab)
    • In the Planning tab, under the Query section choose <random> from the drop down box and click Update to move the arm to random poses
  9. Work with obstacles
    • Save this file to your computer. In the Scene Objects tab of Rviz click Import from Text and load the saved file. It should be a scene that contains a potted plant. Adjust the plant’s location if necessary.
    • Position the start goal of the arm to be on one side of the plant, and the end goal to be on the other side.
    • Plan the arm to move around the plant
  10. Benchmark results (the deliverables)
    • Record the path length and planning time distributions for three different algorithms in OMPL for the same exact start goal, end goal and planning scene. You can use the MoveIt benchmarking tools if you’d like but you will probably need to have MoveIt installed from source to get the latest fixes to those tools.
Set your Twitter account name in your settings to use the TwitterBar Section.