RoadRunnerDrivetrain

abstract class RoadRunnerDrivetrain<T : Any>(hardwareMap: HardwareMap, orientation: RevHubOrientationOnRobot) : Drivetrain

A RoadRunner dev.kingssack.volt.attachment.drivetrain.Drivetrain.

Parameters

hardwareMap

the hardware map

orientation

the control hub's orientation

T

the type of kinematics to use

Inheritors

Constructors

Link copied to clipboard
constructor(hardwareMap: HardwareMap, orientation: RevHubOrientationOnRobot)

Properties

Link copied to clipboard
val lazyImu: LazyHardwareMapImu

the lazy IMU

Link copied to clipboard

the localizer

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

the voltage sensor

Functions

Link copied to clipboard
abstract 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
abstract 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.