Software Notes
Learning Java
Blue Pelican.
Software Notes
My software is based on Team 254's. This allows me to borrow techniques and constructs from them. For example:
- Actions example
- Their implementation of State machines example
- Poses, Rotations and Transforms
- Trajectories
- InterpolatingTreeMaps example
Following their model also helps with collaboration - Team 195 also follows this model. This means that we can more easily collaborate and share ideas, methodologies, and sometimes even full autonomouses.
For most function of the robot, I stick to a pretty fundamental set of language features. There are a couple of places I do some whacky inheritance magic or use very language specific features but I try and keep that out of the core of the robot code.
Here's a list of important language features used:
Here's a list of software constructs used:
Here's an explanation of some Aces High constructs used:
- Actions
- Telemetry Structure
- Multithreading with Loopers/Loopables
- Poses, Rotations, and Transforms
- Trajectories
Variable Naming Conventions
k*** (i.e. kDriveWheelTrackWidthInches): Final constants, especially those found in the Constants.java file
m*** (i.e. mPathFollower): Private instance variables
Other notes
- I've standardized on using Hz everywhere.
- Prefer using Interrupt Loopers.
Thread.sleep()
isn't the best on the RIO and theInterruptLooper
uses aNotifier
based on triggers or 'notifications' from the FPGA - Prefer using
AcesRobotStatus.getFPGATimestamp()
rather thanTimer.getFPGATimestamp()
as AcesRobotStatus will automatically pick the most appropriate timesource when running on the RIO, in a unit test, or on a co-processor - SparkMax subsystems were autogenerated this year. There was a lot of redundant code so to increase consistency they were moved to being generated from a template.