TwoWheelMecanumRoadRunnerDrivetrain

class TwoWheelMecanumRoadRunnerDrivetrain(hardwareMap: HardwareMap, pose: Pose2d = Pose2d(Vector2d(0.0, 0.0), 0.0), params: MecanumRoadRunnerDrivetrain.DriveParams = DriveParams(), localizerParams: TwoDeadWheelLocalizer.LocalizerParams = TwoDeadWheelLocalizer.LocalizerParams()) : MecanumRoadRunnerDrivetrain

A MecanumRoadRunnerDrivetrain with a TwoDeadWheelLocalizer.

Parameters

hardwareMap

the hardware map

pose

the robot's initial pose

params

the drive parameters

localizerParams

the localizer parameters

Constructors

Link copied to clipboard
constructor(hardwareMap: HardwareMap, pose: Pose2d = Pose2d(Vector2d(0.0, 0.0), 0.0), params: MecanumRoadRunnerDrivetrain.DriveParams = DriveParams(), localizerParams: TwoDeadWheelLocalizer.LocalizerParams = TwoDeadWheelLocalizer.LocalizerParams())

Properties

Link copied to clipboard
val lazyImu: LazyHardwareMapImu

the lazy IMU

Link copied to clipboard
val leftBack: DcMotorEx

the left back motor

Link copied to clipboard
val leftFront: DcMotorEx

the left front motor

Link copied to clipboard
open override val localizer: TwoDeadWheelLocalizer

the localizer

Link copied to clipboard
Link copied to clipboard
val rightBack: DcMotorEx

the right back motor

Link copied to clipboard
val rightFront: DcMotorEx

the right front motor

Link copied to clipboard
val state: StateFlow<AttachmentState>
Link copied to clipboard
val voltageSensor: VoltageSensor

the voltage sensor

Functions

Link copied to clipboard
open override fun driveActionBuilder(beginPose: Pose2d): TrajectoryActionBuilder

Create a new trajectory action builder.

Link copied to clipboard

Checks if the attachment is currently busy (Running).

Link copied to clipboard

Checks if the attachment is currently in a faulted state.

Link copied to clipboard

Ensures the attachment is in the Idle state, throwing an exception if not.

Link copied to clipboard
open override fun setDrivePowers(powers: PoseVelocity2d)

Set the drive powers.

Link copied to clipboard
fun splineTo(from: Pose2d, to: Vector2d, tangent: Rotation2d): Action

Spline from from to to with tangent.

Link copied to clipboard
fun splineToLinearHeading(from: Pose2d, to: Pose2d, tangent: Rotation2d): Action

Spline from from to to with tangent.

Link copied to clipboard
open fun stop()

Stops the attachment and resets its state to Idle.

Link copied to clipboard
fun strafeTo(from: Pose2d, to: Vector2d): Action

Strafe from from to to.

Link copied to clipboard
fun strafeToLinearHeading(from: Pose2d, to: Pose2d): Action

Strafe from from to to.

Link copied to clipboard
fun trajectory(from: Pose2d = localizer.pose, block: TrajectoryActionBuilder.() -> TrajectoryActionBuilder): Action

Build a trajectory action.

Link copied to clipboard
fun turn(from: Pose2d, degrees: Degrees): Action

Turn a certain number of degrees.

fun turn(from: Pose2d, radians: Radians): Action

Turn a certain number of radians.

Link copied to clipboard
fun turnTo(from: Pose2d, to: Degrees): Action
fun turnTo(from: Pose2d, to: Radians): Action

Turn from from to to.

Link copied to clipboard
context(telemetry: Telemetry)
open override fun update()

Updates the telemetry with the current state of the attachment.