Drive

public abstract 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.

Inheritors

Constructors

Link copied to clipboard
public Drive Drive()

Properties

Link copied to clipboard

Localizer used to determine the evolution of poseEstimate.

Link copied to clipboard

The robot's current pose estimate.

Link copied to clipboard
private final Pose2d poseVelocity

Current robot pose velocity (optional)

Functions

Link copied to clipboard
public abstract Localizer getLocalizer()

Localizer used to determine the evolution of poseEstimate.

Link copied to clipboard
public final Pose2d getPoseEstimate()
Link copied to clipboard
public final Pose2d getPoseVelocity()
Link copied to clipboard
public abstract Unit setDrivePower(Pose2d drivePower)

Sets the current commanded drive state of the robot. Feedforward is not applied to drivePower.

Link copied to clipboard
public abstract Unit setDriveSignal(DriveSignal driveSignal)

Sets the current commanded drive state of the robot. Feedforward is applied to driveSignal before it reaches the motors.

Link copied to clipboard
public abstract Unit setLocalizer(Localizer localizer)

Localizer used to determine the evolution of poseEstimate.

Link copied to clipboard
public final Unit setPoseEstimate(Pose2d poseEstimate)
Link copied to clipboard
public final Unit setWeightedDrivePower(Pose2d drivePower)
public final Unit setWeightedDrivePower(Pose2d drivePower, Double xWeight)
public final Unit setWeightedDrivePower(Pose2d drivePower, Double xWeight, Double yWeight)
public final Unit setWeightedDrivePower(Pose2d drivePower, Double xWeight, Double yWeight, Double headingWeight)

Scales drivePower so that the commanded powers are all within [-1.0, 1.0].

Link copied to clipboard
public final Unit updatePoseEstimate()

Updates poseEstimate with the most recent positional change.