|
Wolflib 0.1.0
PROS differential-drive motion, mapping, and Monte Carlo localization
|
Wolflib is a private differential-drive motion and localization library for PROS 4.2.2. It provides tracking-wheel/IMU odometry, PID-based autonomous motions, driver-control curves, learned occupancy maps, Monte Carlo localization (MCL), odometry-first pose fusion, and a compact LVGL field view.
Path assets, pure pursuit, and path following are intentionally not included.
The API website is generated with Doxygen and the pinned Doxygen Awesome theme from README.md, docs/, and the public headers in include/wolflib. GitHub Actions builds it on every relevant push to main and publishes generated HTML to 750W/wolflib-docs. The live site is 750w.github.io/wolflib-docs.
Build the same site locally with:
Then open build/docs/html/index.html.
src/main.cpp and replace every placeholder port and dimension.kMappingMode = true, drive a deliberate scan of the static field, and press X to save the map.kMappingMode = false, rebuild, and verify loadMap() succeeds before relying on MCL corrections.The project builds both example firmware and a reusable PROS template archive:
Run the platform-independent regression suite on a host computer with:
All chassis distances are inches and headings are degrees. The field origin is its center; positive X points right, positive Y points forward, and positive heading rotates clockwise.
Three pose products are intentionally separate:
getOdometryPose() is raw tracking-wheel/IMU integration.getMclEstimate() is the raw particle estimate and uncertainty.getPose() is what motion controllers use.MCL never replaces short-term odometry. When an estimate passes the configured sensor-count and covariance gates, it adjusts a bounded map-to-odometry correction. setMclFusionEnabled(false) removes that correction from getPose() without stopping the filter. resetMclToOdometry() reseeds the particles and clears the correction.
Mapping is an odometry-referenced occupancy scan, not loop-closing SLAM. A bad tracking pose produces a bad map. Scan slowly from a known pose and prioritize walls or fixed structures. Use ignoredMapRegions for areas dominated by movable game pieces. Runtime MCL uses an explicit outlier component, but no filter can make a map of constantly changing objects fully reliable.
See docs/GUIDE.md for the API, tuning, failure handling, and hardware checklist. For autonomous programming examples, motion options, queueing, and cancellation, see docs/MOTIONS.md.