|
Re: Code for Ultrasonic Sensor
In a command based robot, I would be tempted to refactor the example into its own Subsystem.
However, this could be thought of as a special "read only" type of subsystems. Commands that made use of this subsystem would not need to require() it in their constructors as there isn't a problem if multiple commands take distance measurements at the same time. If two commands both want to get distance measurements, it isn't a problem like it is if two commands both want to manipulate drive motors.
Alternatively, I might be tempted to leave it as its own stand alone class (not make it a subsystem) and just use it as is.
|