MoveIt! Quickstart in RViz

The quickest way to get started using MoveIt! is through its RViz plugin. Rviz is the primary visualizer in ROS and an incredibly useful tool for debugging robotics. The MoveIt! Rviz plugin allows you to setup virtual environments (scenes), create start and goal states for the robot interactively, test various motion planners, and visualize the output.

If you haven’t already done so, make sure you’ve completed the steps in Getting Started.

  • Launch the demo:
roslaunch mara_moveit_config demo.launch rviz_tutorial:=true
  • If you are doing this for the first time, you should see an empty world in RViz and will have to add the Motion Planning Plugin:

    • You should see an empty world in RViz: emptyworld
    • In the RViz Displays Tab, press Add:
    • From the moveit_ros_visualization folder, choose “MotionPlanning” as the DisplayType. Press “Ok”.
    • You should now see Mara in RViz: mara
  • Once you have the Motion Planning Plugin loaded, we can configure it. In the “Global Options” tab of the “Displays” subwindow, set the Fixed Frame field to table
  • Now, you can start configuring the Plugin for your robot (Mara in this case). Click on “MotionPlanning” within “Displays”.
    • Make sure the Robot Description field is set to robot_description.
    • Make sure the Planning Scene Topic field is set to /move_group/monitored_planning_scene
    • In Planning Request, change the Planning Group to manipulator.
    • In Planned Path, change the Trajectory Topic to /move_group/display_planned_path mara1

There are four different overlapping visualizations:

  1. The robot’s configuration in the /planning scene planning environment (active by default).
  2. The planned path for the robot (active by default).
  3. Green: The start state for motion planning (disabled by default).
  4. Orange: The goal state for motion planning (active by default).

The display states for each of these visualizations can be toggled on and off using checkboxes:

  1. The planning scene robot using the Show Robot Visual checkbox in the Scene Robot tab.
  2. Un-check the Show Robot Visual checkbox in the Scene Robot tab
  3. Check the Query Goal State checkbox in the Planning Request tab.
  4. Check the Query Start State checkbox in the Planning Request tab.
  • Play with all these checkboxes to switch on and off different visualizations.

mara2

For the next steps we will want only the scene robot, start state and goal state:

  1. Check the Show Robot Visual checkbox in the Planned Path tab
  2. Un-check the Show Robot Visual checkbox in the Scene Robot tab
  3. Check the Query Goal State checkbox in the Planning Request tab.
  4. Check the Query Start State checkbox in the Planning Request tab.

There should now be two interactive markers. One marker corresponding to the orange colored arm will be used to set the “Goal State” for motion planning and the other marker corresponding to a green colored arm are used to set the “Start State” for motion planning. If you don’t see the interactive markers press Interact in the top menu of RViz (Note: some tools may be hidden, press “+” in the top menu to add the Interact tool as shown below).

manipulation

You should now be able to use these markers to drag the arm around and change its orientation. Try it!

Note what happens when you try to move one of the arms into collision with the other. The two links that are in collision will turn red.

collision

The “Use Collision-Aware IK” checkbox found within the MotionPlanning plugin under the Planning 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 not checked, 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.

motionplanningpanel

Note what happens when you try to move an end-effector out of its reachable workspace.

outofreachable

  • Now, you can start motion planning with MARA 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 MotionPlanning window under the Planning tab, press the Plan button. You should be able to see a visualization of the arm moving and a trail.

tail

You can visually introspect trajectory point by point on RViz.

  • From “Panels” menu, select “MotionPlanning - Slider”. You’ll see a new Slider panel on RViz.
  • Set your goal pose, then run Plan.
  • Play with the “Slider” panel, e.g. move the slider, push “Play” button.

NOTE: Once you placed your EEF to a new goal, be sure to run Plan before running Play – otherwise you’ll see the waypoints for the previous goal if available.

rvi_plugin

Many of the tutorials use moveit_visual_tools to step through a demo. Before continuing on to the next tutorials it is a good idea to enable the RvizVisualToolsGui.

From “Panels” menu, select “RvizVisualToolsGui”. You’ll see the new panel added to RViz.

gui

RViz enables you to save your configuration under File->Save Config. You should do this before continuing on to the next tutorials.