You are browsing as a guest. Sign up (or log in) to start making projects!

ericyao866

@ericyao866

Joined June 14th, 2026

  • 4Devlogs
  • 3Projects
  • 1Ships
  • 4Votes
Open comments for this post

9h 21m 20s logged

Finishing OOP, Inline commenting/documentation, update README and the driveTo functions fix(ex. driveToPoint & driveToPose), start FIX on IMU Fusion

Since all of the motions have been done and all of the functions tested so far are bug-free, I started the final process to finish OOP.

This includes:

Move all of the function bodies into their respective cpp files
Add nice commenting and description/example code to the signatures
Figure out the final file/folder structures for our library
I moved part of all of the function bodies this session and will continue doing so next, function signature and structure kept in the .hpp files and when the motions recieve each their own dedicated files they will be specified as part of drivetrain. Dedicated files are added for motions, helper functions, and odometry.

Additionally, I finally decided to change the parameters for the driveTo functions so now they are finally compatible with the new Pure Puresuit function curve(). (currently untested, have to wait until next time I have the physical robot to test)

I added the nice inline documentation/commenting to basically every single major function that the user of the template library would actually use. The nice thing about these kinds of commenting is that if that get confused they can go to where the function is defined(a.k.a. it’s signature) and read all about it. Additionally, the actual good part about these is that if they are using vsCode and hover over the function, it gives a really nice looking rendered blob pop up off how the function works, it’s required parameters, and how to actually use it with an example code. This way people would know exactly how to use the functions and what each of them does.

Other than that I briefly updated the readME to make it less confusing to read but more work is required on it.

Lastly, I started one of our main goals for this library – ability to support the fusion of multiple IMUs(we are trying to get it working for three and more). The current code would still work because it is still using the unit circle averaging that supports multiple IMUs but I want to build a comprehensive filter that would:

  • actually reject the outliers during a run
  • Only returns the deltas per run so the heading can actually be unwrapped(this helps a lot especially with the internal math and having the ability to manually choose which direction to turn other than the shortest way)
  • Be able to bench IMUs if they display inconsistencies during runs and have them re-incoporated if their deltas per run start being consistent with the rest again
  • and finally (untested, just an idea) to learn the IMUs bias when they are still to learn which way they tend to drift over time so during the actual run the total heading will subtract that constant drift to mitigate the errors that can accumulate over the run of the program.
0
0
97
Open comments for this post

5h 5m 1s logged

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!

0
0
19
Open comments for this post

5h 9m 44s logged

Finish Pure Pursuit, Motion Chaining. Starting work on Boomerang Function:
I worked more on Pure Pursuit(robot driving according to a path you’ve drawn through a imaginary circle it draws around its self and targeting where the circle intersects the path). I started by making my curve() function also return MotionResult so it is consistent with everything else in the library unlike before where it had it’s own return type FollowResult. I’ve also updated my helper function that can convert the enumberation from MotionResult into a string so the user can return the value and see what the potential error is from the logics.
I’ve also continued with the math for Pure Pursuit starting with injecting extra points into the array of points that the user provides for the path that the robot has to follow to ensure a more even data type and there aren’t senarios where the gaps are so large the circle would not find any paths to target and declare the robot as MotionResult::LOST.
To do this, I take apart the original array of points that the user provides and for any two points or segment; I divide it by the minimum gap we would accept(3 inches) to get how many new segments we would have to split it into in order that every segment is shorter than 3 inches.
Then we simply linearly interpolate the points based on how many segments we have(ex. a, a + (distance/spacing) 1, a + (distance/spacing) 2…) Ect where we just multiply the gap by the number of spaces that we want.
Lastly, I worked out a bug based on DAWGMA’s Pure Pursuit paper that sometimes the path which the robot has to take might be behind the robot(ie the robot is facing away from where the circle intercepts our path).
Thus the PP is finished fixing all known bugs(untested yet) by finally organizing all of the helper function into a master function in the PurePursuit class called step(). Then the drivetrain layer(Drivetrain class) that actually owns all of the hardware calls the function, sorts the return logic for when we are done, the path is invalid, or we are chaining the motion to move forward.
Though right now it is untested, I fixed the logic that would getActualSpeed() for the both sides of the drive by updating the encoders divided by the amount of time it has been and modifying the units based on the ratio to get an accurate RPM. We update the measured velocity each loop by blending the value we measure from the previus loop via an alpha variable(to smooth the reading to be free of noise). The user can also tune this at their will but the current default value is 40%(a.k.a. 0.4).
Lastly, I decided to make our own boomerang function(an advanced motion type in VEX) where to robot will always follow a virtual carrot point and as the robot progresses, the carrot point will blend back into the desired along the path while giving the robot a swing to reach the desired end heading as well. (A type of move to pose – where pose is position for x, y, and heading). I started doing some research and testing out the code in our library and Arduino IDE to see what it would compute and these are some of the resources I used:
https://lemlib.readthedocs.io/en/v0.5.0/tutorials/6lateralmotion.html
https://www.desmos.com/calculator/sptjw5szex
The main one(as well as with some explanation from our coach): https://area-53-robotics.github.io/Intro-To-Robotics/software/advanced-concepts/boomerang/

0
0
20
Ship Changes requested

I made my own VEX Library! This was largely inspired by Lemlib and it includes advanced functinonality such as async motion, motion chaining, and motion queuing. This library includes it’s custom UI which allows you to see the sensor datas and select autonomouses during a competition. Functionalities still in development: Pure Pursuit for fast and precise curves, MCL(a particle filter that will relocalize the robot’s position based on probablity! and four beams of light from lasers(originally should be done with lidars), IMU Fusion(done, but not yet implemented into the core code), and much more!

  • 1 devlog
  • 40h
Try project → See source code →
Open comments for this post

39h 57m 21s logged

Complete Refractor – Making everything exist in Objects to create a template Library in VEX. Made implementation of functions better from last year and fixed existing bugs. Implemented proper asymetrical slewing to wheels and worked on a better Pure Pursuit. Added a custom YogurtLib UI with LVGL and a sensor fusion that can support Up to 3 and more IMUs.

0
0
36

Followers

Loading…