The change log will be updated with every commit and will walk through my though process of implementing changes and challenges I faced working on them.
Todo:
- Create basic code to move various models of motors in
./robotCode- Kraken Support
- Falcon Support
- SparkMax Support
- Network Table Support
- Create motor instances with network table
- Add support for motor movement in
./driverUI - Create a basic debug library in
./RobotCode - Add logging system in
./driverUI - Add more commands to motor features
Changes Made:
- Created two folders: One for the driver UI and one to create sample code to test the UI with.
- Initialized a WPILib project
- Initialized a python project with a venv and generated a .gitignore with CodeZombie's VSCode extension
Challenges Faced: N/A
Changes Made:
- Updated README for specific motor support
- Created
Motorinterface to easily support both motor controllers later in the code - Added support for FalconFX motors which includes Kraken and Falcon Motors
- Added support for SparkMax
Challenges Faced:
- Finding specific documentation for motors
- Constructing the
Motorinterface to be compatible with both motor libraries - Handling the fact that a SparkMax motor can have both an absolute and relative encoder
Solutions
- Found code samples in various parts of the web including Swayam's WWRF code repo and last year's GRT code. Also used auto generated Javadoc documentation.
- Changed definition of current and voltage getters because FalconFX exposes a couple values (like
motor.getSupplyVoltage()ormotor.getMotorVoltage()) and SparkMax only exposes one. - If
setPosition()is used with an absolute encoder, it doesn't do anything. (Bad Solution)
Changes Made:
- Changed setup of motor subsystem to include the
MotorInterfaceinterface andMotorabstract class to implement network table code with all instances ofMotor - Created a
MotorTestersubsystem to create test motors - Added network table implementation to
Motorclass
Challenges Faced:
- Identifying "correct" network table implementation and schema
- Handling possible race conditions in code
- Understanding overall WPILib project structure
- The network table implementation to change motor values seemed not to work
Solutions
- Once again taking inspiration from last year's GRT code and ChatGPT.
- I did research on race condition in Java and discovered AtomicBooleans and the
VolatileKeyword - Digging into documentation and also discovering command robots vs timed robots.
- Looking into the manufacturers' documentation revealed that a separate sim library was required to get them to show changes.
Changes Made:
- Made motor control widgets
- Made widget that creates motor controller widgets
- Laid out UI
- Added intractability to the controller creator
Challenges Faced:
- Learning a new UI framework alsnfsjkgs
- Getting widgets to the correct width
- Proper lining up of the motor controller widgets
Solutions
- Hard work and pain 😭
- Google!
[Video Link] (https://drive.google.com/file/d/1HZgKQ2iL1SDjZNOIrh_RFdqEI_6NvMkD/view?usp=sharing)