public class TankDrive
extends Drive
This class provides the basic functionality of a tank/differential drive using class TankKinematics
.
class TankKinematics
Modifier and Type | Class and Description |
---|---|
static class |
TankDrive.TankLocalizer
Default localizer for tank drives based on the drive encoders and (optionally) a heading sensor.
|
Constructor and Description |
---|
TankDrive(double trackWidth)
This class provides the basic functionality of a tank/differential drive using
class TankKinematics . |
Modifier and Type | Method and Description |
---|---|
double |
getExternalHeading()
Returns the robot's heading in radians as measured by an external sensor (e.g., IMU, gyroscope). Heading is
measured counter-clockwise from the x-axis.
|
Localizer |
getLocalizer()
Localizer used to determine the evolution of
Drive.getPoseEstimate . |
double |
getTrackWidth()
lateral distance between pairs of wheels on different sides of the robot
|
java.util.List<java.lang.Double> |
getWheelPositions()
Returns the positions of the wheels in linear distance units. Positions should exactly match the ordering in
TankDrive.setMotorPowers . |
void |
setLocalizer(Localizer p)
Localizer used to determine the evolution of
Drive.getPoseEstimate . |
void |
setMotorPowers(double left,
double right)
Sets the following motor powers (normalized voltages). All arguments are on the interval
[-1.0, 1.0] . |
void |
setVelocity(Pose2d poseVelocity)
Sets the poseVelocity of the robot.
|
getLocalizer, getPoseEstimate, setLocalizer, setPoseEstimate, setVelocity, updatePoseEstimate
public TankDrive(double trackWidth)
This class provides the basic functionality of a tank/differential drive using class TankKinematics
.
trackWidth
- lateral distance between pairs of wheels on different sides of the robottrackWidth
- lateral distance between pairs of wheels on different sides of the robotclass TankKinematics
public Localizer getLocalizer()
Localizer used to determine the evolution of Drive.getPoseEstimate
.
Drive.getPoseEstimate
public void setLocalizer(Localizer p)
Localizer used to determine the evolution of Drive.getPoseEstimate
.
Drive.getPoseEstimate
public void setVelocity(Pose2d poseVelocity)
Sets the poseVelocity of the robot.
public void setMotorPowers(double left, double right)
Sets the following motor powers (normalized voltages). All arguments are on the interval [-1.0, 1.0]
.
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
TankDrive.setMotorPowers
.
TankDrive.setMotorPowers
public double getExternalHeading()
Returns the robot's heading in radians as measured by an external sensor (e.g., IMU, gyroscope). Heading is measured counter-clockwise from the x-axis.
public double getTrackWidth()
lateral distance between pairs of wheels on different sides of the robot