|
Boboter
|
The firmware is segmented into various FreeRTOS tasks, each with specific responsibilities, to efficiently manage and categorize workloads. For lighter, cooperative routines, refer to subtasks.md.
Cores 0 and 1 are both utilized. Core 0 is generally allocated for critical system functionality and higher-priority tasks, while Core 1 handles more general processing, communication, and management tasks.
| Task Name | Priority | Stack Size | Assigned Core | On what condition is it created |
|---|---|---|---|---|
| Secure Task | 24 | 2048 | Core 0 | Is always created |
| Drive Task | 20 | 4096 | Core 1 | If the flag ENABLE_TEST_MODE is set to false |
| Ramp Task | 19 | 2048 | Core 1 | Is always created |
| Sensor Reader Task | 17 | 4096 | Core 1 | If the flag ENABLE_TEST_MODE is set to false |
| Action Task | 14 | 4096 | Core 1 | If the flag ENABLE_TEST_MODE is set to false |
| App Backend Task | 12 | 8192 | Core 0 | If the flag ENABLE_TEST_MODE is set to false |
| Gamepad Task | 11 | 8192 | Core 0 | If the flag ENABLE_TEST_MODE is set to false |
| Log Task | 9 | 4096 | Core 1 | Is always created |
| Subtask Scheduler Task | 7 | 4096 | Core 1 | Is always created |
| Test Task | 21 | 2048 | Core 1 | If the flag ENABLE_TEST_MODE is set to true |
This critical task ensures system integrity and prevents hazardous conditions, such as battery over-discharge, by continuously monitoring vital parameters and initiating safety procedures.
Manages the robot's motors with built-in corrections (PID controller) which utilize the encoder, and, if present, the imuscope, accelerometer and magnetometer. Performs continuous PID calculations to minimize control errors, ensuring the robot maintains stable speed and trajectory under varying loads. This task directly controls motor output.
Manages smooth acceleration and deceleration of motors, gradually adjusting towards target speeds.
Responsible for performing resource-heavy or blocking sensor readings. It makes raw sensor data available for other tasks.
Executes complex robot behaviors and high-level logic, such as line following, obstacle avoidance, or navigation. This task interprets commands and translates them into sequences of robot actions.
Handles communication with the companion application. It sends telemetry data and receives control commands.
Manages and processes communication with a bluetooth gamepad for robot control via Bluepad32.
Processes and outputs system log messages.
This task manages the execution of multiple lightweight, cooperative subtasks. It dispatches subtasks based on their requested timing, sharing its execution context to reduce overall RAM usage. See subtasks.md for details on the subtasks it manages.
A special diagnostic task only activated when ENABLE_TEST_MODE is true. It performs comprehensive checks on the robot's hardware components (sensors, motors, etc.) to verify functionality and detect defects.