TurnTask

constructor(drive: Moveable, 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(powerIn: Consumer<Pose2d>, poseEstimate: Supplier<Pose2d>, 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(drive: RoadRunnerDrive, angle: Measure<Angle>)

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

Parameters

drive

the RoadRunner drive instance to use, this subsystem will be automatically attached to the task if it is a BunyipsSubsystem, note RoadRunner methods are not used in this task and are only for localisation purposes

angle

the angle to turn to in a global coordinate frame


constructor(powerIn: Consumer<Pose2d>, poseEstimate: Supplier<Pose2d>, 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