Class TurnManner
- java.lang.Object
-
- frc.team1711.swerve.util.odometry.Manner
-
- frc.team1711.swerve.util.odometry.TurnManner
-
public class TurnManner extends Manner
TurnMannerdescribes the way in which the robot performs an autonomousRobotTurn.- See Also:
MovementManner
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTurnManner.TurnSpeedSupplierA functional interface which gets the speed the robot should turn at given the remaining angle to turn.-
Nested classes/interfaces inherited from class frc.team1711.swerve.util.odometry.Manner
Manner.SpeedSupplier
-
-
Field Summary
Fields Modifier and Type Field Description static TurnMannerNONEATurnMannerwhere the robot will not attempt to move and the path will immediately be completed.
-
Constructor Summary
Constructors Constructor Description TurnManner(double marginOfError, TurnManner.TurnSpeedSupplier speedSupplier)Constructs aTurnMannerinstance, describing the manner in which the robot should complete a given autonomousRobotTurn.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetMarginOfError()Gets the angular margin of error at the endpoint, such that if the robot is within this angle measure from the endpoint of the autonomousRobotTurnthe turn is considered to be finished.TurnManner.TurnSpeedSuppliergetSpeedSupplier()Gets theTurnManner.TurnSpeedSupplierassociated with thisTurnMannerinstance.
-
-
-
Field Detail
-
NONE
public static final TurnManner NONE
ATurnMannerwhere the robot will not attempt to move and the path will immediately be completed.
-
-
Constructor Detail
-
TurnManner
public TurnManner(double marginOfError, TurnManner.TurnSpeedSupplier speedSupplier)Constructs aTurnMannerinstance, describing the manner in which the robot should complete a given autonomousRobotTurn.- Parameters:
marginOfError- Adoubledescribing how far the robot can be from its endpoint in order for the turn to be considered finished, in degrees.speedSupplier- ATurnManner.TurnSpeedSupplierwhich provides the speed the robot should turn at given the remaining angle measure.
-
-
Method Detail
-
getSpeedSupplier
public TurnManner.TurnSpeedSupplier getSpeedSupplier()
Gets theTurnManner.TurnSpeedSupplierassociated with thisTurnMannerinstance.- Specified by:
getSpeedSupplierin classManner- Returns:
- The
TurnSpeedSupplierwhich describes how quickly the robot should turn while following any given autonomousRobotTurn.
-
getMarginOfError
public double getMarginOfError()
Gets the angular margin of error at the endpoint, such that if the robot is within this angle measure from the endpoint of the autonomousRobotTurnthe turn is considered to be finished.- Overrides:
getMarginOfErrorin classManner- Returns:
- The angular margin of error, measured in degrees.
-
-