Command-based robot keeps moving after button release

My team is doing swerve this year and whenever we activate our ball launcher while driving in a direction, if we release the throttle while still activating the ball shooter, the robot keeps moving in that direction. Any reason why this is?

Can you post code?


Does the robot also keep moving forward when not activating the shooter? If so, you likely just have it in coast mode. If not, then perhaps it’s being moved by the momentum of the shooter wheel?

In all honesty, I’m just grasping at straws without more information. We’d need to know more about the design of your robot (both mechanically and electrically). Also, as @Amicus1 said, please share your code.

You likely don’t have code in your end method to stop the swerves from driving when you release. But yes, code helps.

Code would help, but another guess would be that your ball shooter command is consuming the thread and not letting the control loop run (it has a while loop in it, for example.) Are you getting any messages about loop overrun in the console?

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.