Controlling the Arm with a Keyboard

June 7, 2023 ยท View on GitHub

This example creates an interface for controlling the arm with your keyboard. The example initializes the SDK to talk to robot and takes keyboard inputs to send cylindrical and angular hand velocity commands.

Understanding Spot Programming

For your best learning experience, please use the Quickstart Guide found in the SDK's docs/python directory. That will help you get your Python programming environment set up properly.

Common Problems

  1. Use the keyboard interface to release the e-stop [SPACE] and power [P] the robot before sending hand commands. No need launch a separate software e-stop.
  2. Make sure the Motor Enable button on the Spot rear panel is depressed.
  3. Make sure Spot is sitting upright, with the battery compartment on the side closest the floor.

Setup Dependencies

This example requires the bosdyn API and client to be installed, and must be run using python3. Using pip, these dependencies can be installed using:

python3 -m pip install -r requirements.txt

Running the Example

python3 arm_wasd.py ROBOT_IP

When run, this example will create an interface in your terminal listing the controls which are as follows:

ButtonFunctionality
wasdRadial/Azimuthal Control
rfUp/Down Control
uoX-axis Rotation Control
ikY-axis Rotation Control
jlZ-axis Rotation Control
nmOpen/Close gripper
yUnstow Arm
hStow Arm
qStand
eSit
xReturn/Acquire Lease
SPACEE-Stop
PMotor power & Control
TabExit