Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions LimelightHelpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ public class LimelightHelpers {
public static class LimelightTarget_Retro {

@JsonProperty("t6c_ts")
private double[] cameraPose_TargetSpace;
public double[] cameraPose_TargetSpace;

@JsonProperty("t6r_fs")
private double[] robotPose_FieldSpace;
public double[] robotPose_FieldSpace;

@JsonProperty("t6r_ts")
private double[] robotPose_TargetSpace;
public double[] robotPose_TargetSpace;

@JsonProperty("t6t_cs")
private double[] targetPose_CameraSpace;
public double[] targetPose_CameraSpace;

@JsonProperty("t6t_rs")
private double[] targetPose_RobotSpace;
public double[] targetPose_RobotSpace;

public Pose3d getCameraPose_TargetSpace()
{
Expand Down Expand Up @@ -124,19 +124,19 @@ public static class LimelightTarget_Fiducial {
public String fiducialFamily;

@JsonProperty("t6c_ts")
private double[] cameraPose_TargetSpace;
public double[] cameraPose_TargetSpace;

@JsonProperty("t6r_fs")
private double[] robotPose_FieldSpace;
public double[] robotPose_FieldSpace;

@JsonProperty("t6r_ts")
private double[] robotPose_TargetSpace;
public double[] robotPose_TargetSpace;

@JsonProperty("t6t_cs")
private double[] targetPose_CameraSpace;
public double[] targetPose_CameraSpace;

@JsonProperty("t6t_rs")
private double[] targetPose_RobotSpace;
public double[] targetPose_RobotSpace;

public Pose3d getCameraPose_TargetSpace()
{
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ https://github.com/LimelightVision/limelightlib-wpijava/releases
This is a single-file library. All you need to do is copy the LimelightHelpers.java file from the latest release (https://github.com/LimelightVision/limelightlib-wpijava/releases) into your Java project's "robot" folder. You don't need to create any objects for your Limelights - the library is designed to be used in a functional manner.

### Basic Usage
Every method in Limelightlib accepts a string parameter indicating the correct Limelight to use. If left blank or null, the name is assumed to be "limelight"
Every method in Limelightlib accepts a string parameter indicating the correct Limelight to use. If left blank or null, the name is assumed to be "limelight".
```
LimelightHelpers.setLEDMode_PipelineControl("");
LimelightHelpers.setLEDMode_ForceBlink("")
Expand All @@ -19,8 +19,13 @@ Takes up to 2.5ms on RoboRIO 1.0. Parsing latency is logged in results.targeting

```
LimelightHelpers.LimelightResults llresults = LimelightHelpers.getLatestResults("");
LimelightHelpers.LimelightTarget_Fiducial[] dataFiducial = llresults.targetingResults.targets_Fiducials;
public double[] data = dataFiducial[0].cameraPose_TargetSpace;
```
Each LimelightResults instance contains a Results object. Each Results object contains data such as botpose, an array for each target type, etc. With getLatestResults(), you now have easy access to 100% of your Limelight's output.

Each LimelightResults instance contains a `targetingResults` object. Each Results object contains data such as botpose, an array for each target type, etc. With getLatestResults(), you now have easy access to 100% of your Limelight's output.

You may construct your code to recognize and track April Tags like the one showed above.

```
double[] botposeRed = llresults.results.botpose_wpired;
Expand All @@ -42,6 +47,7 @@ LimelightHelpers.LimelightTarget_Classifier
LimelightHelpers.LimelightTarget_Detector
LimelightHelpers.Results
LimelightHelpers.LimelightResults
LimelightHelpers.profileJSON (This is a boolean which represents whether the time to recognize the target will be printed on the terminal)
(Pure Static) LimelightHelpers
```

Expand Down Expand Up @@ -95,3 +101,7 @@ getPythonScriptData()
takeSnapshot()
getLatestResults()
```

### Others

There might be some problems that the coding way mentioned in the docs may not make sense. Under this condition, you may refer to the source code.