1516X Push Back 1.0
1516X's robot code for the 2025-2026 VEX Robotics Competition
Loading...
Searching...
No Matches
MCL.cpp File Reference
#include "MCL.h"
#include "globals.h"
#include "pros/rtos.hpp"
#include <algorithm>
#include <cmath>
#include <vector>
#include <cstdio>

Go to the source code of this file.

Classes

struct  MCL::SensorConfig
struct  MCL::XorShift32

Namespaces

namespace  MCL

Functions

float MCL::degToRad (float d)
float MCL::wrapAngle (float a)
void MCL::StartMCL (double x, double y)
void MCL::MotionUpdate (double dX_global, double dY_global, double dTheta, double robot_theta_deg)
void MCL::SensorUpdate (const std::vector< float > &measurements, float robot_theta_deg, float current_confidence)
float MCL::computeESS ()
void MCL::Resample ()
void MCL::MonteCarlo ()

Variables

double MCL::PARAMS_TRANS_BASE = 0.3
double MCL::PARAMS_TRANS_GAIN = 0.025
double MCL::global_X = 0
double MCL::global_Y = 0
double MCL::global_Theta = 0
double MCL::global_Confidence = 0
float MCL::w_slow = 0.0f
float MCL::w_fast = 0.0f
constexpr float MCL::ALPHA_SLOW = 0.001f
constexpr float MCL::ALPHA_FAST = 0.1f
constexpr float MCL::FIELD_SIZE = 140.42f
constexpr float MCL::HALF_SIZE = FIELD_SIZE * 0.5f
constexpr float MCL::FIELD_MIN = -HALF_SIZE
constexpr float MCL::FIELD_MAX = HALF_SIZE
constexpr float MCL::MAX_SENSOR_READING = 55.0f
float MCL::particle_x [NUM_PARTICLES]
float MCL::particle_y [NUM_PARTICLES]
float MCL::particle_weights [NUM_PARTICLES]
pros::Mutex MCL::particle_mutex
const std::vector< SensorConfigMCL::SENSOR_CONFIGS
struct MCL::XorShift32 MCL::rng