Class TurnManner
- java.lang.Object
-
- frc.team1711.swerve.util.odometry.Manner
-
- frc.team1711.swerve.util.odometry.TurnManner
-
public class TurnManner extends Manner
TurnManner
describes the way in which the robot performs an autonomousRobotTurn
.- See Also:
MovementManner
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
TurnManner.TurnSpeedSupplier
A 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 TurnManner
NONE
ATurnManner
where 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 aTurnManner
instance, 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 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 autonomousRobotTurn
the turn is considered to be finished.TurnManner.TurnSpeedSupplier
getSpeedSupplier()
Gets theTurnManner.TurnSpeedSupplier
associated with thisTurnManner
instance.
-
-
-
Field Detail
-
NONE
public static final TurnManner NONE
ATurnManner
where 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 aTurnManner
instance, describing the manner in which the robot should complete a given autonomousRobotTurn
.- Parameters:
marginOfError
- Adouble
describing how far the robot can be from its endpoint in order for the turn to be considered finished, in degrees.speedSupplier
- ATurnManner.TurnSpeedSupplier
which provides the speed the robot should turn at given the remaining angle measure.
-
-
Method Detail
-
getSpeedSupplier
public TurnManner.TurnSpeedSupplier getSpeedSupplier()
Gets theTurnManner.TurnSpeedSupplier
associated with thisTurnManner
instance.- Specified by:
getSpeedSupplier
in classManner
- Returns:
- The
TurnSpeedSupplier
which 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 autonomousRobotTurn
the turn is considered to be finished.- Overrides:
getMarginOfError
in classManner
- Returns:
- The angular margin of error, measured in degrees.
-
-