Skip to content

Commit de3e309

Browse files
Added docs from limelightvision.io; still missing a few
1 parent cc3f59e commit de3e309

File tree

8 files changed

+341
-5
lines changed

8 files changed

+341
-5
lines changed

vendordep/repo/yall.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"fileName": "yall.json",
33
"name": "YALL",
4-
"version": "2025.9.3",
4+
"version": "test",
55
"frcYear": "2025",
66
"uuid": "29aa8c8f-05ae-40aa-96f9-552a5c8a0347",
77
"mavenUrls": [
@@ -12,7 +12,7 @@
1212
{
1313
"groupId": "yall",
1414
"artifactId": "yall-java",
15-
"version": "2025.9.3"
15+
"version": "test"
1616
}
1717
],
1818
"jniDependencies": [],

yall/java/limelight/networktables/LimelightResults.java

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,61 +25,116 @@ public class LimelightResults
2525

2626
public String error;
2727

28+
/**
29+
* Current pipeline index
30+
*/
2831
@JsonProperty("pID")
2932
public double pipelineID;
3033

34+
/**
35+
* Targeting latency (milliseconds consumed by tracking loop this frame)
36+
*/
3137
@JsonProperty("tl")
3238
public double latency_pipeline;
3339

40+
/**
41+
* Capture latency (milliseconds between the end of the exposure of the middle row to the beginning of the tracking
42+
* loop)
43+
*/
3444
@JsonProperty("cl")
3545
public double latency_capture;
3646

3747
public double latency_jsonParse;
3848

49+
/**
50+
* Timestamp in milliseconds from boot.
51+
*/
3952
@JsonProperty("ts")
4053
public double timestamp_LIMELIGHT_publish;
4154

4255
@JsonProperty("ts_rio")
4356
public double timestamp_RIOFPGA_capture;
4457

58+
/**
59+
* Validity indicator. 1 = valid targets, 0 = no valid targets
60+
*/
4561
@JsonProperty("v")
4662
@JsonFormat(shape = Shape.NUMBER)
4763
public boolean valid;
4864

65+
/**
66+
* Botpose (MegaTag): x,y,z, roll, pitch, yaw (meters, degrees)
67+
*/
4968
@JsonProperty("botpose")
5069
public double[] botpose;
5170

71+
/**
72+
* Botpose (MegaTag, WPI Red driverstation): x,y,z, roll, pitch, yaw (meters, degrees)
73+
*/
5274
@JsonProperty("botpose_wpired")
5375
public double[] botpose_wpired;
5476

77+
/**
78+
* Botpose (MegaTag, WPI Blue driverstation): x,y,z, roll, pitch, yaw (meters, degrees)
79+
*/
5580
@JsonProperty("botpose_wpiblue")
5681
public double[] botpose_wpiblue;
5782

83+
/**
84+
* Number of tags used to compute botpose
85+
*/
5886
@JsonProperty("botpose_tagcount")
5987
public double botpose_tagcount;
6088

89+
/**
90+
* Max distance between tags used to compute botpose (meters)
91+
*/
6192
@JsonProperty("botpose_span")
6293
public double botpose_span;
6394

95+
/**
96+
* Max distance between tags used to compute botpose (meters)
97+
*/
6498
@JsonProperty("botpose_avgdist")
6599
public double botpose_avgdist;
66100

101+
/**
102+
* Average area of tags used to compute botpose
103+
*/
67104
@JsonProperty("botpose_avgarea")
68105
public double botpose_avgarea;
69106

70107
@JsonProperty("t6c_rs")
71108
public double[] camerapose_robotspace;
109+
/**
110+
* Color/Retroreflective pipeline results array
111+
*/
72112
@JsonProperty("Retro")
73113
public RetroreflectiveTape[] targets_Retro;
114+
/**
115+
* AprilTag pipeline results array
116+
*/
74117
@JsonProperty("Fiducial")
75118
public AprilTagFiducial[] targets_Fiducials;
119+
/**
120+
* Classifier pipeline results array
121+
*/
76122
@JsonProperty("Classifier")
77123
public NeuralClassifier[] targets_Classifier;
124+
/**
125+
* Neural Detector pipeline results array
126+
*/
78127
@JsonProperty("Detector")
79128
public NeuralDetector[] targets_Detector;
129+
/**
130+
* Barcode pipeline results array
131+
*/
80132
@JsonProperty("Barcode")
81133
public Barcode[] targets_Barcode;
82134

135+
/**
136+
* Construct a LimelightResults object for JSON Parsing.
137+
*/
83138
public LimelightResults()
84139
{
85140
botpose = new double[6];
@@ -94,11 +149,22 @@ public LimelightResults()
94149

95150
}
96151

152+
/**
153+
* Get the current botpose as a {@link Pose3d} object.
154+
*
155+
* @return {@link Pose3d} object representing the botpose.
156+
*/
97157
public Pose3d getBotPose3d()
98158
{
99159
return toPose3D(botpose);
100160
}
101161

