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

SwerveLocalizer

class SwerveLocalizer : Localizer (source)

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>

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

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

Properties

poseEstimate

Current robot pose estimate.

var poseEstimate: Pose2d

poseVelocity

Current robot pose velocity (optional)

var poseVelocity: Pose2d?

Functions

update

Completes a single localization update.

fun update(): Unit