class TankPIDVAFollower : TrajectoryFollower
Traditional PID controller with feedforward velocity and acceleration components to follow a trajectory. More specifically, one feedback loop controls the path displacement (that is, x in the robot reference frame), and another feedback loop to minimize cross track (lateral) error via heading correction (overall, very similar to MecanumPIDVAFollower except adjusted for the nonholonomic constraint). Feedforward is applied at the wheel level.
displacementCoeffs
- PID coefficients for the robot axial (x) controller
crossTrackCoeffs
- PID coefficients for the robot heading controller based on cross track error
kV
- feedforward velocity gain
kA
- feedforward acceleration gain
kStatic
- signed, additive feedforward constant (used to overcome static friction)
TankPIDVAFollower(drive: TankDrive, displacementCoeffs: PIDCoefficients, crossTrackCoeffs: 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, one feedback loop controls the path displacement (that is, x in the robot reference frame), and another feedback loop to minimize cross track (lateral) error via heading correction (overall, very similar to MecanumPIDVAFollower except adjusted for the nonholonomic constraint). Feedforward is applied at the wheel level. |
var lastError: Pose2d
Robot pose error computed in the last update call. |
val clock: NanoClock
clock |
|
var trajectory: Trajectory |
fun update(currentPose: Pose2d): Unit
Run a single iteration of the trajectory follower. |
fun elapsedTime(): Double
Returns the elapsed time since the last followTrajectory calls. |
|
fun followTrajectory(trajectory: Trajectory): Unit
Follow the given trajectory. |
|
fun isFollowing(): Boolean
Returns true if the current trajectory has finished executing. |