BitBucketsFRC4183 / FRC2022-Rapid-React

Team 4183's repository for our Rapid React robot's code
MIT License
4 stars 17 forks source link

Shooter isUpToSpeed isn't working for BMS #113

Closed cpostbitbuckets closed 2 years ago

cpostbitbuckets commented 2 years ago

After testing, we realized the isUpToSpeed was only stopping the feeder motor, not the BMS, so the BMS was still feeding balls in even if the feeder was stopped.

We added code to check isUpToSpeed and shooter state in the Robot.java and spin/stop the BMS. Something is wrong though, the BMS only twitches and then immediately stops. The feeder works correctly though...

cal-miller-harvard commented 2 years ago

I think that the problem is that you're both setting the state of the BMS in teleopPeriodic and using the buttons. Those two might be fighting over the state of the system and making it misbehave.

As always, the correct solution is to avoid this sort of bug in the first place and write a fully specified finite state machine describing the system's desired behavior. But you might get away with removing the button manually controlling the BMS here. You'll also want to fix the logic so that the BMS (and feeder, I guess) doesn't run whenever the shooter is turned on and up to speed, but so it runs when those conditions are met AND the shoot button is pressed.

Let me know if those changes fix the problem!

ojas-sanghi commented 2 years ago

fixed in #118

ojas-sanghi commented 2 years ago

This should be closed