From ab69f730b0638b3cdfa519a1198b953daec994db Mon Sep 17 00:00:00 2001 From: CLCK Date: Wed, 22 Feb 2023 23:32:51 +0800 Subject: [PATCH 1/5] Update README.md --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6f001ed..d6dccb2 100644 --- a/README.md +++ b/README.md @@ -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("") @@ -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; @@ -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 ``` @@ -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 check the source code. \ No newline at end of file From 1a924906a9a1ed6f1e71b1d3dfdd735b4316f620 Mon Sep 17 00:00:00 2001 From: CLCK Date: Wed, 22 Feb 2023 23:39:09 +0800 Subject: [PATCH 2/5] Update LimelightHelpers.java --- LimelightHelpers.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/LimelightHelpers.java b/LimelightHelpers.java index 1856f5e..9821dfc 100644 --- a/LimelightHelpers.java +++ b/LimelightHelpers.java @@ -1,5 +1,11 @@ //LimelightHelpers v1.2.0 (Feb 13, 2023) +/* + * change log 2.22 by @CLCK0622 & @aeilot: + * change the source data transformed to pose3d from private to public, in order to let data fetching easier + * change the boolean profileJSON from private to public, so that logging feature can be easily configured + */ + package frc.robot; import edu.wpi.first.networktables.NetworkTable; From 080b221380747e8327926bbb66eb88616d907525 Mon Sep 17 00:00:00 2001 From: Kevin Zhong Date: Fri, 24 Feb 2023 22:21:01 +0800 Subject: [PATCH 3/5] upd README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d6dccb2..137ea65 100644 --- a/README.md +++ b/README.md @@ -104,4 +104,4 @@ getLatestResults() ### Others -There might be some problems that the coding way mentioned in the docs may not make sense. Under this condition, you may check the source code. \ No newline at end of file +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. \ No newline at end of file From 0110e04cdfa9577b620c9ab7d3a2a695bcd73574 Mon Sep 17 00:00:00 2001 From: Kevin Zhong Date: Fri, 24 Feb 2023 22:25:27 +0800 Subject: [PATCH 4/5] Update LimelightHelpers.java change log 2.22 by @CLCK0622 & @aeilot: change the source data transformed to pose3d from private to public, in order to let data fetching easier change the boolean profileJSON from private to public, so that logging feature can be easily configured --- LimelightHelpers.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/LimelightHelpers.java b/LimelightHelpers.java index 9821dfc..a498d84 100644 --- a/LimelightHelpers.java +++ b/LimelightHelpers.java @@ -37,19 +37,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() { @@ -130,19 +130,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() { From 5f10adadaec9861f2379c1f65989e60524d9bbb6 Mon Sep 17 00:00:00 2001 From: Kevin Zhong Date: Fri, 24 Feb 2023 22:26:31 +0800 Subject: [PATCH 5/5] Update LimelightHelpers.java --- LimelightHelpers.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/LimelightHelpers.java b/LimelightHelpers.java index a498d84..e7df8fb 100644 --- a/LimelightHelpers.java +++ b/LimelightHelpers.java @@ -1,11 +1,5 @@ //LimelightHelpers v1.2.0 (Feb 13, 2023) -/* - * change log 2.22 by @CLCK0622 & @aeilot: - * change the source data transformed to pose3d from private to public, in order to let data fetching easier - * change the boolean profileJSON from private to public, so that logging feature can be easily configured - */ - package frc.robot; import edu.wpi.first.networktables.NetworkTable;