Use gripper control as an example of controlling Sawyer's gripper.
Uses the keyboard or joystick to control Sawyer's gripper. Position, velocity, holding, and moving force can be controlled and sensed. Both logitech and xbox game controllers are supported.
The robot should always enabled after start, try the command from an SDK terminal session if the robot is not enabled:
$ rosrun intera_interface robot_enable.py
Start gripper control from an RSDK terminal session:
Gripper keyboard example:
$ rosrun intera_examples gripper_keyboard.py
IMPORTANT: You will have to calibrate gripper before using any of the other commands using C/c commands:
Once calibrated, future calibrate commands will not do anything unless you send a 'reboot' first
Get a list of commands by entering '?'
For gripper keyboard example:
key: description, 'r': "reboot", 'c': "calibrate", 'q': "close", 'o': "open", '+': "set 100% velocity", '-': "set 30% velocity", 's': "stop", 'h': "decrease holding force", 'j': "increase holding force", 'u': "decrease position", 'i': "increase position",
For gripper joystick example:
command: description, 'btnLeft' : "reboot", 'btnUp' : "calibrate", 'leftTrigger' : "close", 'leftTrigger' : "open (release)", 'leftBumper' : "stop", 'leftStickHorz': "decrease position by step when stick value less than 0, increase position by step when stick value larger than 0", 'leftStickVert': "decrease holding force by step when stick value less than 0, increase holding force by step when stick value larger than 0", 'function1' or 'function2': "help"
You can monitor the changes you are making using the following rostopic which you can monitor from a different shell:
$ rostopic echo /robot/end_effector/right_gripper/command
To use the example gripper program using a joystick game controller to control the gripper:
First ensure that joy drivers are installed.
$ rospack find joy
If not run:
$ sudo apt-get install ros-indigo-joystick-drivers
To run the example:
$ roslaunch intera_examples gripper_joystick.launch joystick:=<joystick_type>
Where <joystick_type> is 'xbox', 'logitech', or 'ps3'. (If using a ps3, make sure you run the node from the ROS ps3joy package in a separate sudo terminal. See instructions here: PairingJoystickAndBluetoothDongle ps3joy )
Note: This method uses an included ROS launch file to start both the gripper example and joy_node using the roslaunch tool. You can exit the gripper example by hitting any keyboard key, however you will have to ctrl-c to also cleanup the joy_node. Joystick Button Mappings NOTE: Don't forget to calibrate gripper first.
Press any keyboard key to quit. (the 'joystick left <-> robot right' mappings are not typos; they assume the user is in front of the robot when using the joystick.)
Buttons | Action | Buttons | Action --- | --- | --- | --- Function 1 or 2 (e.g. Select/Select)_ | Help | _\<Any Keyboard key\> | Quit
| | | Top Button | right: calibrate | Right Button | left: calibrate Left Button | right: reset | Bottom Button | left: reset
| | | Left Trigger [PRESS]_ | right: close | Right Trigger _[PRESS] | left: close Left Trigger [RELEASE]_ | right: open | Right Trigger _[RELEASE] | left: open Left Bumper | right: stop | Right Bumper | left: stop
Stick Axes | Action --- | --- Left Stick Horizontal | right: increase/decrease position Right Stick Horizontal | left: increase/decrease position Left Stick Vertical | right: increase/decrease holding force Right Stick Vertical | left: increase/decrease holding force
Directional Pad (D-Pad) | Action --- | --- dPadUp | right: increase velocity dPadRight | left: increase velocity dPadLeft | right: decrease velocity dPadDown | left: decrease velocity