This project implements an advanced motion control system for the VEX V5 platform, with a core focus on Monte Carlo Localization (MCL), designed for the VEX High Stakes competition season. It utilizes PROS and LemLib.
At the heart of this system is a full-featured Monte Carlo Localization (MCL) engine, implemented in src/monte.cpp. MCL enables the robot to:
- Precisely estimate its global position and orientation on the field, even with noisy or imperfect sensor data
- Fuse data from IMU, tracking wheels, and multiple distance sensors for maximum reliability
- Continuously correct for odometry drift, wheel slip, and field inconsistencies
- Power advanced autonomous routines and complex path planning
Traditional VEX V5 robots rely on odometry and IMU sensors for local movement tracking. However, these methods are prone to accumulating errors and can be disrupted by real-world factors like wheel slip or field imperfections, leading to unreliable autonomous performance.
Monte Carlo Localization (MCL) solves these problems by maintaining a probabilistic estimate of the robot's global position. By fusing multiple sensor inputs and using a particle filter, MCL delivers:
- Robust, accurate global position tracking
- Resilience to sensor noise and field inconsistencies
- Consistent, repeatable autonomous routines
This approach directly addresses the root causes of autonomous failures and elevates the reliability of VEX V5 robots in competition.
- Dual joystick tank drive with an exponential drive curve
- Autonomous mode selection via LVGL GUI
- Intake control system
- Pneumatic systems for mobile goal clamp
- Temperature monitoring for drivetrain and intake motors
- Reverse drive functionality
- Match timer with controller rumble alert
- Numerous driver convenience features
- Drivetrain: 3 motors per side (66W)
- Intake: 1.5 motors (16.5W)
- Lady Brown: 0.5 motors (5.5W)
- Sensors:
- IMU
- Horizontal tracking wheel
- 4 Distance sensors
- Pneumatics:
- Mobile goal clamp (large)
- Flash the program to your VEX V5 brain.
- Run the program.
- Use the LVGL GUI on the brain screen to select an autonomous mode.
- In driver control:
- Left/Right Joysticks: Control drivetrain
- R1/R2 Buttons: Control intake
- L1 Button: Toggle mobile goal clamp
- L2 Button: Toggle intake position
- B Button: Toggle reverse drive
- Close Side (Default)
- Far Side
- Skills
- Off
Autonomous routines are implemented in src/auto.cpp and src/skills.cpp.
The following code snippet illustrates the core Monte Carlo Localization (MCL) update cycle implemented in this project:
This function demonstrates the essential steps of MCL:
- Motion Update (Prediction): Predicts the robot's new pose based on odometry (robot movement).
- Measurement Update (Correction): Adjusts the particle weights using distance sensor measurements.
- Resampling: Resamples the particle set based on their weights to focus on the most likely poses.
- Pose Estimation: Computes the robot's estimated position and updates the chassis accordingly.
This cycle enables robust and accurate localization on the VEX V5 platform, even in the presence of sensor noise and uncertainty.
src/main.cpp: Main entry point, driver control logic, and GUI interactionsrc/auto.cpp: Autonomous routines for matchessrc/skills.cpp: Autonomous routines for skills challengessrc/monte.cpp: Monte Carlo Localization implementationsrc/globals.cpp: Global variablesinclude/main.h: Header for main logicinclude/globals.h: Header for globalsinclude/robot/: Robot-specific configurations and classesliblvgl/: LVGL graphics librarylemlib/: LemLib drivetrain and odometry libraryproject.pros: PROS project configurationMakefile: Build instructions
- PROS: C/C++ SDK for VEX V5
- LemLib: Advanced drivetrain control and odometry
- LVGL: Lightweight graphics library for embedded systems
- Ensure you have the PROS CLI installed.
- Navigate to the project root in your terminal.
- Run:
pros m
- Connect your VEX V5 Brain to your computer.
- Run:
pros u
This project is currently unlicensed.
