LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
lightcast.hpp
Go to the documentation of this file.
1#pragma once
2
5
25
27enum class Face { FRONT,
28 BACK,
29 LEFT,
30 RIGHT };
31
49DistanceSensorSpec fromFace(pros::Distance* s, Face face, float along, float depth);
50
61void init(const Pose& initial, const std::vector<DistanceSensorSpec>& sensors, MCLConfig cfg = {});
62
64void predict(float dLocalX, float dLocalY, float dTheta);
65
67void update();
68
70void startTask();
71
74
77
79bool converged(float threshold_in = 3.0f);
80
83
85std::vector<DistanceSensorSpec> sensors();
86
93
101void setConfig(const MCLConfig& cfg);
104} // namespace light::lightcast
Pose, sensor specs, and the global odometry / pose-estimation API.
Runtime tuning for LightCast (particle filter) and the EKF.
void startTask()
Spawn the 10 Hz LightCast update task.
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.
std::vector< DistanceSensorSpec > sensors()
Face
Robot-frame face that a distance sensor is mounted on.
Definition lightcast.hpp:27
void init(const Pose &initial, const std::vector< DistanceSensorSpec > &sensors, MCLConfig cfg={})
Initialize the particle filter.
uint32_t degenerateTickCount()
Number of ticks where the filter saw all-degenerate weights and reset to uniform (motion-model only).
void setConfig(const MCLConfig &cfg)
bool converged(float threshold_in=3.0f)
DistanceSensorSpec fromFace(pros::Distance *s, Face face, float along, float depth)
Convenience builder — derives angle from face, offsets from (along, depth).
MCLConfig config()
Per-sensor mount configuration for LightCast's ray-cast sensor model.
Definition odometry.hpp:108
Tuning knobs for the LightCast particle filter and the EKF.
Field-frame 2D pose.
Definition odometry.hpp:24