This pull request will merge the changes I made before filming the robot.
Gyroscope
Using a script written by @skallaher, the gyroscope uses a Raspberry Pi to publish its data to NetworkTable instead of using an Arduino with a serial connection. Using a Raspberry Pi still transfers some processing power away from the roboRIO while being a more reliable approach.
There was a mix-up with the data, so getting the gyroscope's roll value will actually get the heading value. The script has already been fixed, but this will mean that the script on the Raspberry Pi's SD card needs to be reinstalled before correcting the robot code.
Limelight
LimelightSubsystem will remember the last distance value it calculated and sets that as the invalid value when publishing to NetworkTable. This means the robot can shoot balls while the Limelight is not tracking the target.
The "last distance value" will start out as 0. This can count as an invalid value because the Limelight wouldn't be able to see the target if the robot is up against it. Doing this allows the shooter hood and wheel to run at about 52 degrees and about 3000 RPM. Normally at competitions, the shooter would be ideally initialized to shoot balls from the Target Zone. However, having the shooter run at the previously mentioned parameters will be useful for outreach events (such as STEM Club Robot Week) when there isn't a target to aim at.
Shooter
The balls were leaving the shooter too slowly, so adding 1000 RPM to the formula makes the balls travel in a mostly straight line instead of an arc.
Because the balls will travel in pretty much a straight line, the formula for the hood has been adapted.
As the robot approached the target, the hood's angle went higher. As a result, the balls exited the shooter at the wrong angle. This was corrected by taking the calculated angle's complement and biasing the hood down by ten degrees, hence the 80 in getDesiredAngle().
getDesiredAngleByZone() has been removed because getDesiredAngle() can accomplish the same purpose as getDesiredAngleByZone().
The NEO motors' maximum RPM is 5676 and the hood can move from 30 to 74 degrees. Using MathUtil.clamp() with those values helps to keep the shooter running safely.
There were some improvements to the PID constants for HoodPIDCommand, but it wasn't reliable enough to use for filming.
Drive
Adding manual arcade drive makes it easier to drive some of the Hyperdrive Challenge paths.
There is a problem with the throttle and turnRate in arcadeDrive() that is also present in #24. Currently, swapping the joystick values compensates for this issue.
Inverting the drivetrain for a reverse mode helps to complete the Bounce Path more efficiently.
RobotContainer
Xbox controller button mappings have been reorganized.
Calling alongWith() while using multiple commands will automatically return a ParallelCommandGroup so the shooter can spin up and adjust its angle at the same time.
A scheduling problem in ChomperUpPIDCommand and ChomperDownPIDCommand has been fixed. If the chomper is in the middle of running a PID command and it gets interrupted by another PID command, it will move to and stay at the second PID command's setpoint.
Resolves #3, closes #7, resolves #9, closes #10, and closes #29.
This pull request will merge the changes I made before filming the robot.
Gyroscope
NetworkTable
instead of using an Arduino with a serial connection. Using a Raspberry Pi still transfers some processing power away from the roboRIO while being a more reliable approach.Limelight
LimelightSubsystem
will remember the last distance value it calculated and sets that as the invalid value when publishing toNetworkTable
. This means the robot can shoot balls while the Limelight is not tracking the target.Shooter
getDesiredAngle()
.getDesiredAngleByZone()
has been removed becausegetDesiredAngle()
can accomplish the same purpose asgetDesiredAngleByZone()
.MathUtil.clamp()
with those values helps to keep the shooter running safely.HoodPIDCommand
, but it wasn't reliable enough to use for filming.Drive
throttle
andturnRate
inarcadeDrive()
that is also present in #24. Currently, swapping the joystick values compensates for this issue.RobotContainer
alongWith()
while using multiple commands will automatically return aParallelCommandGroup
so the shooter can spin up and adjust its angle at the same time.ChomperUpPIDCommand
andChomperDownPIDCommand
has been fixed. If the chomper is in the middle of running a PID command and it gets interrupted by another PID command, it will move to and stay at the second PID command's setpoint.