Team818SteelArmadillos / 2020-InfiniteRecharge

Robot code for 2020 Season
0 stars 0 forks source link

Shooter #44

Open Purgso opened 4 years ago

Purgso commented 4 years ago

The shooter has the most complex code on the robot this year and you've done an excellent job with the code so far. We're almost ready to clean up the code but there's a few things that need to be changed first. First, calculating the distance to the target will be done in the automatic shooter command. getVerticalSin() and getTargetDistance() functions can be deleted from the shooter subsystem. This will break the autoShooterPower() function so have it return 0 for now. We'll be figuring out what speed we need for each distance later. The shooter subsystem doesn't need to know whether the robot is in manual shooter or automatic shooter mode. for the shooter subsystem, both work the same way. The shooter is given a speed and tries to maintain that speed in both situations. isVerticalPIDRight() and manualISAtSpeed() can be replaced with a single atSpeed() function that returns true if setShooterSpeed > 0 and controllerShooterSpeed.atSetPoint() == true and returns false if setShooterSpeed <= 0 or controllerShooterSpeed.atSetPoint() == false. Also, controlShooterModeSet(), verticalAngle, and shooterModeImput can be deleted. Some of the names didn't end up describing their purpose and should be updated to make the code more readable. setShooterSpeed really describes the target speed of the shooter so I think targetShooterSpeed is a more descriptive name. Shooter speed is measured in RPM so kShooterToleranceRPS should really be kShooterToleranceRPM.

We're now going to have a spool shooter command. All it will do is try to spool the shooter to a set RPM if the spool button is pressed. The speed should be the same as the manual shooter.

I haven't looked at the manual or automatic shooter commands yet but I'll add a comment when I have feedback on them.