![]() |
1516X Push Back 1.0
1516X's robot code for the 2025-2026 VEX Robotics Competition
|
Classes | |
| struct | OptSegment |
| struct | AABB |
| struct | ValidMeas |
| struct | RayHit |
Functions | |
| std::mt19937 | Random (std::random_device{}()) |
| std::vector< Particle > | particles (NUM_PARTICLES) |
| std::vector< Particle > | resample_buffer (NUM_PARTICLES) |
| double | degToRad (double deg) |
| double | radToDeg (double rad) |
| double | wrapAngleDeg (double angle) |
| double | gaussian_sample (double mean, double stddev) |
| RayHit | getRaycastDistance (double sensX, double sensY, double dx, double dy) |
| void | StartMCL (double x, double y) |
| void | MonteCarlo () |
Variables | |
| double | PARAMS_TRANS_BASE = 0.2 |
| double | PARAMS_TRANS_GAIN = 0.02 |
| double | PARAMS_SENSOR_SIGMA = 2 |
| double | PARAMS_REL_SIGMA = 5.0 |
| double | global_X = 0 |
| double | global_Y = 0 |
| double | global_Theta = 0 |
| double | global_Confidence = 0 |
| double | map_min_x = -72.0 |
| double | map_max_x = 72.0 |
| double | map_min_y = -72.0 |
| double | map_max_y = 72.0 |
| pros::Mutex | particle_mutex |
| static const Segment | MAP_SEGMENTS [] |
| static const int | MAP_SEGMENT_COUNT = sizeof(MAP_SEGMENTS) / sizeof(Segment) |
| OptSegment | opt_segments [MAP_SEGMENT_COUNT] |
| AABB | map_aabbs [MAP_SEGMENT_COUNT] |
| std::vector< MCLDistanceSensor > | Sensors |
|
inline |
Definition at line 68 of file MCL.cpp.
References degToRad().
Referenced by degToRad(), and MonteCarlo().
| double MCL::gaussian_sample | ( | double | mean, |
| double | stddev ) |
Definition at line 76 of file MCL.cpp.
References gaussian_sample(), and Random().
Referenced by gaussian_sample(), MonteCarlo(), and StartMCL().
| RayHit MCL::getRaycastDistance | ( | double | sensX, |
| double | sensY, | ||
| double | dx, | ||
| double | dy ) |
Definition at line 81 of file MCL.cpp.
References MCL::OptSegment::dx, MCL::OptSegment::dy, getRaycastDistance(), map_aabbs, MAP_SEGMENT_COUNT, MCL::AABB::max_x, MCL::AABB::max_y, MCL::OptSegment::nx, MCL::OptSegment::ny, opt_segments, MCL::OptSegment::x0, and MCL::OptSegment::y0.
Referenced by getRaycastDistance(), and MonteCarlo().
| void MCL::MonteCarlo | ( | ) |
Definition at line 161 of file MCL.cpp.
References chassis, degToRad(), MCL::RayHit::dist, gaussian_sample(), getRaycastDistance(), global_Confidence, global_Theta, global_X, global_Y, map_max_x, map_max_y, map_min_x, map_min_y, MCL::ValidMeas::meas, MonteCarlo(), PARAMS_REL_SIGMA, PARAMS_SENSOR_SIGMA, PARAMS_TRANS_BASE, particle_mutex, particles(), MCL::ValidMeas::pred, Random(), resample_buffer(), Sensors, MCL::RayHit::weight, and wrapAngleDeg().
Referenced by MonteCarlo().
| std::vector< Particle > MCL::particles | ( | NUM_PARTICLES | ) |
References particles().
Referenced by MonteCarlo(), particles(), and StartMCL().
|
inline |
Definition at line 69 of file MCL.cpp.
References radToDeg().
Referenced by radToDeg().
| std::mt19937 MCL::Random | ( | std::random_device{} | () | ) |
Referenced by gaussian_sample(), and MonteCarlo().
| std::vector< Particle > MCL::resample_buffer | ( | NUM_PARTICLES | ) |
References resample_buffer().
Referenced by MonteCarlo(), and resample_buffer().
| void MCL::StartMCL | ( | double | x, |
| double | y ) |
Definition at line 119 of file MCL.cpp.
References gaussian_sample(), map_aabbs, map_max_x, map_max_y, map_min_x, map_min_y, MAP_SEGMENT_COUNT, MAP_SEGMENTS, opt_segments, particle_mutex, particles(), and StartMCL().
Referenced by StartMCL().
|
inline |
Definition at line 70 of file MCL.cpp.
References wrapAngleDeg().
Referenced by MonteCarlo(), and wrapAngleDeg().
| double MCL::global_Confidence = 0 |
Definition at line 14 of file MCL.cpp.
Referenced by MonteCarlo().
| double MCL::global_Theta = 0 |
Definition at line 14 of file MCL.cpp.
Referenced by MonteCarlo().
| double MCL::global_X = 0 |
Definition at line 14 of file MCL.cpp.
Referenced by MonteCarlo().
| double MCL::global_Y = 0 |
Definition at line 14 of file MCL.cpp.
Referenced by MonteCarlo().
| AABB MCL::map_aabbs[MAP_SEGMENT_COUNT] |
Definition at line 53 of file MCL.cpp.
Referenced by getRaycastDistance(), and StartMCL().
| double MCL::map_max_x = 72.0 |
Definition at line 15 of file MCL.cpp.
Referenced by MonteCarlo(), and StartMCL().
| double MCL::map_max_y = 72.0 |
Definition at line 15 of file MCL.cpp.
Referenced by MonteCarlo(), and StartMCL().
| double MCL::map_min_x = -72.0 |
Definition at line 15 of file MCL.cpp.
Referenced by MonteCarlo(), and StartMCL().
| double MCL::map_min_y = -72.0 |
Definition at line 15 of file MCL.cpp.
Referenced by MonteCarlo(), and StartMCL().
|
static |
Definition at line 47 of file MCL.cpp.
Referenced by getRaycastDistance(), and StartMCL().
|
static |
Definition at line 36 of file MCL.cpp.
Referenced by StartMCL().
| OptSegment MCL::opt_segments[MAP_SEGMENT_COUNT] |
Definition at line 50 of file MCL.cpp.
Referenced by getRaycastDistance(), and StartMCL().
| double MCL::PARAMS_REL_SIGMA = 5.0 |
Definition at line 12 of file MCL.cpp.
Referenced by MonteCarlo().
| double MCL::PARAMS_SENSOR_SIGMA = 2 |
Definition at line 11 of file MCL.cpp.
Referenced by MonteCarlo().
| double MCL::PARAMS_TRANS_BASE = 0.2 |
Definition at line 9 of file MCL.cpp.
Referenced by MonteCarlo().
| pros::Mutex MCL::particle_mutex |
Definition at line 17 of file MCL.cpp.
Referenced by MonteCarlo(), and StartMCL().
| std::vector<MCLDistanceSensor> MCL::Sensors |
Definition at line 55 of file MCL.cpp.
Referenced by MonteCarlo().