Ansible allows us to run actions on multiple robots at once. Actions are communicated through YAML files called playbooks. Playbooks contain a series of tasks (eg. move a file, run this script, output this command) and logic dictating dependencies between tasks. When playbooks are run, Ansible establishes an SSH connection between the user's computer and robot, allowing it to run the tasks in the playbook. Output from each task, and any other requested output, is displayed on the console
For a more detailed look at how Ansible works, see the RFC
Example command: bazel run //software/embedded/ansible:run_ansible --platforms=//cc_toolchain:robot --//software/embedded:host_platform=<platform> -- --playbook deploy_robot_software.yml --hosts <robot_ip> --ssh_pass <robot_password>
- :
PI
orNANO
depending on the computer on the robot - <robot_ip>: IP address of the robot
- <robot_password>: Password of the robot
More commands available here
Systemd allows us to have services which start as soon as we boot the robot, will automatically restart and are individually controllable. All services have the file {service}.service, which controls the configuration of that service. Currently we have a service for thunderloop, announcements and display
To learn more about how it works, see the RFC
Redis is an in-memory key-value store. This allows us to share state between processes as well as modify values dynamically through the provided cli. Values also persists between boots.
Thunderloop is software that runs in a loop. It continuously polls services (unrelated from Systemd), sending relevant control protos (PowerControl
, MotorControl
) and receiving back status protos from the power and motor boards. Currently we have a Network, Power and Motor services. Thunderloop also receives World
and PrimitiveSet
protos from AI and sends back Robot Status
protos.
Motor and Power services both interface with their respective electrical boards over different communication interfaces, namely SPI and UART respectively.