Skip to content

Latest commit

 

History

History
47 lines (28 loc) · 2.97 KB

File metadata and controls

47 lines (28 loc) · 2.97 KB

Robot Software Architecture

Table of Contents

Robot Software Diagram

Robot Software Diagram

Tools

Ansible

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=//toolchains/cc:robot -- --playbook deploy_robot_software.yml --hosts <robot_ip> --ssh_pass <robot_password>

  • <robot_ip>: IP address of the robot
  • <robot_password>: Password of the robot

More commands available here

Systemd

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. Our core service brought up by systemd is thunderloop. The thunderloop.service file can be seen here.

TOML Configuration

Robot configuration is stored in a TOML file in home directory. This file contains both static configuration values and dynamic runtime values.

Thunderloop

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.