There are two force examples in this directory.
An example force trajectory by ramping up and down a vertical force over 10 seconds.
A more complex example demonstrating hybrid position-force mode and trajectories.
Both examples initialize the SDK to talk to robot and how to command Spot to stand before executing the arm force control trajectories.
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.
Remember, you will need to launch a software e-stop separately. The E-Stop programming example is here.
Make sure the Motor Enable button on the Spot rear panel is depressed.
Make sure Spot is sitting upright, with the battery compartment on the side closest the floor.
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
Run the Examples
To run the force example:
python3 force_trajectory.py ROBOT_IP
To run the hybrid trajectory example:
python3 force_wrench_control.py ROBOT_IP