public class MecanumDrive
extends Drive
This class provides the basic functionality of a mecanum drive using class MecanumKinematics
.
class MecanumKinematics
Modifier and Type | Class and Description |
---|---|
static class |
MecanumDrive.MecanumLocalizer
Default localizer for mecanum drives based on the drive encoders and (optionally) a heading sensor.
|
Constructor and Description |
---|
MecanumDrive(double trackWidth,
double wheelBase)
This class provides the basic functionality of a mecanum drive using
class MecanumKinematics . |
MecanumDrive(double trackWidth)
This class provides the basic functionality of a mecanum drive using
class MecanumKinematics . |
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
|
double |
getWheelBase()
distance between pairs of wheels on the same side 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
MecanumDrive.setMotorPowers . |
void |
setLocalizer(Localizer p)
Localizer used to determine the evolution of
Drive.getPoseEstimate . |
void |
setMotorPowers(double frontLeft,
double rearLeft,
double rearRight,
double frontRight)
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 MecanumDrive(double trackWidth, double wheelBase)
This class provides the basic functionality of a mecanum drive using class MecanumKinematics
.
trackWidth
- lateral distance between pairs of wheels on different sides of the robotwheelBase
- distance between pairs of wheels on the same side of the robottrackWidth
- lateral distance between pairs of wheels on different sides of the robotwheelBase
- distance between pairs of wheels on the same side of the robotclass MecanumKinematics
public MecanumDrive(double trackWidth)
This class provides the basic functionality of a mecanum drive using class MecanumKinematics
.
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 MecanumKinematics
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 frontLeft, double rearLeft, double rearRight, double frontRight)
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
MecanumDrive.setMotorPowers
.
MecanumDrive.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
public double getWheelBase()
distance between pairs of wheels on the same side of the robot