Thunderbots Project
Loading...
Searching...
No Matches
Thunderloop Class Reference

Public Member Functions

 Thunderloop (const RobotConstants_t &robot_constants, bool enable_log_merging, const int loop_hz)
 
void runLoop ()
 

Public Attributes

std::unique_ptr< MotorServicemotor_service_
 
std::unique_ptr< NetworkServicenetwork_service_
 
std::unique_ptr< PowerServicepower_service_
 
std::unique_ptr< RedisClientredis_client_
 

Constructor & Destructor Documentation

◆ Thunderloop()

Thunderloop ( const RobotConstants_t robot_constants,
bool  enable_log_merging,
const int  loop_hz 
)

Thunderloop is a giant loop that runs at THUNDERLOOP_HZ. It receives Primitives and World from AI, executes the primitives with the most recent vison data, and polls the services to interact with the hardware peripherals.

High Level Diagram: Service order in loop not shown

              ┌─────────────────┐
              │                 │
              │   ThunderLoop   │
              │                 │

Primitives───────► │ Target Vel ┌────────────┐ │ ├────────────► │ World ───────────► │ │ MotorBoard │ │ Services ◄────────────┤ │ │ │ Actual Vel └────────────┘ │ Primitive Exec │ │ │ │ │ Kick/Chip ┌────────────┐ │ ├────────────► │ Robot Status◄─────┤ │ │ PowerBoard │ │ ◄────────────┤ │ └─────────────────┘ Voltages └────────────┘

Parameters
robot_constantsThe robot constants
enable_log_mergingWhether to merge repeated log message or not
loop_hzThe rate to run the loop

The documentation for this class was generated from the following files: