Motion Planning using RViz¶
In this exercise, we will (finally) learn how to use the MoveIt! RViz plugin to plan and execute motion on a simulated robot. We will explore the different options and constraints associated with both MoveIt! and the RViz plugin.
Launch the Planning Environment¶
Source your catkin workspace.
Bring up the planning environment, connected to a ROS-I Simulator node:
roslaunch myworkcell_moveit_config myworkcell_planning_execution.launch
Plugin Display Options¶
Find and test the following display options in the Displays panel, Motion Planning display
- Scene Robot -> Show Robot Visual
- Scene Robot -> Show Robot Collision
- Planning Request -> Query Start State
- Planning Request -> Query Goal State
For now, enable display of the Show Robot Visual and Query Goal State, leaving Show Robot Collision and Query Start State disabled
Select the
Panel -> Motion Planning - Trajectory Slider
menu option to display a trajectory-preview slider.- this slider allows for detailed review of the last planned trajectory
Basic Motion¶
In the Motion Planning panel, select the Planning tab
Under the Query section, expand the Select Goal State section
- select <random valid> and press Update
- observe the goal position in the graphics window
Click Plan to see the robot motion generated by the MoveIt! planning libraries
- deselect Displays -> Motion Planning -> Planned Path -> Loop Animation to stop the cyclic display
- select Displays -> Motion Planning -> Planned Path -> Show Trail to show the swept path
Click Execute to run the motion on the Industrial Robot Simulator
- observe that the multi-colored scene robot display updates to show that the robot has “moved” to the goal position
Repeat steps 2-5 a few more times
- try using the interactive marker to manually move the robot to a desired position
- try using a named pose (e.g. “straight up”)
Beyond the Basics¶
- Experiment with different Planning Algorithms
- select Context tab, choose a Planning Algorithm (drop-down box next to “OMPL”)
- the RRTkConfigDefault algorithm is often much faster
- Environment Obstacles
- Adjust the Goal State to move the robot into collision with an obstacle (e.g. the table)
- note the colliding links are colored red
- since the position is unreachable, you can see the robot search through different positions as it tries to find a solution
- try disabling the Use Collision-Aware IK setting on the Context tab
- see that the collisions are still detected, but the solver no longer searches for a collision-free solution
- Try to plan a path through the obstacle
- It may help to have “Collision-Aware IK” disabled when moving the Goal State
- If the robot fails to plan, check the error log and try repeating the plan request
- Because the default planners are sampling-based, they may produce different results on each execution
- You can also try increasing the planning time to allow a successful plan to be created
- Try different planning algorithms in this, more complex, planning task
- Try adding a new obstacle to the scene:
- Under the Scene Objects tab, add the
I-Beam.dae
CAD model- This file is located in the industrial_training repo:
~/industrial_training/exercises/3.4/I-Beam.dae
- This file is located in the industrial_training repo:
- Move the I-Beam into an interesting position, using the manipulation handles
- Press Publish Scene, to push the updated position to MoveIt
- Try to plan around the obstacle
- Under the Scene Objects tab, add the
- Adjust the Goal State to move the robot into collision with an obstacle (e.g. the table)