|
Void Sentry
An AI-driven, real-time Sentry Turret platform leveraging asynchronous I/O and computer vision to deliver high-precision autonomous motion tracking on resource-constrained embedded hardware.
|
Runs the control loop on the device: the clock, the HUD inbox, NVS, logging and the published status around the pure control::ControlLogic. More...
#include <controller.h>
Public Member Functions | |
Lifecycle Management | |
| Controller (BaseTurret &turret, BaseDetectionModule &detection_module, Joystick &joystick) | |
| Construct a new Controller object. | |
| ~Controller () override | |
| Destroy the Controller object. | |
| void | begin () |
| Loads a saved calibration from NVS, if any. Call from setup() after the turret has started. | |
Core Execution | |
| void | run () |
One pass of the control loop; call from the primary loop(). | |
| void | submit (const remote::Command &cmd) override |
| Receives a HUD command. Safe to call from the httpd task while run() executes on another core. | |
| ControlStatus | control_status () const override |
| Latest published status. Safe to call from any task. | |
Public Member Functions inherited from BaseStatusProvider | |
Public Member Functions inherited from remote::BaseRemoteSink | |
Runs the control loop on the device: the clock, the HUD inbox, NVS, logging and the published status around the pure control::ControlLogic.
Every decision (modes, button gestures, HUD requests, calibration, jog arbitration) is made by control::ControlLogic, which documents the rules and is natively tested. The Controller implements its control::ControlPorts over the BaseTurret, the BaseDetectionModule and the Joystick, turns its log events into ESP_LOG lines and saves a fresh calibration with cal_store.
Threads: submit() runs on the httpd task and only stores into the inbox under its spinlock; run() and every port call run on the loop task. The status is published under its own spinlock for any task to read.
The camera is fixed on the base and the turret aims absolutely, so a calibration is a fixed two-point mapping from image pixels to pan/tilt angles, saved in NVS.
|
inline |
Construct a new Controller object.
| turret | Reference to the turret implementation. |
| detection_module | Reference to the detection implementation. |
| joystick | Reference to the Joystick input handler. |
|
overridevirtual |
Latest published status. Safe to call from any task.
Implements BaseStatusProvider.
| void Controller::run | ( | ) |
One pass of the control loop; call from the primary loop().
Reads the clock and the button, runs one control::ControlLogic pass and publishes the status.
|
overridevirtual |
Receives a HUD command. Safe to call from the httpd task while run() executes on another core.
Only stores the command in the inbox under a spinlock; run() applies it. Moves expire after remote::kJogTimeoutMs without a refresh (dead man).
Implements remote::BaseRemoteSink.