When the robot is enabled, most motors have a desired brake/coast setting. For example, the drive train should be in brake mode to slow the robot when it's commanded to stop; a shooter may be in coast mode to conserve its momentum after shooting (good for shooter startup time and battery usage).
When the robot is disabled, it's beneficial for most motors to be in coast mode, to allow humans to manually move mechanisms more easily. For example, to push the robot across the floor, or to move an arm or other mechanism without fighting the braking force.
When the robot becomes disabled, we don't want the motors to immediately switch to coast mode. This has a negative side effect of allowing the robot to coast across the playing field when time expires at the end of a match. Other mechanisms may have similar side effects. In the past, we've used the roboRIO User button to switch the robot into coast mode, and automatically switch into brake mode when the robot is enabled.
We should implement brake/coast mode switching for motors as appropriate. When the robot enables, motors should switch to brake mode (as appropriate). Switching to coast mode could be either by use of the User button, or automatically some amount of time (e.g. 5 seconds) after the robot is disabled.
Automatically switching to coast mode should not happen if there are any safety concerns. (For example, in the 2023 game where the robot could be on an inclined ramp and start rolling unexpectedly).
Suggested implementation
[x] Add a method in each subsystem that takes in a boolean and sets motors to break mode or coast mode accordingly.
[ ] Make a method in RobotContainer.java that takes in a boolean, calls the previously created break mode method in each subsystems, and passes in the boolean to each subsystem method. This method allows Robot.java to set the necessary subsystems to break mode or coast mode.
[x] Implement the correct logic in Robot.java that calls the method previously created in RobotContainer.java that sets the motors to break mode and coast mode when necessary
Extension of issue #36 item 4
Overview
When the robot is enabled, most motors have a desired brake/coast setting. For example, the drive train should be in brake mode to slow the robot when it's commanded to stop; a shooter may be in coast mode to conserve its momentum after shooting (good for shooter startup time and battery usage).
When the robot is disabled, it's beneficial for most motors to be in coast mode, to allow humans to manually move mechanisms more easily. For example, to push the robot across the floor, or to move an arm or other mechanism without fighting the braking force.
When the robot becomes disabled, we don't want the motors to immediately switch to coast mode. This has a negative side effect of allowing the robot to coast across the playing field when time expires at the end of a match. Other mechanisms may have similar side effects. In the past, we've used the roboRIO User button to switch the robot into coast mode, and automatically switch into brake mode when the robot is enabled.
We should implement brake/coast mode switching for motors as appropriate. When the robot enables, motors should switch to brake mode (as appropriate). Switching to coast mode could be either by use of the User button, or automatically some amount of time (e.g. 5 seconds) after the robot is disabled.
Automatically switching to coast mode should not happen if there are any safety concerns. (For example, in the 2023 game where the robot could be on an inclined ramp and start rolling unexpectedly).
Suggested implementation
RobotContainer.java
that takes in a boolean, calls the previously created break mode method in each subsystems, and passes in the boolean to each subsystem method. This method allowsRobot.java
to set the necessary subsystems to break mode or coast mode.Robot.java
that calls the method previously created inRobotContainer.java
that sets the motors to break mode and coast mode when necessary