NextLimelight

class NextLimelight(initializer: () -> Limelight3A)

A NextFTC wrapper around the Limelight3A vision sensor that resolves the device lazily from the hardware map, so you never have to fetch it yourself.

Wraps the common lifecycle methods directly; anything else on the underlying sensor is reachable through camera.

Author

28shettr

Parameters

initializer

supplies the underlying Limelight3A when first accessed.

Constructors

Link copied to clipboard
constructor(initializer: () -> Limelight3A)
constructor(name: String)

Properties

Link copied to clipboard

The underlying Limelight3A, for anything not wrapped.

Link copied to clipboard

True if the sensor has reported data within the last ~250ms.

Link copied to clipboard

True while the polling loop is active.

Link copied to clipboard

The most recent result from the polling loop.

Link copied to clipboard
val tX: Double

The horizontal offset angle, in degrees, from the camera's crosshair to the target.

Link copied to clipboard
val tY: Double

The vertical offset angle, in degrees, from the camera's crosshair to the target.

Functions

Link copied to clipboard
fun getDistance(unit: DistanceUnit = Inches, id: Int? = null): Distance?

Returns the straight-line distance (hypotenuse) from the robot to the AprilTag matching id (or any visible tag if id is null) in the given unit.

Link copied to clipboard

Returns the robot's field position from the latest Limelight result in Pedro coordinates, or null if no valid pose is available.

Link copied to clipboard
fun getPose(): Pose2d?

Returns the robot's field position from the latest Limelight result in FTC coordinates, or null if no valid pose is available.

Link copied to clipboard
fun setPipeline(pipeline: Int): Boolean

Switches to the pipeline at the given index.

Link copied to clipboard
fun setPollRate(hz: Int)

Sets the poll rate in Hz; must be called before start.

Link copied to clipboard
fun start()

Starts the polling loop.

Link copied to clipboard
fun startReading(pipeline: Int, hz: Int = 100)

Sets the poll rate and pipeline, then starts polling in one call.

Link copied to clipboard
fun stop()

Stops the polling loop.