core / com.acmerobotics.roadrunner.drive / TankDrive

TankDrive

abstract class TankDrive : Drive

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

Parameters

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

Types

TankLocalizer

class TankLocalizer : Localizer

Default localizer for tank drivetrains based on the drive encoders.

Constructors

<init>

TankDrive(trackWidth: Double, clock: NanoClock = NanoClock.system())

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

Properties

localizer

open var localizer: Localizer

trackWidth

val trackWidth: Double

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

Inherited Properties

poseEstimate

var poseEstimate: Pose2d

The robot's current pose estimate.

Functions

getWheelPositions

abstract fun getWheelPositions(): List<Double>

Returns the positions of the wheels in linear distance units.

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].

setVelocity

open fun setVelocity(poseVelocity: Pose2d): Unit

Sets the poseVelocity of the robot.

Inherited Functions

updatePoseEstimate

fun updatePoseEstimate(): Unit

Updates poseEstimate with the most recent positional change.