Skip to main content

Pipeline control

setPipelineIndex

Switches the active pipeline to the specified index (0–9).
LimelightHelpers.setPipelineIndex("limelight", 2);
limelightName
string
required
Name of the Limelight NetworkTables table.
pipelineIndex
int
required
Pipeline index to activate. Valid range: 0–9.

setPriorityTagID

Sets the priority AprilTag ID. When a priority ID is set, the Limelight will prefer that tag when multiple are visible.
LimelightHelpers.setPriorityTagID("limelight", 7);
limelightName
string
required
Name of the Limelight NetworkTables table.
ID
int
required
The AprilTag ID to prioritize.

SetFiducialIDFiltersOverride

Overrides the set of AprilTag IDs used for robot localization. Tags whose IDs are not in this list will be ignored for pose estimation.
// Only use tags 1, 2, and 7 for localization
LimelightHelpers.SetFiducialIDFiltersOverride("limelight", new int[]{1, 2, 7});
limelightName
string
required
Name of the Limelight NetworkTables table.
validIDs
int[]
required
Array of AprilTag IDs to permit for localization.

SetFiducialDownscalingOverride

Overrides the downscaling factor applied to the image before AprilTag detection. Higher downscale improves detection speed but may reduce maximum detection range.
LimelightHelpers.SetFiducialDownscalingOverride("limelight", 2.0f);
limelightName
string
required
Name of the Limelight NetworkTables table.
downscale
float
required
Downscale factor. Valid values: 0 (use pipeline setting), 1.0, 1.5, 2.0, 3.0, 4.0.

SetThrottle

Sets the frame-processing throttle. The camera processes one frame after skipping the specified number. Set to a value between 100–200 while the robot is disabled to reduce thermal output.
// Process every frame (default)
LimelightHelpers.SetThrottle("limelight", 0);

// Reduce heat when disabled
LimelightHelpers.SetThrottle("limelight", 150);
limelightName
string
required
Name of the Limelight NetworkTables table.
throttle
int
required
Number of frames to skip between processed frames. 0 = no throttle (process every frame).

LED control

setLEDMode_PipelineControl

