OTOSLocalizer

class OTOSLocalizer @JvmOverloads constructor(val hardwareMap: HardwareMap, val otosName: String = "sensor_otos", var linearScalar: Double = 1.0, var angularScalar: Double = 1.0, var offset: Pose2d = Pose2d.zero, val initialPose: Pose2d = Pose2d.zero) : Localizer

Localizer based on the SparkFun OTOS sensor.

Parameters

hardwareMap

hardware map

otosName

name of the OTOS sensor in the hardware map

linearScalar

scalar for the linear measurements

angularScalar

scalar for the angular measurements

offset

sensor offset

initialPose

initial pose

Constructors

Link copied to clipboard
constructor(hardwareMap: HardwareMap, otosName: String = "sensor_otos", linearScalar: Double = 1.0, angularScalar: Double = 1.0, offset: Pose2d = Pose2d.zero, initialPose: Pose2d = Pose2d.zero)

Properties

Link copied to clipboard
Link copied to clipboard
val hardwareMap: HardwareMap
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val otos: SparkFunOTOS
Link copied to clipboard
Link copied to clipboard
open override var pose: Pose2d

The current robot pose.

Link copied to clipboard
open override val poseHistory: MutableList<Pose2d>

A list of recent poses.

Link copied to clipboard
open override var vel: PoseVelocity2d

The current robot velocity.

Functions

Link copied to clipboard
open override fun update(): PoseVelocity2d

Updates the localizer and returns the new velocity.

Link copied to clipboard

Returns a new localizer with the given initial pose.

Link copied to clipboard
fun withName(otosName: String): OTOSLocalizer

Returns a new localizer with the given sensor name.

Link copied to clipboard

Returns a new localizer with the given offset.

Link copied to clipboard
fun withScalars(linearScalar: Double, angularScalar: Double): OTOSLocalizer

Returns a new localizer with the given scalars.