core / com.acmerobotics.roadrunner.followers / HolonomicPIDVAFollower

HolonomicPIDVAFollower

abstract class HolonomicPIDVAFollower : TrajectoryFollower

Traditional PID controller with feedforward velocity and acceleration components to follow a trajectory. More specifically, the feedback is applied to the components of the robot's pose (x position, y position, and heading) to determine the velocity correction. The feedforward components are instead applied at the wheel level.

Parameters

drive - mecanum drive instance

translationalCoeffs - PID coefficients for the robot axial and lateral (x and y, respectively) controllers

headingCoeffs - PID coefficients for the robot heading controller

kV - feedforward velocity gain

kA - feedforward acceleration gain

kStatic - signed, additive feedforward constant (used to overcome static friction)

clock - clock

Constructors

<init>

HolonomicPIDVAFollower(drive: Drive, translationalCoeffs: PIDCoefficients, headingCoeffs: PIDCoefficients, kV: Double, kA: Double, kStatic: Double, clock: NanoClock = NanoClock.system())

Traditional PID controller with feedforward velocity and acceleration components to follow a trajectory. More specifically, the feedback is applied to the components of the robot's pose (x position, y position, and heading) to determine the velocity correction. The feedforward components are instead applied at the wheel level.

Properties

lastError

open var lastError: Pose2d

Robot pose error computed in the last update call.

Inherited Properties

clock

val clock: NanoClock

clock

trajectory

var trajectory: Trajectory

Functions

update

open fun update(currentPose: Pose2d): Unit

Run a single iteration of the trajectory follower.

updateDrive

abstract fun updateDrive(poseVelocity: Pose2d, poseAcceleration: Pose2d): Unit

Inherited Functions

elapsedTime

fun elapsedTime(): Double

Returns the elapsed time since the last followTrajectory calls.

followTrajectory

fun followTrajectory(trajectory: Trajectory): Unit

Follow the given trajectory.

isFollowing

fun isFollowing(): Boolean

Returns true if the current trajectory has finished executing.

Inheritors

MecanumPIDVAFollower

class MecanumPIDVAFollower : HolonomicPIDVAFollower

Traditional PID controller with feedforward velocity and acceleration components to follow a trajectory. More specifically, the feedback is applied to the components of the robot's pose (x position, y position, and heading) to determine the velocity correction. The feedforward components are instead applied at the wheel level.

SwervePIDVAFollower

class SwervePIDVAFollower : HolonomicPIDVAFollower

Traditional PID controller with feedforward velocity and acceleration components to follow a trajectory. More specifically, the feedback is applied to the components of the robot's pose (x position, y position, and heading) to determine the velocity correction. The feedforward components are instead applied at the wheel level.