|
LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
|
Functions | |
| void | init (const Pose &initial, const std::vector< DistanceSensorSpec > &sensors, MCLConfig cfg={}) |
| Initialize the particle filter. | |
| void | predict (float dLocalX, float dLocalY, float dTheta) |
| Propagate particles by a local-frame arc delta. | |
| void | update () |
| Measurement update: read sensors, weight particles, resample. | |
| void | startTask () |
| Spawn the 10 Hz LightCast update task. | |
| Pose | best () |
| float | convergence () |
| bool | converged (float threshold_in=3.0f) |
| int | sensorCount () |
| std::vector< DistanceSensorSpec > | sensors () |
| uint32_t | degenerateTickCount () |
| Number of ticks where the filter saw all-degenerate weights and reset to uniform (motion-model only). | |
Live tuning | |
Mirrors the EKF API so the autotune routine and on-brain tuner can push noise constants without reinitializing the filter. | |
| MCLConfig | config () |
| void | setConfig (const MCLConfig &cfg) |
| Pose light::lightcast::best | ( | ) |
| MCLConfig light::lightcast::config | ( | ) |
| bool light::lightcast::converged | ( | float | threshold_in = 3.0f | ) |
threshold_in. | float light::lightcast::convergence | ( | ) |
| uint32_t light::lightcast::degenerateTickCount | ( | ) |
Number of ticks where the filter saw all-degenerate weights and reset to uniform (motion-model only).
Increments without printing — caller can poll on its own schedule for diagnostics.
| void light::lightcast::init | ( | const Pose & | initial, |
| const std::vector< DistanceSensorSpec > & | sensors, | ||
| MCLConfig | cfg = {} |
||
| ) |
Initialize the particle filter.
| initial | starting pose |
| sensors | list of distance-sensor specs |
| cfg | tuning constants |
| void light::lightcast::predict | ( | float | dLocalX, |
| float | dLocalY, | ||
| float | dTheta | ||
| ) |
Propagate particles by a local-frame arc delta.
Cheap, no ray-casts.
| int light::lightcast::sensorCount | ( | ) |
| std::vector< DistanceSensorSpec > light::lightcast::sensors | ( | ) |
| void light::lightcast::setConfig | ( | const MCLConfig & | cfg | ) |
| void light::lightcast::startTask | ( | ) |
Spawn the 10 Hz LightCast update task.
Call after init().
| void light::lightcast::update | ( | ) |
Measurement update: read sensors, weight particles, resample.