public class Drive
Abstraction for generic robot drive motion and localization. Robot poses are specified in a coordinate system with positive x pointing forward, positive y pointing left, and positive heading measured counter-clockwise from the x-axis.
Constructor and Description |
---|
Drive()
Abstraction for generic robot drive motion and localization. Robot poses are specified in a coordinate system with
positive x pointing forward, positive y pointing left, and positive heading measured counter-clockwise from the
x-axis.
|
Modifier and Type | Method and Description |
---|---|
double |
getExternalHeading()
The robot's heading in radians as measured by an external sensor (e.g., IMU, gyroscope).
|
Localizer |
getLocalizer()
Localizer used to determine the evolution of
poseEstimate . |
Pose2d |
getPoseEstimate()
The robot's current pose estimate.
|
protected double |
getRawExternalHeading()
The raw heading used for computing
externalHeading . Not affected by externalHeading setter. |
void |
setDrivePower(Pose2d drivePower)
Sets the current commanded drive state of the robot. Feedforward is not applied to
drivePower . |
void |
setDriveSignal(DriveSignal driveSignal)
Sets the current commanded drive state of the robot. Feedforward is applied to
driveSignal before it reaches
the motors. |
void |
setExternalHeading(double value)
The robot's heading in radians as measured by an external sensor (e.g., IMU, gyroscope).
|
void |
setLocalizer(Localizer p)
Localizer used to determine the evolution of
poseEstimate . |
void |
setPoseEstimate(Pose2d value)
The robot's current pose estimate.
|
void |
updatePoseEstimate()
Updates
poseEstimate with the most recent positional change. |
public Drive()
Abstraction for generic robot drive motion and localization. Robot poses are specified in a coordinate system with positive x pointing forward, positive y pointing left, and positive heading measured counter-clockwise from the x-axis.
@NotNull public Localizer getLocalizer()
Localizer used to determine the evolution of poseEstimate
.
poseEstimate
public void setLocalizer(@NotNull Localizer p)
Localizer used to determine the evolution of poseEstimate
.
poseEstimate
protected double getRawExternalHeading()
The raw heading used for computing externalHeading
. Not affected by externalHeading
setter.
externalHeading
,
externalHeading
public double getExternalHeading()
The robot's heading in radians as measured by an external sensor (e.g., IMU, gyroscope).
public void setExternalHeading(double value)
The robot's heading in radians as measured by an external sensor (e.g., IMU, gyroscope).
@NotNull public Pose2d getPoseEstimate()
The robot's current pose estimate.
public void setPoseEstimate(@NotNull Pose2d value)
The robot's current pose estimate.
public void updatePoseEstimate()
Updates poseEstimate
with the most recent positional change.
poseEstimate
public void setDriveSignal(@NotNull DriveSignal driveSignal)
Sets the current commanded drive state of the robot. Feedforward is applied to driveSignal
before it reaches
the motors.
driveSignal
public void setDrivePower(@NotNull Pose2d drivePower)
Sets the current commanded drive state of the robot. Feedforward is not applied to drivePower
.
drivePower