LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
sensor_aux.hpp File Reference

Override-on-confidence accuracy boosters for partial sensor configs. More...

Go to the source code of this file.

Namespaces

namespace  light
 Initialize once via init(); poll getPose/setPose from any task.
 
namespace  light::sensor_aux
 

Functions

void light::sensor_aux::init (const OdomSensors &sensors)
 Capture the sensor bundle and detect single-wheel modes.
 
void light::sensor_aux::tick ()
 Run all four detectors.
 
float light::sensor_aux::imuBiasRadPerSec ()
 
bool light::sensor_aux::singleVertMode ()
 
float light::sensor_aux::singleVertOffset ()
 
bool light::sensor_aux::singleHorizMode ()
 
float light::sensor_aux::singleHorizOffset ()
 
bool light::sensor_aux::slipping ()
 
int light::sensor_aux::wallSnapsThisAuton ()
 
void light::sensor_aux::resetCounters ()
 Reset diagnostic counters at auton start.
 

Detailed Description

Override-on-confidence accuracy boosters for partial sensor configs.

Four detectors run from the 100 Hz odom tick after light::update(). Each gates itself on a confidence check and only fires when the gate trips. Trigger conditions:

  • IMU bias (ZUPT): robot stationary for AUX_ZUPT_DWELL_MS — sample gyro rate, expose as a bias offset that odometry.cpp subtracts.
  • Single-wheel rotation correction: exactly one tracking wheel on an axis — odometry.cpp subtracts the rotational arc component using the wheel's offset and the IMU heading delta.
  • Wheel-slip detection: wheel-derived dtheta disagrees with IMU dtheta beyond AUX_SLIP_DEG_PER_100MS — odometry.cpp zeros the wheel-derived translation for the duration of the slip.
  • Single-axis wall-snap: a distance sensor reads consistent with a known wall — sensor_aux directly overrides the perpendicular pose axis via light::setPose().

Definition in file sensor_aux.hpp.