public class TankDrive
extends Drive
This class provides the basic functionality of a tank/differential drive using class TankKinematics.
class TankKinematicspublic TankDrive(double kV,
double kA,
double kStatic,
double trackWidth)
This class provides the basic functionality of a tank/differential drive using class TankKinematics.
kV - velocity feedforwardkA - acceleration feedforwardkStatic - additive constant feedforwardtrackWidth - lateral distance between pairs of wheels on different sides of the robotclass TankKinematics@NotNull public Localizer getLocalizer()
Localizer used to determine the evolution of poseEstimate.
poseEstimatepublic void setLocalizer(@NotNull
Localizer p)
Localizer used to determine the evolution of poseEstimate.
poseEstimatepublic void setDriveSignal(@NotNull
DriveSignal driveSignal)
Sets the current commanded drive state of the robot. Feedforward is applied to driveSignal before it reaches
the motors.
driveSignalpublic void setDrivePower(@NotNull
Pose2d drivePower)
Sets the current commanded drive state of the robot. Feedforward is not applied to drivePower.
drivePowerpublic void setMotorPowers(double left,
double right)
Sets the following motor powers (normalized voltages). All arguments are on the interval [-1.0, 1.0].
@NotNull public java.util.List<java.lang.Double> getWheelPositions()
Returns the positions of the wheels in linear distance units. Positions should exactly match the ordering in
setMotorPowers.
setMotorPowers@Nullable public java.util.List<java.lang.Double> getWheelVelocities()
Returns the velocities of the wheels in linear distance units. Positions should exactly match the ordering in
setMotorPowers.
setMotorPowers