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.
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:
There are four different overlapping visualizations:
/planning sceneplanning environment (active by default).
The display states for each of these visualizations can be toggled on and off using checkboxes:
For the next steps we will want only the scene robot, start state and goal state:
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).
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.
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.
Note what happens when you try to move an end-effector out of its reachable workspace.
Now, you can start motion planning with MARA in the MoveIt! RViz Plugin.
You can visually introspect trajectory point by point on RViz.
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.
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.
RViz enables you to save your configuration under
File->Save Config. You should do this before continuing on to the next tutorials.