Skip to content

Plan and Execute motions with MoveIt 2

This is a step by step tutorial on how to perform collision-free motions on TIAGo using the graphical interface of MoveIt!. Collision-free motion planning is performed by chaining a probabilistic sampling-based motion planner with a trajectory filter for smoothing and path simplification.

MoveIt is a robot agnostic tool, and hence using MoveIt for TIAGo Pro is completely analogous to TIAGo.

This tutorial is done in the robot simulation, which is the recommended way to proceed before using the tool in the real robot.

Step 1 : Setup simulation and GUI

Open the PAL Robotics docker, and start the simulation in a new terminal

ros2 launch tiago_gazebo tiago_gazebo.launch.py world_name:=empty

Start the MoveIt GUI in another terminal by doing

ros2 launch tiago_moveit_config moveit_rviz.launch.py

These two commands start the motion planning services with visualization. Do not close these terminals while doing motion planning.

Step 2: Move groups

The MoveIt GUI is integrated as an RViZ plugin. This can be used for planning, executing and visualizing the corresponding motions.

MoveIt! uses planning groups to generate solutions for different kinematic chains. Planning groups or move groups in the MoveIt nomenclature are groups of joints. In TIAGo Pro these are

Group of joints Joints included
Torso torso_lift
Head head_1, head_2
Arm left arm_left_1, arm_left_2, arm_left_3, arm_left_4, arm_left_5, arm_left_6, arm_left_7
Arm right arm_right_1, arm_right_2, arm_right_3, arm_right_4, arm_right_5, arm_right_6, arm_right_7
Gripper left gripper_left_finger
Gripper right gripper_right_finger

the ones also used for PlayMotion2. When planning groups are selected, the GUI shows only the relevant “flying end-effectors”. In Figure 1 the arm group is selected, highlighting the joints and links of the arm (from 1 to 7) and adding an Interactive marker at the end-effector.

Moveit 2 planning group arm
Figure 1: Moveit 2 planning group arm.

If instead the arm_torso group is selected, it highlights the whole arm and torso link. The marker is also put at the end-effector. See Figure 2.

Moveit 2 planning group arm torso
Figure 2: Moveit 2 planning group arm_torso.

Step 3: Start state and Goal state

Planning a motion requires stating a start and a goal state as boundary conditions. The MoveIt! GUI allows to add these constraints in the Planning tab in the Motion Planning display. See Figure 3.

Moveit 2 Motion planning start and goal state
Figure 3: Moveit 2 Motion planning start and goal state.

Step 4: Test using random poses

By default the Start State is the current of the robot. If the Goal State is set as random, clicking the Update button generates random positions of the arm. The current state of the robot is shown in the original colors of the meshes (white for TIAGo), while the group for which we are setting a goal random position is shown in yellow. See Figure 4.

Moveit 2 GUI Random states
Figure 4: Moveit 2 GUI Random states.

Step 5: Plan and execute

The target (yellow) states in Figure 4 are not necessarily reachable by a single motion that is collision-free. MoveIt allows to Plan and to Execute the motion. These can be triggered by the corresponding buttons in the display, see Figure 5.

Moveit 2 GUI Plan and Execute motions
Figure 5: Moveit 2 GUI Plan and Execute motions.

The Plan button checks whether there is a collision free joint trajectory that goes from the start to the end state. The button Execute runs this motion. The button Plan ad Execute plans and executes if the found plan is feasible.

Step 6: Changing the end-effector pose

The MoveIt GUI in RViZ spawns the robot model together with an interactive marker attached to the end-effector of the goal model (that in yellow). This allows the user to change the end-effector pose in the local end-effector frame

  • Along \(x\) or roll with the red arrow or circle,
  • Along \(y\) or in pitch with the green arrow or circle, or
  • Along \(z\) or in yaw with the blue arrow or circle.

See Figure 6.

Change of end-effector pose
Figure 6: Change of end-effector pose.