core / com.acmerobotics.roadrunner.drive / TankDrive

TankDrive

abstract class TankDrive : Drive

This class provides the basic functionality of a tank/differential drive using TankKinematics.

Parameters

kV - velocity feedforward

kA - acceleration feedforward

kStatic - additive constant feedforward

trackWidth - lateral distance between pairs of wheels on different sides of the robot

Types

TankLocalizer

class TankLocalizer : Localizer

Default localizer for tank drives based on the drive encoders and (optionally) a heading sensor.

Constructors

<init>

TankDrive(kV: Double, kA: Double, kStatic: Double, trackWidth: Double)

This class provides the basic functionality of a tank/differential drive using TankKinematics.

Properties

localizer

open var localizer: Localizer

Localizer used to determine the evolution of poseEstimate.

Inherited Properties

externalHeading

var externalHeading: Double

The robot's heading in radians as measured by an external sensor (e.g., IMU, gyroscope).

poseEstimate

var poseEstimate: Pose2d

The robot's current pose estimate.

rawExternalHeading

abstract val rawExternalHeading: Double

The raw heading used for computing externalHeading. Not affected by externalHeading setter.

Functions

getWheelPositions

abstract fun getWheelPositions(): List<Double>

Returns the positions of the wheels in linear distance units. Positions should exactly match the ordering in setMotorPowers.

setDrivePower

open fun setDrivePower(drivePower: Pose2d): Unit

Sets the current commanded drive state of the robot. Feedforward is not applied to drivePower.

setDriveSignal

open fun setDriveSignal(driveSignal: DriveSignal): Unit

Sets the current commanded drive state of the robot. Feedforward is applied to driveSignal before it reaches the motors.

setMotorPowers

abstract fun setMotorPowers(left: Double, right: Double): Unit

Sets the following motor powers (normalized voltages). All arguments are on the interval [-1.0, 1.0].

Inherited Functions

updatePoseEstimate

fun updatePoseEstimate(): Unit

Updates poseEstimate with the most recent positional change.