TurnTask

constructor(@NonNull drive: Moveable, @NonNull angle: Measure<Angle>, delta: Boolean)

Construct a new TurnTask that will turn the robot to the given angle.

Parameters

drive

the drive instance to use, this subsystem will be automatically attached to the task if it is a BunyipsSubsystem

angle

the angle to turn to, if this is a delta angle this will be counter-clockwise

delta

if this angle is a delta from the current drive rotation at runtime


constructor(@NonNull powerIn: Consumer<PoseVelocity2d>, @NonNull poseEstimate: Supplier<Pose2d>, @NonNull angle: Measure<Angle>, delta: Boolean)

Construct a new TurnTask that will turn the robot to the given angle.

Parameters

powerIn

the consumer to set the power of the robot, can ignore the x and y values if not needed

poseEstimate

the supplier to get the current pose of the robot, can ignore the x and y values if not needed

angle

the angle to turn to, if this is a delta angle this will be counter-clockwise

delta

if this angle is a delta from the current drive rotation at runtime


constructor(@NonNull drive: Moveable, @NonNull angle: Measure<Angle>)

Construct a new TurnTask that will turn the robot to the given global angle.

Parameters

drive

the drive instance to use, this subsystem will be automatically attached to the task if it is a BunyipsSubsystem

angle

the angle to turn to in a global coordinate frame


constructor(@NonNull powerIn: Consumer<PoseVelocity2d>, @NonNull poseEstimate: Supplier<Pose2d>, @NonNull angle: Measure<Angle>)

Construct a new TurnTask that will turn the robot to the given global angle.

Parameters

powerIn

the consumer to set the power of the robot, can ignore the x and y values if not needed

poseEstimate

the supplier to get the current pose of the robot, can ignore the x and y values if not needed

angle

the angle to turn to in a global coordinate frame