Joint Position Waypoints Example

From sdk-wiki
Revision as of 17:51, 28 October 2016 by Bbenoit (talk | contribs) (Usage)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Summary

The joint position waypoints example demonstrates basic joint position control. A joint position waypoint is a configuration of the arm in joint space (ie. simultaneous joint angles for all of the arm's seven degrees of freedom). In this example, we enable the robot moving the specified limb in zero-g mode. Interacting with the arm's navigator buttons, we can record a sequence of joint position waypoints. Upon completion of recording, we will continuously command the limb loop through the recorded joint sequence.

Code Walkthrough

Joint Position Waypoints - Code Walkthrough

Usage

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

$ rosrun baxter_tools enable_robot.py -e


Start the joint position waypoints example program, specifying left or right arm on which we will run the example:

$ rosrun baxter_examples joint_position_waypoints.py -l right


Moving the arm in zero-g mode, when we reach a joint position configuration we would like to record, press that limb's navigator wheel.


You will then be prompted with instructions for recording joint position waypoints.

Press Navigator 'OK/Wheel' button to record a new joint joint position waypoint.
Press Navigator 'Rethink' button when finished recording waypoints to begin playback.


Moving the arm in zero-g mode, when we reach a joint position configuration we would like to record, press that limb's navigator wheel.


You will get the feedback that the joint position waypoint has been recorded:

Waypoint Recorded


When done recording waypoints, pressing the limb navigator's 'Rethink' button will begin playback.

[INFO] [WallTime: 1399571721.540300] Waypoint Playback Started
  Press Ctrl-C to stop...


The program will begin looping through the recorded joint positions. When the previous joint position command is fully achieved (within the accuracy threshold), the next recorded joint position will be commanded.

Waypoint playback loop #1
Waypoint playback loop #2
...

Pressing Control-C at any time will stop playback and exit the example.

Arguments

Important Arguments:

-l or --limb : The limb (arm) on which we will be running the example.

-s or --speed : The joint position motion speed ratio [0.0-1.0] (default:= 0.3)

-a or --accuracy : The threshold in Radians at which the current joint position command is considered successful before sending the next following joint position command. (default:= 0.008726646)

See the joint position waypoint's available arguments on the command line by passing joint_position_waypoints.py the -h, help argument:

$ rosrun baxter_examples joint_position_waypoints.py -h
usage: joint_position_waypoints.py [-h] -l {left,right} [-s SPEED]
                                   [-a ACCURACY]

RSDK Joint Position Waypoints Example

    Records joint positions each time the navigator 'OK/wheel'
    button is pressed.
    Upon pressing the navigator 'Rethink' button, the recorded joint positions
    will begin playing back in a loop.
    

optional arguments:
  -h, --help            show this help message and exit
  -s SPEED, --speed SPEED
                        joint position motion speed ratio [0.0-1.0] (default:=
                        0.3)
  -a ACCURACY, --accuracy ACCURACY
                        joint position accuracy (rad) at which waypoints must
                        achieve

required arguments:
  -l {left,right}, --limb {left,right}
                        limb to record/playback waypoints