Spot Dog PROGRAMMING

This tutorial will guide you through starting up spot, using SPOT, and how to program SPOT using Python. Python is the backbone of this tutorial; it is best to prepare for this workshop by researching functions and classes prior to this tutorial.

What you will need


Step 1: Prepare your working Directory


Go to this GitHub repo, click the green <> Code button, and then click "Download ZIP". Note that this repository will change with new updates and features, so it is best to either use Github Desktop to get the most recent updates, or manually check before using SPOT.

Once downloaded, unzip the ZIP file and note where you have it saved. 

Step 2: open vs code & install requirements


To control SPOT, Boston Dynamics wrote a SDK which we use in our demonstrations. It is imperative that you not only download all requirements Boston Dynamics includes, but also what we include. To do this:

python3 --version

and that pip is installed

pip --version

pip install -r requirements.txt

python3 -m pip install bosdyn-client==3.3.2 bosdyn-mission==3.3.2 bosdyn-choreography-client==3.3.2

If these throw errors, let one of the staff members know!

Step 3: Understanding the files


spot_helper.py functions

code_here.py functions

STEP 4: WRITING YOUR OWN CODE


There are a few important things before you write in your file. 

time.sleep(4)

controller.sit()


Now you can code!

Add all of your desired functions and movements in between the 

#ENTER SPOT ACTIONS HERE

(type here!)

#SPOT ACTIONS END HERE

EXAMPLE PROGRAM


controller.stand()

time.sleep(4)

controller.sit()

time.sleep(4)

controller.move_direction("forward", 1)

time.sleep(1.5)

controller.rotate("left",2)

time.sleep(2.5)

controller.move_direction("backward", 1)

time.sleep(1.5)

controller.turn_body_pitch_yaw(0.5, 0.5)

time.sleep(4)

NOW YOU CAN TEST/RUN YOUR CODE!


python3 code_here.py

or python code_here.py

congrats you have officially ran code on spot!