We’re having some trouble with controlling motors in a command-based robot. When doing something like this, where m_drive
is a CANSparkMax
controller:
setDefaultCommand(Commands.run(() -> m_drive.set(1.0)));
We are having issues where this line floods the CAN bus, leading to timeout errors.
We were thinking about something like this:
setDefaultCommand(Commands.runOnce(() -> m_drive.set(1.0)));
Does the InstantCommand
get run every time the default command is scheduled, or is it only run a single time ever?
Is there a suggested paradigm for how to do this that other teams are using?