Record Class ShotCalculator.ShootingParameters
java.lang.Object
java.lang.Record
frc.rebuilt.ShotCalculator.ShootingParameters
- Enclosing class:
ShotCalculator
public static record ShotCalculator.ShootingParameters(boolean isValid, Rotation2d driveAngle, double driveAngularVelocity, double hoodAngle, double hoodVelocity, double flywheelSpeed, double exitSpeedMs, double distance, double distanceNoLookahead, double timeOfFlight, double radialVelocity, double tangentialVelocity, boolean feedShot, String modelName)
extends Record
Immutable snapshot of all quantities needed to command the drive, hood, and flywheel
subsystems for a single shot.
-
Constructor Summary
ConstructorsConstructorDescriptionShootingParameters(boolean isValid, Rotation2d driveAngle, double driveAngularVelocity, double hoodAngle, double hoodVelocity, double flywheelSpeed, double exitSpeedMs, double distance, double distanceNoLookahead, double timeOfFlight, double radialVelocity, double tangentialVelocity, boolean feedShot, String modelName) Creates an instance of aShootingParametersrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubledistance()Returns the value of thedistancerecord component.doubleReturns the value of thedistanceNoLookaheadrecord component.Returns the value of thedriveAnglerecord component.doubleReturns the value of thedriveAngularVelocityrecord component.final booleanIndicates whether some other object is "equal to" this one.doubleReturns the value of theexitSpeedMsrecord component.booleanfeedShot()Returns the value of thefeedShotrecord component.doubleReturns the value of theflywheelSpeedrecord component.final inthashCode()Returns a hash code value for this object.doubleReturns the value of thehoodAnglerecord component.doubleReturns the value of thehoodVelocityrecord component.booleanisValid()Returns the value of theisValidrecord component.Returns the value of themodelNamerecord component.doubleReturns the value of theradialVelocityrecord component.doubleReturns the value of thetangentialVelocityrecord component.doubleReturns the value of thetimeOfFlightrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ShootingParameters
public ShootingParameters(boolean isValid, Rotation2d driveAngle, double driveAngularVelocity, double hoodAngle, double hoodVelocity, double flywheelSpeed, double exitSpeedMs, double distance, double distanceNoLookahead, double timeOfFlight, double radialVelocity, double tangentialVelocity, boolean feedShot, String modelName) Creates an instance of aShootingParametersrecord class.- Parameters:
isValid- the value for theisValidrecord componentdriveAngle- the value for thedriveAnglerecord componentdriveAngularVelocity- the value for thedriveAngularVelocityrecord componenthoodAngle- the value for thehoodAnglerecord componenthoodVelocity- the value for thehoodVelocityrecord componentflywheelSpeed- the value for theflywheelSpeedrecord componentexitSpeedMs- the value for theexitSpeedMsrecord componentdistance- the value for thedistancerecord componentdistanceNoLookahead- the value for thedistanceNoLookaheadrecord componenttimeOfFlight- the value for thetimeOfFlightrecord componentradialVelocity- the value for theradialVelocityrecord componenttangentialVelocity- the value for thetangentialVelocityrecord componentfeedShot- the value for thefeedShotrecord componentmodelName- the value for themodelNamerecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
isValid
public boolean isValid()Returns the value of theisValidrecord component.- Returns:
- the value of the
isValidrecord component
-
driveAngle
Returns the value of thedriveAnglerecord component.- Returns:
- the value of the
driveAnglerecord component
-
driveAngularVelocity
public double driveAngularVelocity()Returns the value of thedriveAngularVelocityrecord component.- Returns:
- the value of the
driveAngularVelocityrecord component
-
hoodAngle
public double hoodAngle()Returns the value of thehoodAnglerecord component.- Returns:
- the value of the
hoodAnglerecord component
-
hoodVelocity
public double hoodVelocity()Returns the value of thehoodVelocityrecord component.- Returns:
- the value of the
hoodVelocityrecord component
-
flywheelSpeed
public double flywheelSpeed()Returns the value of theflywheelSpeedrecord component.- Returns:
- the value of the
flywheelSpeedrecord component
-
exitSpeedMs
public double exitSpeedMs()Returns the value of theexitSpeedMsrecord component.- Returns:
- the value of the
exitSpeedMsrecord component
-
distance
public double distance()Returns the value of thedistancerecord component.- Returns:
- the value of the
distancerecord component
-
distanceNoLookahead
public double distanceNoLookahead()Returns the value of thedistanceNoLookaheadrecord component.- Returns:
- the value of the
distanceNoLookaheadrecord component
-
timeOfFlight
public double timeOfFlight()Returns the value of thetimeOfFlightrecord component.- Returns:
- the value of the
timeOfFlightrecord component
-
radialVelocity
public double radialVelocity()Returns the value of theradialVelocityrecord component.- Returns:
- the value of the
radialVelocityrecord component
-
tangentialVelocity
public double tangentialVelocity()Returns the value of thetangentialVelocityrecord component.- Returns:
- the value of the
tangentialVelocityrecord component
-
feedShot
public boolean feedShot()Returns the value of thefeedShotrecord component.- Returns:
- the value of the
feedShotrecord component
-
modelName
Returns the value of themodelNamerecord component.- Returns:
- the value of the
modelNamerecord component
-