Skip to main content

JSON Dump Specification

Limelight's JSON results output is a collection of arrays containing targeting results. Separate arrays exist for retroreflective, fiducial, neural classifier, and neural detector results. JSON is human-readable and easy to parse in any language on any platform, so it is perfect for most use-cases. The same JSON dump may be retrieved using the REST/HTTP, Websocket, and NetworkTables APIs. Parsing this JSON output is incredibly easy with our FRC libraries.

Limelightlib has built-in functionality that parses the JSON Dump into a LimelightResults object.

https://github.com/LimelightVision/limelightlib-wpijava

https://github.com/LimelightVision/limelightlib-wpicpp

Every JSON result contains the following entries:

pIDCurrent pipeline index
tlTargeting latency (milliseconds consumed by tracking loop this frame)
clCapture latency (milliseconds between the end of the exposure of the middle row to the beginning of the tracking loop)
tsTimestamp in milliseconds from boot.
vValidity indicator. 1 = valid targets, 0 = no valid targets
botposeBotpose (MegaTag): x,y,z, roll, pitch, yaw (meters, degrees)
botpose_wpiredBotpose (MegaTag, WPI Red driverstation): x,y,z, roll, pitch, yaw (meters, degrees)
botpose_wpiblueBotpose (MegaTag, WPI Blue driverstation): x,y,z, roll, pitch, yaw (meters, degrees)
botpose_orbBotpose (MegaTag2): x,y,z, roll, pitch, yaw (meters, degrees)
botpose_orb_wpiredBotpose (MegaTag2, WPI Red driverstation): x,y,z, roll, pitch, yaw (meters, degrees)
botpose_orb_wpiblueBotpose (MegaTag2, WPI Blue driverstation): x,y,z, roll, pitch, yaw (meters, degrees)
botpose_avgareaAverage area of tags used to compute botpose
botpose_avgdistMax distance between tags used to compute botpose (meters)
botpose_spanMax distance between tags used to compute botpose (meters)
botpose_tagcountNumber of tags used to compute botpose

Retroreflective Results

The "Retro" array contains entries with the following structure:

ptsIndividual corner points as an array of {x,y} in pixels. Center-zero, positive right and down. Must be enabled.
t6c_tsCamera Pose in target space as computed by solvepnp (x,y,z,rx,ry,rz)
t6r_fsRobot Pose in field space as computed by solvepnp (x,y,z,rx,ry,rz)
t6r_tsRobot Pose in target space as computed by solvepnp (x,y,z,rx,ry,rz)
t6t_csTarget Pose in camera space as computed by solvepnp (x,y,z,rx,ry,rz)
t6t_rsTarget Pose in robot space as computed by solvepnp (x,y,z,rx,ry,rz)
taThe size of the target as a percentage of the image (0-1)
txX-coordinate of the center of the target in degrees. Positive-right, center-zero
txpX-coordinate of the center of the target in pixels. Positive-right, center-zero
tyY-coordinate of the center of the target in degrees. Positive-down, center-zero
typY-coordinate of the center of the target in pixels. Positive-down, center-zero
{
"Classifier": [],
"Detector": [],
"Fiducial": [],
"Retro": [
{
"pts": [],
"t6c_ts": [],
"t6r_fs": [],
"t6r_ts": [],
"t6t_cs": [],
"t6t_rs": [],
"ta": 0.028124958276748657,
"tx": -6.858895301818848,
"txp": 125.89512634277344,
"ty": 8.712546348571777,
"typ": 79.79258728027344
}
],
"pID": 0,
"tl": 4.795886039733887,
"ts": 4524421.206346,
"v": 1
}

AprilTag/Fiducial Results

The "Fiducial" array contains entries with the following structure:

