SubZero Common
Common library components for an FRC CommandRobot
Loading...
Searching...
No Matches
LimelightHelpers.h
Go to the documentation of this file.
1#ifndef LIMELIGHTHELPERS_H
2#define LIMELIGHTHELPERS_H
3
5// https://github.com/LimelightVision/limelightlib-wpicpp
7
8#include <wpinet/PortForwarder.h>
9
10#include <string>
11
12#include "networktables/NetworkTable.h"
13#include "networktables/NetworkTableEntry.h"
14#include "networktables/NetworkTableInstance.h"
15#include "networktables/NetworkTableValue.h"
16#include "wpi/json.h"
17// #include <curl/curl.h>
18#include <fcntl.h>
19#include <frc/geometry/Pose2d.h>
20#include <frc/geometry/Pose3d.h>
21#include <frc/geometry/Rotation2d.h>
22#include <frc/geometry/Rotation3d.h>
23#include <frc/geometry/Translation2d.h>
24#include <frc/geometry/Translation3d.h>
25#include <units/time.h>
26
27#include <chrono>
28#include <cstring>
29#include <iostream>
30#include <memory>
31#include <vector>
32
33#ifndef M_PI
34#define M_PI 3.14159265358979323846
35#endif
36
38inline std::string sanitizeName(const std::string &name) {
39 if (name == "") {
40 return "limelight";
41 }
42 return name;
43}
44
45inline frc::Pose3d toPose3D(const std::vector<double> &inData) {
46 if (inData.size() < 6) {
47 return frc::Pose3d();
48 }
49 return frc::Pose3d(
50 frc::Translation3d(units::length::meter_t(inData[0]),
51 units::length::meter_t(inData[1]),
52 units::length::meter_t(inData[2])),
53 frc::Rotation3d(units::angle::radian_t(inData[3] * (M_PI / 180.0)),
54 units::angle::radian_t(inData[4] * (M_PI / 180.0)),
55 units::angle::radian_t(inData[5] * (M_PI / 180.0))));
56}
57
58inline frc::Pose2d toPose2D(const std::vector<double> &inData) {
59 if (inData.size() < 6) {
60 return frc::Pose2d();
61 }
62 return frc::Pose2d(
63 frc::Translation2d(units::length::meter_t(inData[0]),
64 units::length::meter_t(inData[1])),
65 frc::Rotation2d(units::angle::radian_t(inData[5] * (M_PI / 180.0))));
66}
67
68inline std::shared_ptr<nt::NetworkTable>
69getLimelightNTTable(const std::string &tableName) {
70 return nt::NetworkTableInstance::GetDefault().GetTable(
71 sanitizeName(tableName));
72}
73
74inline nt::NetworkTableEntry
75getLimelightNTTableEntry(const std::string &tableName,
76 const std::string &entryName) {
77 return getLimelightNTTable(tableName)->GetEntry(entryName);
78}
79
80inline double getLimelightNTDouble(const std::string &tableName,
81 const std::string &entryName) {
82 return getLimelightNTTableEntry(tableName, entryName).GetDouble(0.0);
83}
84
85inline std::vector<double>
86getLimelightNTDoubleArray(const std::string &tableName,
87 const std::string &entryName) {
88 return getLimelightNTTableEntry(tableName, entryName)
89 .GetDoubleArray(std::span<double>{});
90}
91
92inline std::string getLimelightNTString(const std::string &tableName,
93 const std::string &entryName) {
94 return getLimelightNTTableEntry(tableName, entryName).GetString("");
95}
96
97inline void setLimelightNTDouble(const std::string &tableName,
98 const std::string entryName, double val) {
99 getLimelightNTTableEntry(tableName, entryName).SetDouble(val);
100}
101
102inline void setLimelightNTDoubleArray(const std::string &tableName,
103 const std::string &entryName,
104 const std::span<const double> &vals) {
105 getLimelightNTTableEntry(tableName, entryName).SetDoubleArray(vals);
106}
107
108inline double getTX(const std::string &limelightName = "") {
109 return getLimelightNTDouble(limelightName, "tx");
110}
111
112inline double getTV(const std::string &limelightName = "") {
113 return getLimelightNTDouble(limelightName, "tv");
114}
115
116inline double getTY(const std::string &limelightName = "") {
117 return getLimelightNTDouble(limelightName, "ty");
118}
119
120inline double getTA(const std::string &limelightName = "") {
121 return getLimelightNTDouble(limelightName, "ta");
122}
123
124inline double getLatency_Pipeline(const std::string &limelightName = "") {
125 return getLimelightNTDouble(limelightName, "tl");
126}
127
128inline double getLatency_Capture(const std::string &limelightName = "") {
129 return getLimelightNTDouble(limelightName, "cl");
130}
131
132inline std::string getJSONDump(const std::string &limelightName = "") {
133 return getLimelightNTString(limelightName, "json");
134}
135
136inline std::vector<double> getBotpose(const std::string &limelightName = "") {
137 return getLimelightNTDoubleArray(limelightName, "botpose");
138}
139
140inline std::vector<double>
141getBotpose_wpiRed(const std::string &limelightName = "") {
142 return getLimelightNTDoubleArray(limelightName, "botpose_wpired");
143}
144
145inline std::vector<double>
146getBotpose_wpiBlue(const std::string &limelightName = "") {
147 return getLimelightNTDoubleArray(limelightName, "botpose_wpiblue");
148}
149
150inline std::vector<double>
151getBotpose_TargetSpace(const std::string &limelightName = "") {
152 return getLimelightNTDoubleArray(limelightName, "botpose_targetspace");
153}
154
155inline std::vector<double>
156getCameraPose_TargetSpace(const std::string &limelightName = "") {
157 return getLimelightNTDoubleArray(limelightName, "camerapose_targetspace");
158}
159
160inline std::vector<double>
161getCameraPose_RobotSpace(const std::string &limelightName = "") {
162 return getLimelightNTDoubleArray(limelightName, "camerapose_robotspace");
163}
164
165inline std::vector<double>
166getTargetPose_CameraSpace(const std::string &limelightName = "") {
167 return getLimelightNTDoubleArray(limelightName, "targetpose_cameraspace");
168}
169
170inline std::vector<double>
171getTargetPose_RobotSpace(const std::string &limelightName = "") {
172 return getLimelightNTDoubleArray(limelightName, "targetpose_robotspace");
173}
174
175inline std::vector<double>
176getTargetColor(const std::string &limelightName = "") {
177 return getLimelightNTDoubleArray(limelightName, "tc");
178}
179
180inline double getFiducialID(const std::string &limelightName = "") {
181 return getLimelightNTDouble(limelightName, "tid");
182}
183
184inline std::string getNeuralClassID(const std::string &limelightName = "") {
185 return getLimelightNTString(limelightName, "tclass");
186}
187
190
191inline void setPipelineIndex(const std::string &limelightName, int index) {
192 setLimelightNTDouble(limelightName, "pipeline", index);
193}
194
195inline void setPriorityTagID(const std::string &limelightName, int ID) {
196 setLimelightNTDouble(limelightName, "priorityid", ID);
197}
198
199inline void setLEDMode_PipelineControl(const std::string &limelightName = "") {
200 setLimelightNTDouble(limelightName, "ledMode", 0);
201}
202
203inline void setLEDMode_ForceOff(const std::string &limelightName = "") {
204 setLimelightNTDouble(limelightName, "ledMode", 1);
205}
206
207inline void setLEDMode_ForceBlink(const std::string &limelightName = "") {
208 setLimelightNTDouble(limelightName, "ledMode", 2);
209}
210
211inline void setLEDMode_ForceOn(const std::string &limelightName = "") {
212 setLimelightNTDouble(limelightName, "ledMode", 3);
213}
214
215inline void setStreamMode_Standard(const std::string &limelightName = "") {
216 setLimelightNTDouble(limelightName, "stream", 0);
217}
218
219inline void setStreamMode_PiPMain(const std::string &limelightName = "") {
220 setLimelightNTDouble(limelightName, "stream", 1);
221}
222
223inline void setStreamMode_PiPSecondary(const std::string &limelightName = "") {
224 setLimelightNTDouble(limelightName, "stream", 2);
225}
226
231inline void setCropWindow(const std::string &limelightName, double cropXMin,
232 double cropXMax, double cropYMin, double cropYMax) {
233 double cropWindow[4]{cropXMin, cropXMax, cropYMin, cropYMax};
234 setLimelightNTDoubleArray(limelightName, "crop", cropWindow);
235}
236
240inline void SetRobotOrientation(const std::string &limelightName, double yaw,
241 double yawRate, double pitch, double pitchRate,
242 double roll, double rollRate) {
243 std::vector<double> entries = {yaw, yawRate, pitch,
244 pitchRate, roll, rollRate};
245 setLimelightNTDoubleArray(limelightName, "robot_orientation_set", entries);
246}
247
248inline void SetFiducialIDFiltersOverride(const std::string &limelightName,
249 const std::vector<int> &validIDs) {
250 std::vector<double> validIDsDouble(validIDs.begin(), validIDs.end());
251 setLimelightNTDoubleArray(limelightName, "fiducial_id_filters_set",
252 validIDsDouble);
253}
254
257
261inline void setCameraPose_RobotSpace(const std::string &limelightName,
262 double forward, double side, double up,
263 double roll, double pitch, double yaw) {
264 double entries[6] = {forward, side, up, roll, pitch, yaw};
265 setLimelightNTDoubleArray(limelightName, "camerapose_robotspace_set",
266 entries);
267}
268
269inline void setPythonScriptData(const std::string &limelightName,
270 const std::vector<double> &outgoingPythonData) {
272 limelightName, "llrobot",
273 std::span{outgoingPythonData.begin(), outgoingPythonData.size()});
274}
275
276inline std::vector<double>
277getPythonScriptData(const std::string &limelightName = "") {
278 return getLimelightNTDoubleArray(limelightName, "llpython");
279}
280
283
284// Take async snapshot
285
288
289inline double extractBotPoseEntry(const std::vector<double> &inData,
290 int position) {
291 if (inData.size() < static_cast<size_t>(position + 1)) {
292 return 0.0;
293 }
294 return inData[position];
295}
296
298public:
299 int id{0};
300 double txnc{0.0};
301 double tync{0.0};
302 double ta{0.0};
303 double distToCamera{0.0};
304 double distToRobot{0.0};
305 double ambiguity{0.0};
306
307 RawFiducial(int id, double txnc, double tync, double ta, double distToCamera,
308 double distToRobot, double ambiguity)
311};
312
314public:
315 frc::Pose2d pose;
316 units::time::second_t timestampSeconds{0.0};
317 double latency{0.0};
318 int tagCount{0};
319 double tagSpan{0.0};
320 double avgTagDist{0.0};
321 double avgTagArea{0.0};
322 std::vector<RawFiducial> rawFiducials;
323
324 PoseEstimate() = default;
325
326 PoseEstimate(const frc::Pose2d &pose, units::time::second_t timestampSeconds,
327 double latency, int tagCount, double tagSpan, double avgTagDist,
328 double avgTagArea, const std::vector<RawFiducial> &rawFiducials)
332};
333
334inline PoseEstimate getBotPoseEstimate(const std::string &limelightName,
335 const std::string &entryName) {
336 nt::NetworkTableEntry poseEntry =
337 getLimelightNTTableEntry(limelightName, entryName);
338 std::vector<double> poseArray = poseEntry.GetDoubleArray(std::span<double>{});
339 frc::Pose2d pose = toPose2D(poseArray);
340
341 double latency = extractBotPoseEntry(poseArray, 6);
342 int tagCount = static_cast<int>(extractBotPoseEntry(poseArray, 7));
343 double tagSpan = extractBotPoseEntry(poseArray, 8);
344 double tagDist = extractBotPoseEntry(poseArray, 9);
345 double tagArea = extractBotPoseEntry(poseArray, 10);
346
347 // getLastChange: microseconds; latency: milliseconds
348 units::second_t timestamp = units::time::second_t(
349 (poseEntry.GetLastChange() / 1000000.0) - (latency / 1000.0));
350
351 std::vector<RawFiducial> rawFiducials;
352 int valsPerFiducial = 7;
353 int expectedTotalVals = 11 + valsPerFiducial * tagCount;
354
355 if (poseArray.size() == expectedTotalVals) {
356 for (int i = 0; i < tagCount; i++) {
357 int baseIndex = 11 + (i * valsPerFiducial);
358 int id = static_cast<int>(extractBotPoseEntry(poseArray, baseIndex));
359 double txnc = extractBotPoseEntry(poseArray, baseIndex + 1);
360 double tync = extractBotPoseEntry(poseArray, baseIndex + 2);
361 double ta = extractBotPoseEntry(poseArray, baseIndex + 3);
362 double distToCamera = extractBotPoseEntry(poseArray, baseIndex + 4);
363 double distToRobot = extractBotPoseEntry(poseArray, baseIndex + 5);
364 double ambiguity = extractBotPoseEntry(poseArray, baseIndex + 6);
365 rawFiducials.emplace_back(id, txnc, tync, ta, distToCamera, distToRobot,
366 ambiguity);
367 }
368 }
369
370 return PoseEstimate(pose, timestamp, latency, tagCount, tagSpan, tagDist,
371 tagArea, rawFiducials);
372}
373
374inline PoseEstimate
375getBotPoseEstimate_wpiBlue(const std::string &limelightName = "") {
376 return getBotPoseEstimate(limelightName, "botpose_wpiblue");
377}
378
379inline PoseEstimate
380getBotPoseEstimate_wpiRed(const std::string &limelightName = "") {
381 return getBotPoseEstimate(limelightName, "botpose_wpired");
382}
383
384inline PoseEstimate
385getBotPoseEstimate_wpiBlue_MegaTag2(const std::string &limelightName = "") {
386 return getBotPoseEstimate(limelightName, "botpose_orb_wpiblue");
387}
388
389inline PoseEstimate
390getBotPoseEstimate_wpiRed_MegaTag2(const std::string &limelightName = "") {
391 return getBotPoseEstimate(limelightName, "botpose_orb_wpired");
392}
393
394inline const double INVALID_TARGET = 0.0;
428
434
442
452
462
464public:
467 std::vector<RetroreflectiveResultClass> RetroResults;
468 std::vector<FiducialResultClass> FiducialResults;
469 std::vector<DetectionResultClass> DetectionResults;
470 std::vector<ClassificationResultClass> ClassificationResults;
471 double m_timeStamp{-1.0};
474 double m_latencyJSON{0};
475 double m_pipelineIndex{-1.0};
476 int valid{0};
477 std::vector<double> botPose{6, 0.0};
478 std::vector<double> botPose_wpired{6, 0.0};
479 std::vector<double> botPose_wpiblue{6, 0.0};
480 void Clear() {
481 RetroResults.clear();
482 FiducialResults.clear();
483 DetectionResults.clear();
484 ClassificationResults.clear();
485 botPose.clear();
486 botPose_wpired.clear();
487 botPose_wpiblue.clear();
488 m_timeStamp = -1.0;
490
491 m_pipelineIndex = -1.0;
492 }
493};
494
501
502namespace internal {
503inline const std::string _key_timestamp{"ts"};
504inline const std::string _key_latency_pipeline{"tl"};
505inline const std::string _key_latency_capture{"cl"};
506
507inline const std::string _key_pipelineIndex{"pID"};
508inline const std::string _key_TargetXDegrees{"txdr"};
509inline const std::string _key_TargetYDegrees{"tydr"};
510inline const std::string _key_TargetXNormalized{"txnr"};
511inline const std::string _key_TargetYNormalized{"tynr"};
512inline const std::string _key_TargetXPixels{"txp"};
513inline const std::string _key_TargetYPixels{"typ"};
514
515inline const std::string _key_TargetXDegreesCrosshair{"tx"};
516inline const std::string _key_TargetYDegreesCrosshair{"ty"};
517inline const std::string _key_TargetXNormalizedCrosshair{"txn"};
518inline const std::string _key_TargetYNormalizedCrosshair{"tyn"};
519inline const std::string _key_TargetAreaNormalized{"ta"};
520inline const std::string _key_TargetAreaPixels{"tap"};
521inline const std::string _key_className{"class"};
522inline const std::string _key_classID{"classID"};
523inline const std::string _key_confidence{"conf"};
524inline const std::string _key_fiducialID{"fID"};
525inline const std::string _key_corners{"pts"};
526inline const std::string _key_transformCAMERAPOSE_TARGETSPACE{"t6c_ts"};
527inline const std::string _key_transformCAMERAPOSE_ROBOTSPACE{"t6c_rs"};
528
529inline const std::string _key_transformTARGETPOSE_CAMERASPACE{"t6t_cs"};
530inline const std::string _key_transformROBOTPOSE_TARGETSPACE{"t6r_ts"};
531inline const std::string _key_transformTARGETPOSE_ROBOTSPACE{"t6t_rs"};
532
533inline const std::string _key_botpose{"botpose"};
534inline const std::string _key_botpose_wpiblue{"botpose_wpiblue"};
535inline const std::string _key_botpose_wpired{"botpose_wpired"};
536
537inline const std::string _key_transformROBOTPOSE_FIELDSPACE{"t6r_fs"};
538inline const std::string _key_skew{"skew"};
539inline const std::string _key_ffamily{"fam"};
540inline const std::string _key_colorRGB{"cRGB"};
541inline const std::string _key_colorHSV{"cHSV"};
542} // namespace internal
543
544inline void SetupPortForwarding(const std::string &limelightName) {
545 auto &portForwarder = wpi::PortForwarder::GetInstance();
546 portForwarder.Add(5800, sanitizeName(limelightName), 5800);
547 portForwarder.Add(5801, sanitizeName(limelightName), 5801);
548 portForwarder.Add(5802, sanitizeName(limelightName), 5802);
549 portForwarder.Add(5803, sanitizeName(limelightName), 5803);
550 portForwarder.Add(5804, sanitizeName(limelightName), 5804);
551 portForwarder.Add(5805, sanitizeName(limelightName), 5805);
552 portForwarder.Add(5806, sanitizeName(limelightName), 5806);
553 portForwarder.Add(5807, sanitizeName(limelightName), 5807);
554 portForwarder.Add(5808, sanitizeName(limelightName), 5808);
555 portForwarder.Add(5809, sanitizeName(limelightName), 5809);
556}
557
558template <typename T, typename KeyType>
559T SafeJSONAccess(const wpi::json &jsonData, const KeyType &key,
560 const T &defaultValue) {
561 try {
562 return jsonData.at(key).template get<T>();
563 } catch (wpi::json::exception &e) {
564 return defaultValue;
565 } catch (...) {
566 return defaultValue;
567 }
568}
569inline void from_json(const wpi::json &j, RetroreflectiveResultClass &t) {
570 std::vector<double> defaultValueVector(6, 0.0);
574 j, internal::_key_transformCAMERAPOSE_ROBOTSPACE, defaultValueVector);
575
579 j, internal::_key_transformTARGETPOSE_ROBOTSPACE, defaultValueVector);
581 j, internal::_key_transformROBOTPOSE_TARGETSPACE, defaultValueVector);
583 j, internal::_key_transformROBOTPOSE_FIELDSPACE, defaultValueVector);
584
596 j, internal::_key_corners, std::vector<std::vector<double>>{});
597}
598
599inline void from_json(const wpi::json &j, FiducialResultClass &t) {
600 std::vector<double> defaultValueVector(6, 0.0);
606 j, internal::_key_transformCAMERAPOSE_ROBOTSPACE, defaultValueVector);
610 j, internal::_key_transformTARGETPOSE_ROBOTSPACE, defaultValueVector);
612 j, internal::_key_transformROBOTPOSE_TARGETSPACE, defaultValueVector);
614 j, internal::_key_transformROBOTPOSE_FIELDSPACE, defaultValueVector);
615
627 j, internal::_key_corners, std::vector<std::vector<double>>{});
628}
629
647
665
666inline void from_json(const wpi::json &j, VisionResultsClass &t) {
674 t.valid = SafeJSONAccess<double>(j, "v", 0.0);
675
676 std::vector<double> defaultVector{};
678 defaultVector);
680 j, internal::_key_botpose_wpired, defaultVector);
682 j, internal::_key_botpose_wpiblue, defaultVector);
683
685 j, "Retro", std::vector<RetroreflectiveResultClass>{});
687 j, "Fiducial", std::vector<FiducialResultClass>{});
689 j, "Detector", std::vector<DetectionResultClass>{});
692 j, "Detector", std::vector<ClassificationResultClass>{});
693}
694
699
700inline LimelightResultsClass
701getLatestResults(const std::string &limelightName = "", bool profile = false) {
702 auto start = std::chrono::high_resolution_clock::now();
703 std::string jsonString = getJSONDump(limelightName);
704 wpi::json data;
705 try {
706 data = wpi::json::parse(jsonString);
707 } catch (const std::exception &e) {
708 return LimelightResultsClass();
709 }
710
711 auto end = std::chrono::high_resolution_clock::now();
712 double nanos =
713 std::chrono::duration_cast<std::chrono::nanoseconds>(end - start).count();
714 double millis = (nanos * 0.000001);
715 try {
718 out.targetingResults.m_latencyJSON = millis;
719 if (profile) {
720 std::cout << "lljson: " << millis << std::endl;
721 }
722 return out;
723 } catch (...) {
724 return LimelightResultsClass();
725 }
726}
727
728inline std::optional<std::vector<double>>
729getCurrentCorners(const std::string &limelightName = "") {
730 auto entry = getLimelightNTDoubleArray(limelightName, "tcornxy");
731
732 if (entry.size() < 8) {
733 return std::nullopt;
734 }
735
736 return entry;
737}
738} // namespace LimelightHelpers
739#endif // LIMELIGHTHELPERS_H
#define M_PI
std::vector< RawFiducial > rawFiducials
PoseEstimate(const frc::Pose2d &pose, units::time::second_t timestampSeconds, double latency, int tagCount, double tagSpan, double avgTagDist, double avgTagArea, const std::vector< RawFiducial > &rawFiducials)
units::time::second_t timestampSeconds
RawFiducial(int id, double txnc, double tync, double ta, double distToCamera, double distToRobot, double ambiguity)
std::vector< std::vector< double > > m_TargetCorners
std::vector< ClassificationResultClass > ClassificationResults
std::vector< RetroreflectiveResultClass > RetroResults
std::vector< FiducialResultClass > FiducialResults
std::vector< DetectionResultClass > DetectionResults
const std::string _key_transformTARGETPOSE_ROBOTSPACE
const std::string _key_TargetYNormalizedCrosshair
const std::string _key_TargetAreaNormalized
const std::string _key_pipelineIndex
const std::string _key_latency_pipeline
const std::string _key_TargetXPixels
const std::string _key_TargetYDegreesCrosshair
const std::string _key_TargetAreaPixels
const std::string _key_TargetYPixels
const std::string _key_TargetXDegreesCrosshair
const std::string _key_timestamp
const std::string _key_transformCAMERAPOSE_ROBOTSPACE
const std::string _key_botpose_wpired
const std::string _key_TargetXNormalized
const std::string _key_transformTARGETPOSE_CAMERASPACE
const std::string _key_TargetYNormalized
const std::string _key_latency_capture
const std::string _key_transformROBOTPOSE_TARGETSPACE
const std::string _key_confidence
const std::string _key_TargetXDegrees
const std::string _key_TargetXNormalizedCrosshair
const std::string _key_botpose_wpiblue
const std::string _key_colorHSV
const std::string _key_className
const std::string _key_transformCAMERAPOSE_TARGETSPACE
const std::string _key_transformROBOTPOSE_FIELDSPACE
const std::string _key_fiducialID
const std::string _key_TargetYDegrees
const std::string _key_colorRGB
std::vector< double > getCameraPose_TargetSpace(const std::string &limelightName="")
void setPipelineIndex(const std::string &limelightName, int index)
double getLatency_Pipeline(const std::string &limelightName="")
nt::NetworkTableEntry getLimelightNTTableEntry(const std::string &tableName, const std::string &entryName)
std::optional< std::vector< double > > getCurrentCorners(const std::string &limelightName="")
void SetupPortForwarding(const std::string &limelightName)
double getTY(const std::string &limelightName="")
PoseEstimate getBotPoseEstimate(const std::string &limelightName, const std::string &entryName)
std::vector< double > getBotpose_wpiRed(const std::string &limelightName="")
std::vector< double > getBotpose_wpiBlue(const std::string &limelightName="")
PoseEstimate getBotPoseEstimate_wpiRed(const std::string &limelightName="")
T SafeJSONAccess(const wpi::json &jsonData, const KeyType &key, const T &defaultValue)
void setLEDMode_ForceBlink(const std::string &limelightName="")
LimelightResultsClass getLatestResults(const std::string &limelightName="", bool profile=false)
std::vector< double > getCameraPose_RobotSpace(const std::string &limelightName="")
void SetRobotOrientation(const std::string &limelightName, double yaw, double yawRate, double pitch, double pitchRate, double roll, double rollRate)
PoseEstimate getBotPoseEstimate_wpiBlue_MegaTag2(const std::string &limelightName="")
double getTX(const std::string &limelightName="")
void setLimelightNTDoubleArray(const std::string &tableName, const std::string &entryName, const std::span< const double > &vals)
std::vector< double > getLimelightNTDoubleArray(const std::string &tableName, const std::string &entryName)
PoseEstimate getBotPoseEstimate_wpiBlue(const std::string &limelightName="")
std::shared_ptr< nt::NetworkTable > getLimelightNTTable(const std::string &tableName)
double getLimelightNTDouble(const std::string &tableName, const std::string &entryName)
std::vector< double > getBotpose(const std::string &limelightName="")
frc::Pose2d toPose2D(const std::vector< double > &inData)
const double INVALID_TARGET
void setStreamMode_PiPMain(const std::string &limelightName="")
void setLimelightNTDouble(const std::string &tableName, const std::string entryName, double val)
void setPythonScriptData(const std::string &limelightName, const std::vector< double > &outgoingPythonData)
double getFiducialID(const std::string &limelightName="")
void from_json(const wpi::json &j, RetroreflectiveResultClass &t)
void setCameraPose_RobotSpace(const std::string &limelightName, double forward, double side, double up, double roll, double pitch, double yaw)
void setLEDMode_ForceOn(const std::string &limelightName="")
std::vector< double > getTargetPose_RobotSpace(const std::string &limelightName="")
PoseEstimate getBotPoseEstimate_wpiRed_MegaTag2(const std::string &limelightName="")
double getLatency_Capture(const std::string &limelightName="")
std::string getLimelightNTString(const std::string &tableName, const std::string &entryName)
void setStreamMode_Standard(const std::string &limelightName="")
std::string sanitizeName(const std::string &name)
void setStreamMode_PiPSecondary(const std::string &limelightName="")
std::string getNeuralClassID(const std::string &limelightName="")
std::vector< double > getPythonScriptData(const std::string &limelightName="")
frc::Pose3d toPose3D(const std::vector< double > &inData)
void setLEDMode_PipelineControl(const std::string &limelightName="")
std::vector< double > getBotpose_TargetSpace(const std::string &limelightName="")
double getTV(const std::string &limelightName="")
void SetFiducialIDFiltersOverride(const std::string &limelightName, const std::vector< int > &validIDs)
std::vector< double > getTargetPose_CameraSpace(const std::string &limelightName="")
void setCropWindow(const std::string &limelightName, double cropXMin, double cropXMax, double cropYMin, double cropYMax)
double getTA(const std::string &limelightName="")
void setLEDMode_ForceOff(const std::string &limelightName="")
void setPriorityTagID(const std::string &limelightName, int ID)
std::vector< double > getTargetColor(const std::string &limelightName="")
std::string getJSONDump(const std::string &limelightName="")
double extractBotPoseEntry(const std::vector< double > &inData, int position)