core / com.acmerobotics.roadrunner.drive / SwerveDrive / SwerveLocalizer

SwerveLocalizer

class SwerveLocalizer : Localizer

Default localizer for swerve drives based on the drive encoder positions, module orientations, and (optionally) a heading sensor.

Parameters

drive - drive

useExternalHeading - use external heading provided by an external sensor (e.g., IMU, gyroscope)

Constructors

<init>

SwerveLocalizer(drive: SwerveDrive, useExternalHeading: Boolean = true)

Default localizer for swerve drives based on the drive encoder positions, module orientations, and (optionally) a heading sensor.

Properties

poseEstimate

var poseEstimate: Pose2d

Current robot pose estimate.

Functions

update

fun update(): Unit

Completes a single localization update.