Cartesian Path Following
Skill Level: Intermediate
Many applications require moving the arm end-effector along a given path in 3D space. Some examples include welding, sanding, inspection, door opening, etc.
This tutorial will walk through an example Objective that defines a path in 3D space and plans for a robot trajectory that can follow that path.
Launch MoveIt Pro
We assume you have already installed MoveIt Pro to the default install location. Launch the application using:
moveit_pro run -c picknik_ur_mock_hw_config
1. Run the "Move Along Path" Objective
To get an understanding of what path following means in practice, run the Move Along Path
Objective.
This Objective makes the robot end-effector follow a rectangular path covering two cells of the scene grid:
2. Objective overview
After running the Objective, open the Behavior Tree to learn how the Objective is defined.
Select the “Objective Builder” tab, click on the Move Along Path
Objective, and then select “Edit”.
As you can see, the Objective has two main blocks:
- A
Sequence
block that defines the path to follow, with calls toCreate Stamped Pose
andAdd Pose Stamped To Vector
. - A
Keep Running Until Failure
block, with calls toMove To Waypoint
,Plan Cartesian Path
,Get Current Planning Scene
,Validate Trajectory
andExecute Follow Joint Trajectory
. This will plan and execute the path in a loop.
The following two sections go more in detail into these two blocks.
3. Defining the path to follow
Path waypoints are defined via alternate calls to Create Stamped Pose
and Add Pose Stamped To Vector
.
More in detail:
Create Stamped Pose
: Creates ageometry_msgs/PoseStamped
message describing a pose relative to a given reference frame.Add Pose Stamped To Vector
: Adds a givengeometry_msgs/PoseStamped
message to a vector of poses.
The reference_frame
in Create Stamped Pose
can be any frame available in the tf
tree.
The pose defined in that behavior (position_xyz
and orientation_xyzw
) will be relative to that reference frame.
Different points along the path can have different reference frames.
They will all be converted to the robot group base frame internally, later in the pipeline.
The actual 3D path is constructed with calls to Add Pose Stamped To Vector
, which add the waypoints to a vector (the path), one by one.