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.
poseEstimatepublic void setLocalizer(@NotNull
Localizer p)
Localizer used to determine the evolution of poseEstimate.
poseEstimateprotected double getRawExternalHeading()
The raw heading used for computing externalHeading. Not affected by externalHeading setter.
externalHeading,
externalHeadingpublic 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.
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.
drivePower@Nullable public java.lang.Double getExternalHeadingVelocity()
The heading velocity used to determine pose velocity in some cases