Lime Module
The LimeModule class represents a Limelight camera with NetworkTables integration.
Provides access to Limelight data including target detection, pose estimation, and camera configuration via NetworkTables. Implements the Camera interface for unified vision system integration.
Usage Example:
val limelight = LimeModule("limelight")
limelight.configure {
ledMode = LimeModule.LEDMode.OFF
camMode = LimeModule.CamMode.VISION
pipeline = 0
}
// Get latest measurement
val measurement = limelight.getLatestMeasurement()
measurement?.let { swerveDrive.addVisionMeasurement(it.pose, it.timestampSeconds, it.stdDevs) }Types
Camera operating modes for Limelight.
Configuration for the Limelight.
LED operating modes for Limelight.
Streaming modes for multiple Limelights.
Properties
Functions
Configures the Limelight using a DSL-style configuration block.
Gets all unprocessed vision measurements since the last call.
Gets the ID of the primary AprilTag in view.
Gets the robot's 2D pose in field space using MegaTag (botpose).
Gets the robot's 3D pose in field space using MegaTag (botpose).
Gets the robot's 2D pose in field space using MegaTag with blue alliance origin.
Gets the robot's 2D pose in field space using MegaTag with red alliance origin.
Gets the camera's 3D pose in robot space.
Gets the distance to a tag.
Gets the total latency in seconds (for use with pose estimators).
Gets the total latency (pipeline + capture) in milliseconds.
Gets the pipeline's latency contribution in milliseconds.
Gets the latest vision measurement from the camera.
Gets the horizontal offset to the currently tracked target.
Gets the target's 3D pose in camera space.
Gets the target's 3D pose in robot space.
Gets the vertical offset to the currently tracked target.
Sets the camera operating mode.
Sets the LED operating mode.
Sets the active vision pipeline.
Sets the streaming mode.
Takes a snapshot with the current settings.