The position priority node produces an action that moves the robot's gripper to a new location in a straight line. Unlike the Velocity Priority tool's action, this action will only move to one new point and if the gripper's path is obstructed it will try to push through and will take more time to execute if needed.

This tool provides a number of options to customize the motion it produces. Frame here is the standard frame option, enabling the motion to be described in the frame of reference of choice. Unlike the velocity priority tool, it is safe to to describe motions with respect to the either of the gripper's frame (l_gripper_tool_frame or r_gripper_tool_frame) of references.

The Motion section allows users to vary the rotational and translational speed of the motion. The position and orientation section allows users to manually specify the destination point to move to. However, unless the motion is simple (i.e. pull back X meters, push by Y meters) it is easier to pose the robot in RViz and use the Current Pose button to copy in the information.


In this tutorial we will make a motion that moves the gripper forward by 15 cm in a straight line. First, position the gripper that you want to move in RViz such that it is in front of the robot's chest, as close as possible, with the tip pointed forward. Make sure that the gripper has room to move forward by at least 15 cm. Now select torso_lift_link from the Frame field, then the arm that the gripper is on in the Arm field, and finally click on Current Pose. This will populate the Position and Orientation fields with the gripper's current pose described in the torso_lift_link frame (located in between the two arms of the robot). Next, add .15 to the X field (as all distance displays are in meters) then add this action to the current behavior with the Add button. Then, clicking Run should move the robot's gripper by 15 cm to that new position.

To execute this action again, manually pull the gripper back using RViz then execute the action. An alternative way to accomplish this is by following the above instructions but instead use either the l_gripper_tool_frame or r_gripper_tool_frame. When you click Current Position all the fields will read 0 (this is normal as the position of the gripper is always at the center of its own frame). Then enter .15 into the X field. Clicking run on this action will now move the gripper forward by 15 cm. However, if you click run a second time the gripper will move forward again by 15 cm from the last position (effectively 30cm!). This is as the command, when expressed in the gripper's reference frame, is saying "wherever the gripper is, move it with respect to this current position in the positive X direction by 15 cm" and in the first case we are saying "wherever the gripper is, move it to this position from the point of view of the torso".


  • If the recorded motion looks strange it might be because the elbow joint is out of position. This tool sends the gripper to a 3D position by trying change the joint angles, but it might not always be able to do so. To guarantee that the motion will work, add a joint sequence state prior to your position priority state.

Wiki: rcommander_pr2/tools/Position Priority (last edited 2012-11-02 16:39:29 by HaiDNguyen)