Class TurnManner


  • public class TurnManner
    extends Manner
    TurnManner describes the way in which the robot performs an autonomous RobotTurn.
    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.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static TurnManner NONE
      A TurnManner where the robot will not attempt to move and the path will immediately be completed.
    • Field Detail

      • NONE

        public static final TurnManner NONE
        A TurnManner 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 a TurnManner instance, describing the manner in which the robot should complete a given autonomous RobotTurn.
        Parameters:
        marginOfError - A double describing how far the robot can be from its endpoint in order for the turn to be considered finished, in degrees.
        speedSupplier - A TurnManner.TurnSpeedSupplier which provides the speed the robot should turn at given the remaining angle measure.
    • Method Detail

      • 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 autonomous RobotTurn the turn is considered to be finished.
        Overrides:
        getMarginOfError in class Manner
        Returns:
        The angular margin of error, measured in degrees.