API Example - Mission Recorder¶
This example creates an interface for operating Spot with your keyboard, recording a mission, and saving it.
See requirements.txt for the dependencies required for this example. Using pip, these dependencies can be installed using:
python -m pip install -r requirements.txt
The mission_recorder allows you to record Autowalk missions for Spot without the need for a tablet. You must have a fiducial marker printed out and posted in a place that is visible to Spot for this to work.
How to Record a Mission¶
Place at least one fiducial marker in a position that is visible to Spot’s cameras. More than one fiducial can be used (but each must be unique).
Make sure that Spot’s hardware power switch is on and Spot’s hardware E-Stop is disabled.
Run the mission_recorder script:
python mission_recorder.py --username USER --password PASSWORD ROBOT_IP DIRECTORY_TO_SAVE_MISSION
Press the spacebar to release the software E-Stop.
Press ‘P’ to power on the robot. NOTE: All keyboard commands are case-sensitive.
Press ‘f’ to command the robot to stand up.
Move the robot using the wasd keys to the desired starting point of the mission, which must have line-of-sight to the fiducial.
The text interface should indicate that the number of fiducials visible is at least 1.
If this number is 0, move the robot using the wasd keys until it can see the fiducial.
Press ‘m’ to start recording a mission.
Drive the robot along the desired path, using ‘w’ and ‘s’ to drive forward and back, ‘a’ and ‘d’ to strafe left and right, and ‘q’ and ‘e’ to turn left and right.
When you have finished training the path, press ‘g’ to save the mission and exit the mission_recorder.
When run, this example will create an interface in your terminal listing the controls which are as follows:
|m||Start recording mission|
|g||Stop recording and generate mission|
|P||Motor power & Control|