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.
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.
@Nullable public Pose2d getPoseVelocity()
Current robot pose velocity (optional)
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
@Nullable public java.lang.Double getExternalHeadingVelocity()
The heading velocity used to determine pose velocity in some cases