DriveConstants

open class DriveConstants

RoadRunner constants that define robot intrinsics for use with any RoadRunner drive. These constants are constructed per robot with a builder pattern.

Since

1.0.0-pre

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
open class Builder
Builder class to assist in making DriveConstants.

Properties

Link copied to clipboard
open var admissibleError: Pair<Pose2d, Double>
The admissible error and timeout for the attached PIDVA trajectory follower.
Link copied to clipboard
open var GEAR_RATIO: Double
The gear ratio of the motor.
Link copied to clipboard
open var kA: Double
Feedforward kA gain for the velocity PID.
Link copied to clipboard
open var kStatic: Double
Feedforward kStatic gain for the velocity PID.
Link copied to clipboard
open var kV: Double
Feedforward kV gain for the velocity PID.
Link copied to clipboard
open var MAX_ACCEL: Double
The maximum acceleration of the robot in inches per second squared.
Link copied to clipboard
The maximum angular acceleration of the robot in radians per second squared.
Link copied to clipboard
The maximum angular velocity of the robot in radians per second.
Link copied to clipboard
open var MAX_RPM: Double
The maximum RPM of the motor.
Link copied to clipboard
open var MAX_VEL: Double
The maximum velocity of the robot in inches per second.
Link copied to clipboard
open var MOTOR_VELO_PID: PIDFCoefficients
The PIDF coefficients for the motor velocity PID.
Link copied to clipboard
Set RUN_USING_ENCODER to true to enable built-in hub velocity control using drive encoders.
Link copied to clipboard
The number of ticks per revolution of the motor's output shaft.
Link copied to clipboard
The track width is the distance between the left and right wheels on the robot (inches).
Link copied to clipboard
The radius of the wheel in inches.

Functions

Link copied to clipboard
Convert encoder ticks to wheel distance in inches.
Link copied to clipboard
open fun getMotorVelocityF(ticksPerSecond: Double): Double
Get the motor velocity feedforward gain.
Link copied to clipboard
open fun rpmToVelocity(rpm: Double): Double
Convert motor RPM to wheel velocity in inches per second.