Mercs-MSA / 2024_V2

Other
1 stars 0 forks source link

Build controller mapper #3

Open andvari101 opened 1 month ago

andvari101 commented 1 month ago

There was some struggles mid-way through the 2024 season with controller functionality and what commands were mapped to what buttons. This often resulted in massive amounts of code being commented or uncommented to change the functionality of each button for a given situation, task, or test. Sometimes, this resulted in wasted time with students chasing perceived bugs that were actually just incorrect controls. Occasionally it resulted in physically broken parts because something was unintentionally activated when the wrong commands were connected to buttons.

This could be solved more elegantly, and also allow a greater degree of freedom by adopting a solution similar to PathPlanner's Named Commands. By giving joystick commands unique string names in code, we could build a Shuffleboard system that allows buttons on the controller to be remapped on the fly.

Not only will this save time when switching between testing tasks with the robot, but it opens the door for preset layouts, driver preferences, alternate controllers, etc.