Skip to content

Simple Joint trajectory example

rethink-bbenoit edited this page Nov 15, 2013 · 11 revisions

Summary

Enable the robot joint trajectory interface and send a simple joint trajectory for Baxter to follow.

Quickstart

Verify that the robot is enabled from an RSDK terminal session, ex:

    $ rosrun baxter_tools enable_robot.py -e

Start the joint trajectory controller, ex:

    $ rosrun baxter_interface joint_trajectory_action_server.py

In another RSDK terminal session, Run the joint trajectory example program, specifying left or right arm to send the joint trajectory to, ex:

    $ rosrun baxter_examples joint_trajectory_client.py -l right

The arm (right in this case) will then be commanded along a joint trajectory created between the robots current joint positions and three timestamped goal positions.

Overview

A commonly used ROS method for robot arm motion control is the joint trajectory action interface. The trajectory_controller and it's corresponding joint trajectory action server is the baxter_interface implementation to support this action interface. This example shows usage for launching the joint trajectory action server, creating a client of this action server, and commanding a simple joint trajectory.

For more information on Baxter's arms, see Using the Arms.

Usage

See the trajectory controller's usage on the command line by passing trajectory_controller.py the -h, help argument:

    $ rosrun baxter_interface joint_trajectory_action_server.py -h

Usage:

joint_trajectory_action_server.py [-h] [-l <limb>] [-r <rate>]

Optional Arguments
-h, --help - show this help message and exit
-l, --limb - trajectory controller limb [both | left | right] (default: both)
-r, --rate - trajectory control rate (Hz) (default: 100.0)


See the trajectory test example's usage on the command line by passing joint_trajectory_client.py the '-h', help argument:

    $ rosrun baxter_examples joint_trajectory_client.py -h

Usage:

joint_trajectory_client.py [-h] -l LIMB

Required Arguments
-l LIMB, --limb LIMB - send joint trajectory to which limb [left | right]

Optional Arguments
-h, --help - show this help message and exit

Interfaces

ROS APIs

See the API Reference page for details.

  • Joint Trajectory Action Server - /robot/limb/right/follow_joint_trajectory [control_msgs/FollowJointTrajectoryAction]
  • Joint Trajectory Action Server - /robot/limb/left/follow_joint_trajectory [control_msgs/FollowJointTrajectoryAction]

baxter_interface APIs

  • JointTrajectoryActionServer class: joint_trajectory_action_server.py

Troubleshooting

###The arm is not executing the trajectory Verify that the robot is enabled:

rosrun baxter_tools enable_robot.py -e

Verify that the trajectory controller has been started:

rosrun baxter_interface joint_trajectory_action_server.py

Clone this wiki locally