fidFiducial tag ID
famFiducial Family (16H5C, 25H9C, 36H11C, etc)
ptsReturn individual corner points. Must be enabled.
skewCurrently unused
t6c_tsCamera Pose in target space as computed by this fiducial (x,y,z,pitch,yaw,roll) (meters, degrees)
t6r_fsRobot Pose in field space as computed by this fiducial (x,y,z,pitch,yaw,roll) (meters, degrees)
t6r_fs_orbRobot Pose in field space as computed by this fiducial (Megatag2) (x,y,z,pitch,yaw,roll) (meters, degrees)
t6r_tsRobot Pose in target space as computed by this fiducial (x,y,z,pitch,yaw,roll) (meters, degrees)
t6t_csTarget Pose in camera space as computed by this fiducial (x,y,z,pitch,yaw,roll) (meters, degrees)
t6t_rsTarget Pose in robot space as computed by this fiducial (x,y,z,pitch,yaw,roll) (meters, degrees)
taThe size of the target as a percentage of the image (0-1)
txX-coordinate of the center of the target in degrees. Positive-right, center-zero
txpX-coordinate of the center of the target in pixels. Positive-right, center-zero
tyY-coordinate of the center of the target in degrees. Positive-down, center-zero
typY-coordinate of the center of the target in pixels. Positive-down, center-zero
{
"Classifier": [],
"Detector": [],
"Fiducial": [
{
"fID": 2,
"fam": "16H5C",
"pts": [],
"skew": [],
"t6c_ts": [
0.33247368976801916,
-0.05672695778305914,
-2.5042031405987144,
-4.680849607956358,
-5.171154989721864,
4.528697946312339
],
"t6r_fs": [
4.738896418276903,
-1.5926603672041666,
0.5194469577830592,
4.522658587661256,
4.258580454853879,
5.5236539893713275
],
"t6r_ts": [
0.33247368976801916,
-0.05672695778305914,
-2.5042031405987144,
-4.680849607956358,
-5.171154989721864,
4.528697946312339
],
"t6t_cs": [
-0.09991902572799474,
-0.1234042720218289,
2.5218203039582496,
4.278368708252767,
5.508508005282244,
-4.1112864453027775
],
"t6t_rs": [
-0.09991902572799474,
-0.1234042720218289,
2.5218203039582496,
4.278368708252767,
5.508508005282244,
-4.1112864453027775
],
"ta": 0.005711808800697327,
"tx": -2.0525293350219727,
"txp": 149.4874725341797,
"ty": 2.7294836044311523,
"typ": 107.14710235595703
}
],
"Retro": [],
"pID": 0,
"tl": 19.78130340576172,
"ts": 3284447.910569,
"v": 1
}

Neural Detector Results

The "Detector" array contains entries with the following structure:

classHuman-readable class name string
classIDClassID integer
confConfidence of the predicition
ptsIndividual corner points as an array of {x,y} in pixels. Center-zero, positive right and down. Must be enabled.
taThe size of the target as a percentage of the image (0-1)
txX-coordinate of the center of the target in degrees. Positive-right, center-zero
txpX-coordinate of the center of the target in pixels. Positive-right, center-zero
tyY-coordinate of the center of the target in degrees. Positive-down, center-zero
typY-coordinate of the center of the target in pixels. Positive-down, center-zero
{
"Classifier": [],
"Detector": [
{
"class": "person",
"classID": 0,
"conf": 0.83984375,
"pts": [],
"ta": 0.2608712911605835,
"tx": -2.45949649810791,
"txp": 147.5,
"ty": -10.066887855529785,
"typ": 165.5
}
],
"Fiducial": [],
"Retro": [],
"pID": 0,
"tl": 63.50614547729492,
"ts": 4932985.266867,
"v": 1
}

Neural Classifier Results

The "Classifier" array contains entries with the following structure:

classHuman-readable class name string
classIDClassID integer
confConfidence of the predicition
{
"Classifier": [
{
"class": "digital clock",
"classID": 531,
"conf": 0.16796875
}
],
"Detector": [],
"Fiducial": [],
"Retro": [],
"pID": 0,
"tl": 16.704740524291992,
"ts": 4751332.7542280005,
"v": 1
}