OTOSSwervePedroPathingDrivetrain

class OTOSSwervePedroPathingDrivetrain(hardwareMap: HardwareMap, followerConstants: FollowerConstants = FollowerConstants(), localizerConstants: OTOSConstants = OTOSConstants(), pathConstraints: PathConstraints = PathConstraints(0.99, 100.0, 1.0, 1.0), driveConstants: SwerveConstants = SwerveConstants(), pods: CoaxialPod, initialPose: Pose = Pose()) : PedroPathingDrivetrain

A swerve PedroPathingDrivetrain with an OTOS localizer.

Parameters

hardwareMap

The FTC hardware map

followerConstants

constants for the path follower

localizerConstants

constants for the OTOS localizer

pathConstraints

constraints for path following

driveConstants

constants specific to the swerve drivetrain

initialPose

the robot's initial pose

Constructors

Link copied to clipboard
constructor(hardwareMap: HardwareMap, followerConstants: FollowerConstants = FollowerConstants(), localizerConstants: OTOSConstants = OTOSConstants(), pathConstraints: PathConstraints = PathConstraints(0.99, 100.0, 1.0, 1.0), driveConstants: SwerveConstants = SwerveConstants(), vararg pods: CoaxialPod, initialPose: Pose = Pose())

Properties

Link copied to clipboard
Link copied to clipboard
val pose: Pose

the robot's current pose

Link copied to clipboard
val state: StateFlow<AttachmentState>

Functions

Link copied to clipboard
fun followPath(block: PathBuilder.() -> Unit): Action

Creates a path following action from a PathBuilder.

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
fun lineTo(line: BezierLine): Action

Follows the given line.

Link copied to clipboard
fun lineToConstantHeading(line: BezierLine, heading: Degrees): Action
fun lineToConstantHeading(line: BezierLine, heading: Radians): Action

Follow the given line with a constant heading.

Link copied to clipboard
fun lineToLinearHeading(line: BezierLine, initial: Degrees, final: Degrees): Action
fun lineToLinearHeading(line: BezierLine, initial: Radians, final: Radians): Action

Follows the given line while linearly interpolating the heading from initial to final.

Link copied to clipboard
fun lineToTangentHeading(line: BezierLine): Action

Follow the given line while tangentially interpolating the heading.

Link copied to clipboard
fun path(startPose: Pose = pose, block: PedroPathingActionBuilder.() -> PedroPathingActionBuilder): Action

Creates a path following action starting from startPose.

Link copied to clipboard
fun pathTo(pathChain: PathChain): Action

Follows the given path using PedroPathing.

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(curve: BezierCurve): Action

Follows the given curve.

Link copied to clipboard
fun splineToConstantHeading(curve: BezierCurve, heading: Degrees): Action
fun splineToConstantHeading(curve: BezierCurve, heading: Radians): Action

Follow the given curve with a constant heading.

Link copied to clipboard
fun splineToLinearHeading(curve: BezierCurve, initial: Degrees, final: Degrees): Action
fun splineToLinearHeading(curve: BezierCurve, initial: Radians, final: Radians): Action

Follow the given curve while linearly interpolating the heading from initial to final.

Link copied to clipboard
fun splineToTangentHeading(curve: BezierCurve): Action

Follow the given curve while tangentially interpolating the heading.

Link copied to clipboard
Link copied to clipboard
open fun stop()

Stops the attachment and resets its state to Idle.

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

Updates the telemetry with the current state of the attachment.