public static class SwerveDrive.SwerveLocalizer implements Localizer
Default localizer for swerve drives based on the drive encoder positions, module orientations, and (optionally) a heading sensor.
@JvmOverloads public SwerveLocalizer(@NotNull SwerveDrive drive, boolean useExternalHeading)
Default localizer for swerve drives based on the drive encoder positions, module orientations, and (optionally) a heading sensor.
drive
- driveuseExternalHeading
- use external heading provided by an external sensor (e.g., IMU, gyroscope)@JvmOverloads public SwerveLocalizer(@NotNull SwerveDrive drive)
Default localizer for swerve drives based on the drive encoder positions, module orientations, and (optionally) a heading sensor.
drive
- drive@NotNull public Pose2d getPoseEstimate()
Current robot pose estimate.
public void setPoseEstimate(@NotNull Pose2d value)
Current robot pose estimate.
@Nullable public Pose2d getPoseVelocity()
Current robot pose velocity (optional)
public void update()
Completes a single localization update.