lib7842 is a collection of powerful utilities and motion algorithms for VEX V5 robots. Designed to be used with the PROS framework, it builds on top of the OkapiLib library. lib7842 was in development during my time on the 7842F/B robotics team between 2018-2021.
This is released as-is, with little documentation (other than the source code)
and no support. All source code is located in
/include/lib7842/ and /src/lib7842/.
Major features:
- Constexpr spline representation and generation
- Open-loop skid-steer and x-drive trajectory generation
- Convenience classes for asynchronous actions and task management
- Three-encoder and two-encoder odometry
- Pure pursuit path following
- LVGL-based GUI system for displaying important information on the V5 Brain
Some parts of the library, especially the odometry and trajectory generation, are documented in my journal.
Example usage of the library, and what is possible using an autonomous routine, is available in my change up competition code.
Demonstration of open-loop trajectory generator:
6th-place world skills run:
Constructed using desired trajectories like this:
Resulting in pre-planned wheel velocities like this:
- Introduction | Journal | Python Simulation
- 1D Trapezoidal Motion Profile, parameterized for distance, supporting
piecewise velocity waypoints
(
api/trajectory/profile) - Skid-steer open-loop trajectory generation
(
trajectory/skidGenerator.hpp+trajectory/skidGenerator.cpp), with high-speed computation and oversaturation protection. - X-drive open-loop trajectory generation
(
trajectory/xGenerator.hpp+trajectory/xGenerator.cpp), with arbitrary heading profiling and waypoints- supports following the trajectory like a skid-steer (at an arbitrary start heading), or rotating while driving
- Async actions for chassis controllers
(
include/api/async+src/api/async|Async/Trigger) - Convenience class for creating subsystems that use Tasks
(
TaskWrapper| Writeup) - Modular GUI system for rapidly displaying important information on the V5
Brain using LVGL
(
api/gui|GUI)- Easy selectors, buttons, graphs, odom display, vision display, and more
- V5 Vision Sensor Filtering and Processing
(
include/api/vision+src/api/vision|Container/Vision| Writeup)
- Three-Encoder Odometry
(
customOdometry.hpp+customOdometry.cpp) - Skid-Steer PID-based chassis controller
(
odomController.hpp+odomController.cpp| Writeup)- Supports custom behaviour for turning, settling, and async actions
- X-drive PID-based chassis controller
(
odomXController.hpp+odomXController.cpp| Writeup)- Supports custom behaviour for turning while strafing, settling, and async actions
- Comprehensive path representation library
(
api/positioning/spline)- Arcs, n-th degree Bézier curves, Hermite splines, arc meshing, and more
- Full constexpr compile-time sampling support
- Pure Pursuit path following
(
include/api/purePursuit+src/api/purePursuit| Writeup)- Skid-steer pure pursuit controller with improved settling behaviour
(
pathFollower.hpp+pathFollower.cpp) - X-drive pure pursuit controller with custom turning-while-strafing behaviour
(
pathFollowerX.hpp+pathFollowerX.cpp)
- Skid-steer pure pursuit controller with improved settling behaviour
(
- Built on top of OkapiLib device abstractions, so is platform-agnostic
- Can be built on PC using OkapiLib mocking library
- LVGL GUI library can be developed on PC
- Unit tests written for most components using
doctest- Tests are included in class source files
- Tests are run both in CI but also on
debugdeployments on the V5
- Use git flow for development
