You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kevin Lam edited this page Mar 26, 2019
·
1 revision
When we create a new mechanism, and write software for that mechanism, we often do it in the same way.
Code Features Checklist
Create a singleton class, derived from Subsystem, for each mechanical unit.
Contain private instantiations the objects representing all of the electronic/physical components of the subsystem. For example, a Talon motor controller, and an AnalogInput representing the readings from a sensor.
Configurable parameters for the physical IDs of all the components, such as the CAN ID of the motor or the analog input number of the sensor. Ensure that competition, practice, and simulated robots could each be given their own set of constants. These parameters can be defined in one place such as a global Constants class.
Configurable local class constants for tweaking the mechanism, such as a sensor threshold or preconfigured (tuned) running speed for a motor, PID constants, etc.
Error checking on instantiation and setup of the objects.