team4015 / Infinite-Recharge-Robot-Rebuild-2021

Code rewrite for Infinite Recharge Robot
Other
1 stars 1 forks source link

Prevent intake from spinning when retracted #7

Closed bricktrooper closed 3 years ago

bricktrooper commented 3 years ago

Right now the intake can spin regardless of whether it is deployed or retracted. Ideally, we don't want the intake to spin when it is retracted, as this might cause mechanical problems. The robot can only properly pick up balls when the intake is down.

It might be a good idea to add a boolean variable to the Intake subsystem which records the position of the intake. The reverse() and spin() methods can read this variable before setting the motor speed.

We don't want this logic to be visible outside the Intake subsystem. For example, if the main code calls spin(), the intake object should decide whether or not the intake actually spins.

https://github.com/team4015/Infinite-Recharge-Robot-Rebuild-2021/blob/cf6f46c7daa3b0da155305cf765489b92212fbc4/src/main/java/frc/robot/subsystems/Intake.java#L31

droid-101 commented 3 years ago

Done