|
libstp
Robotics library for Botball
|
#include <chassis_control_context.hpp>
Public Member Functions | |
| void | setSink (ChassisVelocitySink sink) noexcept |
| Register the on-MCU chassis sink. Called once by the platform bundle. | |
| bool | hasSink () const noexcept |
| True when an on-MCU chassis loop is registered. | |
| bool | command (double vx, double vy, double wz) const noexcept |
| ChassisControlContext (const ChassisControlContext &)=delete | |
| ChassisControlContext & | operator= (const ChassisControlContext &)=delete |
| ChassisControlContext (ChassisControlContext &&)=delete | |
| ChassisControlContext & | operator= (ChassisControlContext &&)=delete |
Static Public Member Functions | |
| static ChassisControlContext & | instance () |
| Access the process-wide instance. | |
Process-wide registry for the optional on-MCU chassis velocity loop.
The flag/sink lives in libstp-foundation (a single shared instance) so the drive layer (Drive::update) can forward the body-velocity command to the coprocessor WITHOUT taking a link-time dependency on any platform bundle — the platform bundle registers the sink at startup (e.g. wombat Platform::createOdometry → TransportWriter). Mirrors SpeedModeContext: instance() is defined out-of-line so the static lives in libfoundation.so and every module shares the same registry.
When a sink is registered (real hardware), the STM32 performs the inverse kinematics + per-motor velocity PID, so the Pi runs NO host-side IK or velocity control. With no sink (mock/sim), command() returns false and the Drive falls back to host-side control.
Definition at line 29 of file chassis_control_context.hpp.
|
delete |
|
delete |
|
inlinenodiscardnoexcept |
Forward a body-frame velocity command to the registered sink.
Definition at line 49 of file chassis_control_context.hpp.
|
inlinenodiscardnoexcept |
True when an on-MCU chassis loop is registered.
Definition at line 42 of file chassis_control_context.hpp.
|
static |
Access the process-wide instance.
|
delete |
|
delete |
|
inlinenoexcept |
Register the on-MCU chassis sink. Called once by the platform bundle.
Definition at line 36 of file chassis_control_context.hpp.