This example illustrates the methodology for dispatching extended-duration trajectories to Spot in batches.
The robot executes a curved path with its arm while performing a rotational movement with its torso.
The entire sequence spans 40 seconds, during which the robot's arm traces a Rhodonea curve, also known as a rose curve, manifesting as a quintuple-petaled flower, completing its pattern every 10 seconds. Concurrently, the robot's torso executes a rotation dictated by a sine wave, also with a 10-second periodicity.
Discrete trajectory points are generated by sampling at a frequency of 20 Hz. Notably, both trajectories incorporate an initial 4-second ramp-up phase, observable as the robot gradually assumes the starting posture.
It is important to acknowledge that, due to constraints within the Software Development Kit (SDK), it is currently unfeasible to batch and dispatch trajectories for the robot's gripper.
Make sure there is approximately 1 meter free around the robot in all directions. Once the Spot driver is running, you can start the example with:
ros2 run spot_examples batch_trajectory --robot spot_name
For example:
ros2 run spot_examples batch_trajectory --robot Opal
The following parameter is mandatory.
--robot robot_name
The name of the Spot robot to use, e.g. "Opal".
The same command can be run/debugged in VSCode by adding the following to your launch configuration file launch.json
.
{
"name": "batch_trajectory",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/ws/src/external/spot_ros2/spot_examples/spot_examples/batch_trajectory.py",
"args": [
"--robot",
"Opal"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"justMyCode": true
}