Sets LED behavior to be controlled by the active pipeline configuration (ledMode = 0).
LimelightHelpers.setLEDMode_PipelineControl("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.

setLEDMode_ForceOff

Forces the LEDs off regardless of the pipeline setting (ledMode = 1).
LimelightHelpers.setLEDMode_ForceOff("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.

Forces the LEDs to blink continuously (ledMode = 2).
LimelightHelpers.setLEDMode_ForceBlink("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.

setLEDMode_ForceOn

Forces the LEDs fully on regardless of the pipeline setting (ledMode = 3).
LimelightHelpers.setLEDMode_ForceOn("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.

Stream mode

setStreamMode_Standard

Enables the standard side-by-side stream (stream = 0). The primary and secondary camera views appear side by side.
LimelightHelpers.setStreamMode_Standard("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.

setStreamMode_PiPMain

Enables Picture-in-Picture mode with the secondary stream displayed in the corner of the primary stream (stream = 1).
LimelightHelpers.setStreamMode_PiPMain("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.

setStreamMode_PiPSecondary

Enables Picture-in-Picture mode with the primary stream displayed in the corner of the secondary stream (stream = 2).
LimelightHelpers.setStreamMode_PiPSecondary("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.

Camera geometry

setCameraPose_RobotSpace

Sets the camera’s mount position and orientation relative to the robot’s center. All translations are in meters; all angles are in degrees.
// Camera mounted 0.3 m forward, centered, 0.2 m up, tilted 30° down
LimelightHelpers.setCameraPose_RobotSpace("limelight",
    0.3,   // forward (m)
    0.0,   // side (m)
    0.2,   // up (m)
    0.0,   // roll (deg)
    -30.0, // pitch (deg)
    0.0    // yaw (deg)
);
limelightName
string
required
Name of the Limelight NetworkTables table.
forward
double
required
Forward offset from the robot center in meters.
side
double
required
Side (lateral) offset from the robot center in meters. Positive is to the left.
up
double
required
Vertical offset from the robot center in meters.
roll
double
required
Camera roll in degrees.
pitch
double
required
Camera pitch in degrees. Negative values tilt the camera downward.
yaw
double
required
Camera yaw in degrees relative to the robot’s forward direction.

setCropWindow

Sets the active crop window for the camera image. The crop window in the Limelight UI must be fully open (no UI crop applied) for this to take effect. Values are normalized: −1.0 is the left/bottom edge, 1.0 is the right/top edge.
// Crop to the center-left quarter of the image
LimelightHelpers.setCropWindow("limelight", -1.0, 0.0, -1.0, 1.0);
limelightName
string
required
Name of the Limelight NetworkTables table.
cropXMin
double
required
Left edge of the crop window. Range: −1.0 to 1.0.
cropXMax
double
required
Right edge of the crop window. Range: −1.0 to 1.0.
cropYMin
double
required
Bottom edge of the crop window. Range: −1.0 to 1.0.
cropYMax
double
required
Top edge of the crop window. Range: −1.0 to 1.0.

setKeystone

Applies horizontal and vertical keystone correction to the camera image.
LimelightHelpers.setKeystone("limelight", 0.1, -0.05);
limelightName
string
required
Name of the Limelight NetworkTables table.
horizontal
double
required
Horizontal keystone correction value. Range: −0.95 to 0.95.
vertical
double
required
Vertical keystone correction value. Range: −0.95 to 0.95.

setFiducial3DOffset

Sets a 3D offset point applied to the fiducial targeting solution, enabling easy targeting of a specific point relative to an AprilTag.
// Target a point 0.5 m above the AprilTag
LimelightHelpers.setFiducial3DOffset("limelight", 0.0, 0.0, 0.5);
limelightName
string
required
Name of the Limelight NetworkTables table.
offsetX
double
required
X offset in meters relative to the fiducial.
offsetY
double
required
Y offset in meters relative to the fiducial.
offsetZ
double
required
Z offset in meters relative to the fiducial.

MegaTag2 orientation

SetRobotOrientation

Sends the robot’s current orientation to the Limelight for use by the MegaTag2 localization algorithm. Only yaw is used by MegaTag2; set all rate and attitude parameters to 0. Internally calls Flush() to ensure the value reaches the camera before the next pose read.
// Called each loop iteration before getBotPoseEstimate_wpiBlue_MegaTag2
LimelightHelpers.SetRobotOrientation("limelight",
    gyro.getYaw(), // yaw (deg) — required
    0,             // yawRate — set 0
    0,             // pitch — set 0
    0,             // pitchRate — set 0
    0,             // roll — set 0
    0              // rollRate — set 0
);
limelightName
string
required
Name of the Limelight NetworkTables table.
yaw
double
required
Robot yaw in degrees. 0° = robot facing the Red Alliance wall in the standard FRC field orientation.
yawRate
double
required
Angular velocity of yaw in degrees per second. Set to 0 — not currently used by MegaTag2.
pitch
double
required
Robot pitch in degrees. Set to 0 — not currently used by MegaTag2.
pitchRate
double
required
Angular velocity of pitch in degrees per second. Set to 0.
roll
double
required
Robot roll in degrees. Set to 0 — not currently used by MegaTag2.
rollRate
double
required
Angular velocity of roll in degrees per second. Set to 0.

SetRobotOrientation_NoFlush

Identical to SetRobotOrientation but skips the internal Flush() call. Use this when you are batching multiple NT writes and want to flush manually, or when calling from a high-frequency loop where the extra flush overhead is undesirable.
LimelightHelpers.SetRobotOrientation_NoFlush("limelight",
    gyro.getYaw(), 0, 0, 0, 0, 0);
// ... other NT writes ...
LimelightHelpers.Flush();
limelightName
string
required
Name of the Limelight NetworkTables table.
yaw
double
required
Robot yaw in degrees.
yawRate
double
required
Angular velocity of yaw. Set to 0.
pitch
double
required
Robot pitch. Set to 0.
pitchRate
double
required
Angular velocity of pitch. Set to 0.
roll
double
required
Robot roll. Set to 0.
rollRate
double
required
Angular velocity of roll. Set to 0.

SetIMUMode

Configures the IMU mode used by the MegaTag2 localization algorithm.
LimelightHelpers.SetIMUMode("limelight", 1);
limelightName
string
required
Name of the Limelight NetworkTables table.
mode
int
required
IMU mode integer. Mode 0 = external IMU only (use SetRobotOrientation to provide heading). Higher modes enable Limelight’s internal IMU. See the MegaTag2 guide for usage guidance.

SetIMUAssistAlpha

Sets the complementary filter alpha for IMU Assist Modes 3 and 4. A higher alpha causes the internal IMU to converge onto the assist source more rapidly.
// Use default value
LimelightHelpers.SetIMUAssistAlpha("limelight", 0.001);
limelightName
string
required
Name of the Limelight NetworkTables table.
alpha
double
required
Complementary filter alpha. Default is 0.001. Higher values increase convergence speed.

Python scripting

setPythonScriptData

Sends an array of doubles to the currently running Python script on the Limelight.
double[] outData = {1.0, 2.5, 0.0};
LimelightHelpers.setPythonScriptData("limelight", outData);
limelightName
string
required
Name of the Limelight NetworkTables table.
outgoingPythonData
double[]
required
Array of doubles to pass to the Python script via the llrobot NetworkTables key.

getPythonScriptData

Returns the output array published by the currently running Python script on the Limelight.
double[] pythonOut = LimelightHelpers.getPythonScriptData("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
double[]
Array of doubles published by the Python script via the llpython NetworkTables key.

Build docs developers (and LLMs) love