abstract class SwerveDrive : Drive
This class provides basic functionality of a swerve drive using on SwerveKinematics.
trackWidth
- lateral distance between pairs of wheels on different sides of the robot
wheelBase
- distance between pairs of wheels on the same side of the robot
class SwerveLocalizer : Localizer
Default localizer for swerve drivetrains based on the drive encoder positions and module orientations. |
SwerveDrive(trackWidth: Double, wheelBase: Double = trackWidth, clock: NanoClock = NanoClock.system())
This class provides basic functionality of a swerve drive using on SwerveKinematics. |
open var localizer: Localizer |
|
val trackWidth: Double
lateral distance between pairs of wheels on different sides of the robot |
|
val wheelBase: Double
distance between pairs of wheels on the same side of the robot |
var poseEstimate: Pose2d
The robot's current pose estimate. |
abstract fun getModuleOrientations(): List<Double>
Returns the current module orientations in radians. |
|
abstract fun getWheelPositions(): List<Double>
Returns the positions of the wheels in linear distance units. |
|
abstract fun setModuleOrientations(frontLeft: Double, rearLeft: Double, rearRight: Double, frontRight: Double): Unit
Sets the module orientations. All values are in radians. |
|
abstract fun setMotorPowers(frontLeft: Double, rearLeft: Double, rearRight: Double, frontRight: Double): Unit
Sets the following motor powers (normalized voltages). All arguments are on the interval |
|
open fun setVelocity(poseVelocity: Pose2d): Unit
Sets the poseVelocity of the robot. |
fun updatePoseEstimate(): Unit
Updates poseEstimate with the most recent positional change. |