|
LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
|
Enumerations | |
| enum class | Face { FRONT , BACK , LEFT , RIGHT } |
| Robot-frame face that a distance sensor is mounted on. More... | |
Functions | |
| DistanceSensorSpec | fromFace (pros::Distance *s, Face face, float along, float depth) |
Convenience builder — derives angle from face, offsets from (along, depth). | |
| 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) |
|
strong |
Robot-frame face that a distance sensor is mounted on.
| Enumerator | |
|---|---|
| FRONT | |
| BACK | |
| LEFT | |
| RIGHT | |
Definition at line 27 of file lightcast.hpp.
| 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.
| DistanceSensorSpec light::lightcast::fromFace | ( | pros::Distance * | s, |
| Face | face, | ||
| float | along, | ||
| float | depth | ||
| ) |
Convenience builder — derives angle from face, offsets from (along, depth).
| s | the PROS distance sensor (pointer, not owned) |
| face | which face the sensor is mounted on |
| along | position along the face, robot-frame signed (LEFT/RIGHT +/-) |
| depth | distance from robot center perpendicular to the face (always positive) |
Raw DistanceSensorSpec (in odometry.hpp) stays exposed for diagonal mounts.
| 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.