|
LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
|
Functions | |
| void | init (const Pose &initial, MCLConfig cfg={}) |
| Initialize the filter. | |
| void | reset (const Pose &pose) |
Snap the state mean to pose and reset covariance to a small value. | |
| void | predict (float dLocalX, float dLocalY, float dTheta, float dt) |
| Propagate mean + covariance one tick forward using local-frame arc deltas. | |
| Pose | mean () |
| Pose | velocity () |
| float | covTrace () |
| bool | diverged (float threshold_in_sq) |
Measurement updates | |
Each update is independent.
| |
| void | updateHeadingIMU (float thetaRad, float variance) |
| void | updateGPS (float x, float y, float variance) |
| void | updateWheelPose (const Pose &measured, float variance) |
Live tuning | |
Used by the on-brain tuner to push noise constants without reinitializing the filter. | |
| MCLConfig | config () |
| void | setConfig (const MCLConfig &cfg) |
| MCLConfig light::ekf::config | ( | ) |
| float light::ekf::covTrace | ( | ) |
trace(P[0:2, 0:2]) — position uncertainty in in². | bool light::ekf::diverged | ( | float | threshold_in_sq | ) |
threshold_in_sq. Initialize the filter.
| initial | starting pose (mean) |
| cfg | process-noise / convergence thresholds |
| void light::ekf::predict | ( | float | dLocalX, |
| float | dLocalY, | ||
| float | dTheta, | ||
| float | dt | ||
| ) |
Propagate mean + covariance one tick forward using local-frame arc deltas.
| dLocalX | forward delta this tick, inches |
| dLocalY | lateral delta this tick, inches |
| dTheta | heading delta this tick, radians |
| dt | seconds since last predict |
| void light::ekf::reset | ( | const Pose & | pose | ) |
Snap the state mean to pose and reset covariance to a small value.
Used when LightCast strongly disagrees with the EKF.
| void light::ekf::setConfig | ( | const MCLConfig & | cfg | ) |
| void light::ekf::updateGPS | ( | float | x, |
| float | y, | ||
| float | variance | ||
| ) |
| void light::ekf::updateHeadingIMU | ( | float | thetaRad, |
| float | variance | ||
| ) |
| void light::ekf::updateWheelPose | ( | const Pose & | measured, |
| float | variance | ||
| ) |
| Pose light::ekf::velocity | ( | ) |
(vx, vy, omega).