Show EOL distros: 

pr2_apps: pr2_app_manager | pr2_position_scripts | pr2_teleop_general | pr2_tuckarm

Package Summary

pr2_teleop_general

  • Maintainer status: maintained
  • Maintainer: Devon Ash <dash AT clearpathrobotics DOT com>
  • Author: Gil Jones
  • License: BSD
  • Source: git https://github.com/pr2/pr2_apps.git (branch: hydro-devel)

Note: This package originated as pr2_teleop_booth and wasn't released before ROS Hydro.

Overview

This package offers two executables for general control of the PR2 robot - a joystick-based control program using the PS3 joystick and a keyboard control program. Each of these programs allows a user to control the sensor head, tilting laser, arms, base, and torso of the PR2 robot as well as enabling some useful modes for demonstration.

Handy Cheat Sheet

teleop_cheat_sheet.png

Joystick control

This section will focus on the executable pr2_teleop_general_joystick, which allows control through a PS3 joystick controller.

Launch files

There are several launch files offered for convenience. The first can be accessed using

roslaunch pr2_teleop_general pr2_teleop_general_joystick.launch

This launch file enables body control, head control, and arm control but disables prosilica control. It also starts pr2_kinematics nodes for the left and right arms, which are necessary for joystick control of the arms and enabling walk_along_mode.

roslaunch pr2_teleop_general pr2_teleop_general_joystick_noik.launch

implements the same functionality but does not launch arm ik nodes, assuming that they are already running from another launch file.

roslaunch pr2_teleop_general pr2_teleop_general_joystick_bodyhead_only.launch 

disables arm control altogether and starts no processes associated with the arms.

Pairing

Before use, the PS3 controller must be "paired" with the robot. If your controller is not already paired, you can pair it by pressing the center button, shown in the image.

There is currently no feedback from the controller or the robot during or after pairing. The best way to tell if they have been paired correctly is to try issuing commands to the robot via the joystick as described below.

http://www.ros.org/wiki/pr2_teleop?action=AttachFile&do=get&target=pairing.png

Joystick layout overview

This program implements four different mapping modes for the face buttons of the ps3 joystick depending on which of the front buttons are depressed. If none of the front buttons are pressed then no commands are relayed to the robot.

ps3 joy mapping controls

Base control mapping

In base control mode the operator can move the base or raise and lower the torso.

Sensor/Head/Follow mapping

This mode permits the operator to control the head, control the tilt of the laser, turn the projected light display on or off, and to set the "follow me" mode.

Arm control mappings

The final mappings allow the operator to control either arm independently or to control both simultaneously.

top annotated

Sensor/Head/Follow mapping

Accessing this mapping requires that the upper right front button be depressed - see the above image.

Button

Control Action

1

Cycles the head mode (see below)

2

Cycles the laser between Off, Slow Scan, and Fast Scan

3

Toggles the projected light between off and on

5 (Select) double-tap

Moves the arms to follow mode position (see below)

5 (Select)

Exits follow mode (see below)

6 (Start)

Initiates follow mode if the arms are in proper position and select has been double-tapped (see below)

ly+/-

Pans the head right/left if in position control mode

rx+/-

Tilts the head up/down if in position control mode

Head control modes

There are four control modes for the head. The first is position control, which allows the head to be tilted and panned using the analog sticks. The second and third modes point the head at the right hand hand and the left hand respectively. The final mode places the head in mannequin mode.

Follow me mode

All of this assumes that the top right front button is depressed. In order to get into follow me mode you must double-tap Select. This will move the arms into a position in front of the robot. Do not interfere with the arms as they are moving, and make sure they have clear paths. Once in position press Start in order to initiate follow me mode. The robot will nod its head if everything was successful. Otherwise it will shake its head. To exit follow me mode press Select once.

Base control mapping

The base control is accessible by pushing the top left front button. Base and torso controls are essentially the same as that described in pr2_teleop.

Button

Control Action

7 (Triangle)

Raises torso

10 (X)

Lowers torso

rx+/-

Translates the robot forward/backward

rx+/-

Translates the robot right/left

ry+/-

Rotates the robot right/left

Arm control mappings

The lower front buttons control the arms. The arms may be controlled individually by pressing only one of the front two buttons. If both arm buttons are held any commands will be issued to both arms.

Button

Control Action

1

Cycles are in between controller modes. Modes are no controllers, position control, and mannequin control

2

When in both arm control mode untucks the arms. Does nothing in single arm control mode.

3

When in both arm control mode tucks the arms. Does nothing in single arm control mode.

7 (Triangle)

Rotates the wrist or wrists counter-clockwise

10 (X)

Rotates the wrist or wrists clockwise

8 (Square)

Closes the gripper or grippers

9 (Circle)

Opens the gripper or grippers

rx+/-

When arm or arms are in position control mode, move wrist forward/back

ry+/-

When arm or arms are in position control mode, move wrist right/left

lx+/-

When arm or arms are in position control mode, move wrist up/down

Keyboard control

This section will focus on the executable pr2_teleop_general_keyboard, which allows robot control using the keyboard.

Launching

There are three launch files which largely mirror the functionality described for the joystick:

roslaunch pr2_teleop_general pr2_teleop_general_keyboard.launch

brings up arm ik and allows control of all modes

roslaunch pr2_teleop_general pr2_teleop_general_keyboard_noik.launch

does not bring up ik nodes, assuming they are running elsewhere.

roslaunch pr2_teleop_general pr2_teleop_general_keyboard_bodyhead_only.launch

allows control of only the body and the head.

Interacting with the program

The program brings up text guides that describe the function of the keys.

ROS parameters for joystick and keyboard

As a convenience the joystick and keyboard programs implement largely the same set of ROS parameters:

Basic parameters

control_body (Boolean, default: true)

  • Whether or not to permit control of the body
control_head (Boolean, default: true)
  • Whether or not to permit control of the head and sensors
control_rarm (Boolean, default: true)
  • Whether or not to permit control of the right arm
control_larm (Boolean, default: true)
  • Whether or not to permit control of the left arm
control_prosilica (Boolean, default: true)
  • Whether or not to permit control of the prosilica (in order to poll frames)
arm_controller_name (string, default: "arm_controller")
  • The arm controller suffix that is used for arm position mode ("r_" or "l_" will prepend the suffix)

Advanced parameters

There are many parameters offered by the modules that will generally not need to be changed by the users. Here we list two of the most important.

arm_controller_name (string, default: "arm_controller")

  • The arm controller suffix that is used for arm position mode ("r_" or "l_" will prepend the suffix)
prosilica_namespace (string, default: "prosilica_polled")
  • The namespace to connect to the prosilica for the polling topic

Wiki: pr2_teleop_general (last edited 2015-10-12 15:27:28 by IsaacSaito)