Package frc.rebuilt
Class ShotCalculator
java.lang.Object
frc.rebuilt.ShotCalculator
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordImmutable snapshot of all quantities needed to command the drive, hood, and flywheel subsystems for a single shot. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic doublestatic doublestatic final doublestatic final double -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic Commandstatic Commandstatic ShotCalculatorShot parameters for the current pose and velocity, cached untilclearShootingParameters()is called.static Commandstatic Command
-
Field Details
-
STARTING_HOOD_ANGLE_OFFSET
public static final double STARTING_HOOD_ANGLE_OFFSET- See Also:
-
HOOD_ANGLE_OFFSET
public static double HOOD_ANGLE_OFFSET -
STARTING_DRIVE_ANGLE_OFFSET
public static final double STARTING_DRIVE_ANGLE_OFFSET- See Also:
-
DRIVE_ANGLE_OFFSET
public static double DRIVE_ANGLE_OFFSET
-
-
Method Details
-
getInstance
-
increaseHoodAngleOffset
-
decreaseHoodAngleOffset
-
increaseDriveAngleOffset
-
decreaseDriveAngleOffset
-
getParameters
Shot parameters for the current pose and velocity, cached untilclearShootingParameters()is called.- Delay the odometry pose by
PHASE_DELAY_SECSto cover sensor latency. - Split the launcher's field-relative velocity into radial and tangential parts.
- Run the 1690 Orbit virtual-target solver, which corrects the aim for robot motion during flight.
- Turn that into a drive angle, a hood angle, and a flywheel speed.
- Returns:
- the latest
ShotCalculator.ShootingParameters
- Delay the odometry pose by
-
clearShootingParameters
public void clearShootingParameters()
-