I finished all of the theoretical work in our library! (with the exception of MCL, which is a thing of its own and is definitely coming later!). Most of this devlog was bug testing by applying our pre-compiled binary into a new PROS project, 2026-2027OVERRIDE, where I could upload to the robot and see what’s not working and why. I also cleaned up the include header order and hierarchy.
Boomerang:
Fixed the carrot point shifting out too far and causing overshoot and reversing. The carrot point now updates as the robot moves, and the drive PID is clamped between maxSpeed and 0.0 when the carrot is behind us, so we turn instead of reverse. I also slew the driveOutput before computing left and right voltages so the turn ratio is preserved.
Boomerang now has its own drive and turn settle values instead of driveStraight’s, since it’s a curve in x, y, and heading. It also uses the Turn PID instead of Angular Correction so following the carrot point gets priority.
Added async and motion queuing protection, stuck detection, and static friction pushes for when the drive gains are too small.
For motion chaining, we draw a line through the end point at the end heading and compare how far along it we are with earlyExitRange.
Fixed the wide curves and sideways drift. Tank drives (especially with omnis) can’t correct for drift sideways, so boomerang now calculates curvature like pure pursuit and slows down on sharp curves. How much is tuned with params.curveK, which represents the robot’s sideways grip, so you can use bigger leads without skidding.
Fixed the robot lurching forward at full speed inside closeDist, where the speed limiters turn off. maxV is now clamped to either the original speed or about half of max speed, whichever is less. Boomerang is now fully working!
Pure Pursuit (now curve()):
The LOST/STUCK bug came from very tight curves where the voltage wasn’t enough to overcome friction, so the robot thought it wasn’t moving. The fix is a kS deadband (around 1000 mV) like the rest of the drive functions. The attached picture shows how well it follows points on completely untested default values, along with screenshots of all the tunable parameters.
driveTo functions (still deprecated, coming soon!):
Added a built-in chain (turn, drive, and another turn for driveToPose) with its parameters as drivetrain members, so there are no hard-coded magic numbers. The cancelled or invalid motion check is cleaner too.
swingToHeading():
Giving the non-pivoting side 0 voltage still counts as a movement command, so it wasn’t holding position. Now that side is set to brake during the motion and restored to its original brake mode after.
Robot & testing:
Added drive code and pneumatics to our robot for the upcoming competition. I also tested our custom objects and PROS object layering, which worked as expected. I commented out our future MCL instance because of compiler warnings. The boomerang test data on our data visualizer matched real life, and it settled within 1 inch with barely any tuning.
Next steps: splitting the code into .cpp files to finish the OOP refactor, then MCL and the autonomous/MCL simulator!
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.