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.