162+
/**
163+
* Get the current botpose as a {@link Pose3d} object.
164+
*
165+
* @param alliance Alliance color to get the botpose for.
166+
* @return {@link Pose3d} object representing the botpose.
167+
*/
102168
public Pose3d getBotPose3d(DriverStation.Alliance alliance)
103169
{
104170
if (alliance == DriverStation.Alliance.Red)
@@ -110,11 +176,22 @@ public Pose3d getBotPose3d(DriverStation.Alliance alliance)
110176
}
111177
}
112178

179+
/**
180+
* Get the current botpose as a {@link Pose2d} object.
181+
*
182+
* @return
183+
*/
113184
public Pose2d getBotPose2d()
114185
{
115186
return toPose2D(botpose);
116187
}
117188

189+
/**
190+
* Get the current botpose as a {@link Pose2d} object.
191+
*
192+
* @param alliance Alliance color to get the botpose for.
193+
* @return {@link Pose2d} object representing the botpose.
194+
*/
118195
public Pose2d getBotPose2d(DriverStation.Alliance alliance)
119196
{
120197
if (alliance == DriverStation.Alliance.Red)

yall/java/limelight/networktables/LimelightSettings.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ public LimelightSettings withImuMode(ImuMode mode)
208208
public LimelightSettings withRobotOrientation(Orientation3d orientation)
209209
{
210210
robotOrientationSet.set(orientation3dToArray(orientation));
211+
save();
211212
return this;
212213
}
213214

@@ -347,15 +348,15 @@ public enum DownscalingOverride
347348
public enum ImuMode
348349
{
349350
/**
350-
* Use external IMU yaw submitted via {@link withRobotOrientation} for MT2 localization. The internal IMU is ignored entirely.
351+
* Use external IMU yaw submitted via {@link LimelightSettings#withRobotOrientation(Orientation3d)} for MT2 localization. The internal IMU is ignored entirely.
351352
*/
352353
ExternalImu,
353354
/**
354-
* Use external IMU yaw submitted via {@link withRobotOrientation} for MT2 localization. The internal IMU is synced with the external IMU.
355+
* Use external IMU yaw submitted via {@link LimelightSettings#withRobotOrientation(Orientation3d)} for MT2 localization. The internal IMU is synced with the external IMU.
355356
*/
356357
SyncInternalImu,
357358
/**
358-
* Use internal IMU for MT2 localization. Ignores external IMU updates from {@link withRobotOrientation}.
359+
* Use internal IMU for MT2 localization. Ignores external IMU updates from {@link LimelightSettings#withRobotOrientation(Orientation3d)}.
359360
*/
360361
InternalImu
361362
}

yall/java/limelight/networktables/target/AprilTagFiducial.java

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,86 @@
1313
public class AprilTagFiducial
1414
{
1515

16+
/**
17+
* Fiducial tag ID
18+
*/
1619
@JsonProperty("fID")
1720
public double fiducialID;
1821

22+
/**
23+
* Fiducial Family (16H5C, 25H9C, 36H11C, etc)
24+
*/
1925
@JsonProperty("fam")
2026
public String fiducialFamily;
27+
/**
28+
* The size of the target as a percentage of the image (0-1)
29+
*/
2130
@JsonProperty("ta")
2231
public double ta;
32+
/**
33+
* X-coordinate of the center of the target in degrees relative to crosshair. Positive-right, center-zero
34+
*/
2335
@JsonProperty("tx")
2436
public double tx;
37+
/**
38+
* Y-coordinate of the center of the target in degrees relative to crosshair. Positive-down, center-zero
39+
*/
2540
@JsonProperty("ty")
2641
public double ty;
42+
/**
43+
* X-coordinate of the center of the target in pixels relative to crosshair. Positive-right, center-zero
44+
*/
2745
@JsonProperty("txp")
2846
public double tx_pixels;
47+
/**
48+
* Y-coordinate of the center of the target in pixels relative to crosshair. Positive-down, center-zero
49+
*/
2950
@JsonProperty("typ")
3051
public double ty_pixels;
52+
/**
53+
* X-coordinate of the center of the target in degrees relative to principal piexel. Positive-right, center-zero
54+
*/
3155
@JsonProperty("tx_nocross")
3256
public double tx_nocrosshair;
57+
/**
58+
* Y-coordinate of the center of the target in degrees relative to principal pixel. Positive-right, center-zero
59+
*/
3360
@JsonProperty("ty_nocross")
3461
public double ty_nocrosshair;
62+
/**
63+
* Timestamp in milliseconds from boot.
64+
*/
3565
@JsonProperty("ts")
3666
public double ts;
67+
/**
68+
* Camera Pose in target space as computed by solvepnp (x,y,z,rx,ry,rz)
69+
*/
3770
@JsonProperty("t6c_ts")
3871
private double[] cameraPose_TargetSpace;
72+
/**
73+
* Robot Pose in field space as computed by solvepnp (x,y,z,rx,ry,rz)
74+
*/
3975
@JsonProperty("t6r_fs")
4076
private double[] robotPose_FieldSpace;
77+
/**
78+
* Robot Pose in target space as computed by solvepnp (x,y,z,rx,ry,rz)
79+
*/
4180
@JsonProperty("t6r_ts")
4281
private double[] robotPose_TargetSpace;
82+
/**
83+
* Target Pose in camera space as computed by solvepnp (x,y,z,rx,ry,rz)
84+
*/
4385
@JsonProperty("t6t_cs")
4486
private double[] targetPose_CameraSpace;
87+
/**
88+
* Target Pose in robot space as computed by solvepnp (x,y,z,rx,ry,rz)
89+
*/
4590
@JsonProperty("t6t_rs")
4691
private double[] targetPose_RobotSpace;
4792

93+
/**
94+
* Create the AprilTagFiducial object
95+
*/
4896
public AprilTagFiducial()
4997
{
5098
cameraPose_TargetSpace = new double[6];
@@ -54,51 +102,101 @@ public AprilTagFiducial()
54102
targetPose_RobotSpace = new double[6];
55103
}
56104

105+
/**
106+
* Get the AprilTag's 3D pose in target space
107+
*
108+
* @return {@link Pose3d} object representing the AprilTag's position and orientation relative to the camera
109+
*/
57110
public Pose3d getCameraPose_TargetSpace()
58111
{
59112
return toPose3D(cameraPose_TargetSpace);
60113
}
61114

115+
/**
116+
* Get the AprilTag's 3D pose in field space
117+
*
118+
* @return {@link Pose3d} object representing the AprilTag's position and orientation relative to the robot
119+
*/
62120
public Pose3d getRobotPose_FieldSpace()
63121
{
64122
return toPose3D(robotPose_FieldSpace);
65123
}
66124

125+
/**
126+
* Get the AprilTag's 3D pose in target space
127+
*
128+
* @return {@link Pose3d} object representing the AprilTag's position and orientation relative to the robot
129+
*/
67130
public Pose3d getRobotPose_TargetSpace()
68131
{
69132
return toPose3D(robotPose_TargetSpace);
70133
}
71134

135+
/**
136+
* Get the AprilTag's 3D pose in camera space
137+
*
138+
* @return {@link Pose3d} object representing the AprilTag's position and orientation relative to the camera
139+
*/
72140
public Pose3d getTargetPose_CameraSpace()
73141
{
74142
return toPose3D(targetPose_CameraSpace);
75143
}
76144

145+
/**
146+
* Get the AprilTag's 3D pose in robot space
147+
*
148+
* @return {@link Pose3d} object representing the AprilTag's position and orientation relative to the robot
149+
*/
77150
public Pose3d getTargetPose_RobotSpace()
78151
{
79152
return toPose3D(targetPose_RobotSpace);
80153
}
81154

155+
/**
156+
* Get the AprilTag's 2D pose in target space
157+
*
158+
* @return {@link Pose2d} object representing the AprilTag's position and orientation relative to the camera
159+
*/
82160
public Pose2d getCameraPose_TargetSpace2D()
83161
{
84162
return toPose2D(cameraPose_TargetSpace);
85163
}
86164

165+
/**
166+
* Get the AprilTag's 2D pose in field space
167+
*
168+
* @return {@link Pose2d} object representing the AprilTag's position and orientation relative to the robot
169+
*/
87170
public Pose2d getRobotPose_FieldSpace2D()
88171
{
89172
return toPose2D(robotPose_FieldSpace);
90173
}
91174

175+
/**
176+
* Get the AprilTag's 2D pose in target space
177+
*
178+
* @return {@link Pose2d} object representing the AprilTag's position and orientation relative to the robot
179+
*/
92180
public Pose2d getRobotPose_TargetSpace2D()
93181
{
94182
return toPose2D(robotPose_TargetSpace);
95183
}
96184

185+
/**
186+
* Get the AprilTag's 2D pose in camera space
187+
*
188+
* @return {@link Pose2d} object representing the AprilTag's position and orientation relative to the camera
189+
*/
97190
public Pose2d getTargetPose_CameraSpace2D()
98191
{
99192
return toPose2D(targetPose_CameraSpace);
100193
}
101194

195+
/**
196+
* Get the AprilTag's 2D pose in robot space
197+
*
198+
* @return {@link Pose2d} object representing the AprilTag's position and orientation relative to the robot
199+
*/
102200
public Pose2d getTargetPose_RobotSpace2D()
103201
{
104202
return toPose2D(targetPose_RobotSpace);

0 commit comments

Comments
 (0)