SubZero Common
Common library components for an FRC CommandRobot
Loading...
Searching...
No Matches
LimelightHelpers Namespace Reference

Namespaces

namespace  internal
 

Classes

class  ClassificationResultClass
 
class  DetectionResultClass
 
class  FiducialResultClass
 
class  LimelightResultsClass
 
class  PoseEstimate
 
class  RawFiducial
 
class  RetroreflectiveResultClass
 
class  SingleTargetingResultClass
 
class  VisionResultsClass
 

Functions

std::string sanitizeName (const std::string &name)
 
frc::Pose3d toPose3D (const std::vector< double > &inData)
 
frc::Pose2d toPose2D (const std::vector< double > &inData)
 
std::shared_ptr< nt::NetworkTable > getLimelightNTTable (const std::string &tableName)
 
nt::NetworkTableEntry getLimelightNTTableEntry (const std::string &tableName, const std::string &entryName)
 
double getLimelightNTDouble (const std::string &tableName, const std::string &entryName)
 
std::vector< double > getLimelightNTDoubleArray (const std::string &tableName, const std::string &entryName)
 
std::string getLimelightNTString (const std::string &tableName, const std::string &entryName)
 
void setLimelightNTDouble (const std::string &tableName, const std::string entryName, double val)
 
void setLimelightNTDoubleArray (const std::string &tableName, const std::string &entryName, const std::span< const double > &vals)
 
double getTX (const std::string &limelightName="")
 
double getTV (const std::string &limelightName="")
 
double getTY (const std::string &limelightName="")
 
double getTA (const std::string &limelightName="")
 
double getLatency_Pipeline (const std::string &limelightName="")
 
double getLatency_Capture (const std::string &limelightName="")
 
std::string getJSONDump (const std::string &limelightName="")
 
std::vector< double > getBotpose (const std::string &limelightName="")
 
std::vector< double > getBotpose_wpiRed (const std::string &limelightName="")
 
std::vector< double > getBotpose_wpiBlue (const std::string &limelightName="")
 
std::vector< double > getBotpose_TargetSpace (const std::string &limelightName="")
 
std::vector< double > getCameraPose_TargetSpace (const std::string &limelightName="")
 
std::vector< double > getCameraPose_RobotSpace (const std::string &limelightName="")
 
std::vector< double > getTargetPose_CameraSpace (const std::string &limelightName="")
 
std::vector< double > getTargetPose_RobotSpace (const std::string &limelightName="")
 
std::vector< double > getTargetColor (const std::string &limelightName="")
 
double getFiducialID (const std::string &limelightName="")
 
std::string getNeuralClassID (const std::string &limelightName="")
 
void setPipelineIndex (const std::string &limelightName, int index)
 
void setPriorityTagID (const std::string &limelightName, int ID)
 
void setLEDMode_PipelineControl (const std::string &limelightName="")
 
void setLEDMode_ForceOff (const std::string &limelightName="")
 
void setLEDMode_ForceBlink (const std::string &limelightName="")
 
void setLEDMode_ForceOn (const std::string &limelightName="")
 
void setStreamMode_Standard (const std::string &limelightName="")
 
void setStreamMode_PiPMain (const std::string &limelightName="")
 
void setStreamMode_PiPSecondary (const std::string &limelightName="")
 
void setCropWindow (const std::string &limelightName, double cropXMin, double cropXMax, double cropYMin, double cropYMax)
 
void SetRobotOrientation (const std::string &limelightName, double yaw, double yawRate, double pitch, double pitchRate, double roll, double rollRate)
 
void SetFiducialIDFiltersOverride (const std::string &limelightName, const std::vector< int > &validIDs)
 
void setCameraPose_RobotSpace (const std::string &limelightName, double forward, double side, double up, double roll, double pitch, double yaw)
 
void setPythonScriptData (const std::string &limelightName, const std::vector< double > &outgoingPythonData)
 
std::vector< double > getPythonScriptData (const std::string &limelightName="")
 
double extractBotPoseEntry (const std::vector< double > &inData, int position)
 
PoseEstimate getBotPoseEstimate (const std::string &limelightName, const std::string &entryName)
 
PoseEstimate getBotPoseEstimate_wpiBlue (const std::string &limelightName="")
 
PoseEstimate getBotPoseEstimate_wpiRed (const std::string &limelightName="")
 
PoseEstimate getBotPoseEstimate_wpiBlue_MegaTag2 (const std::string &limelightName="")
 
PoseEstimate getBotPoseEstimate_wpiRed_MegaTag2 (const std::string &limelightName="")
 
void SetupPortForwarding (const std::string &limelightName)
 
template<typename T , typename KeyType >
SafeJSONAccess (const wpi::json &jsonData, const KeyType &key, const T &defaultValue)
 
void from_json (const wpi::json &j, RetroreflectiveResultClass &t)
 
void from_json (const wpi::json &j, FiducialResultClass &t)
 
void from_json (const wpi::json &j, DetectionResultClass &t)
 
void from_json (const wpi::json &j, ClassificationResultClass &t)
 
void from_json (const wpi::json &j, VisionResultsClass &t)
 
void from_json (const wpi::json &j, LimelightResultsClass &t)
 
LimelightResultsClass getLatestResults (const std::string &limelightName="", bool profile=false)
 
std::optional< std::vector< double > > getCurrentCorners (const std::string &limelightName="")
 

Variables

const double INVALID_TARGET = 0.0
 

Function Documentation

◆ extractBotPoseEntry()

double LimelightHelpers::extractBotPoseEntry ( const std::vector< double > & inData,
int position )
inline

Definition at line 289 of file LimelightHelpers.h.

◆ from_json() [1/6]

void LimelightHelpers::from_json ( const wpi::json & j,
ClassificationResultClass & t )
inline

Definition at line 648 of file LimelightHelpers.h.

◆ from_json() [2/6]

void LimelightHelpers::from_json ( const wpi::json & j,
DetectionResultClass & t )
inline

Definition at line 630 of file LimelightHelpers.h.

◆ from_json() [3/6]

void LimelightHelpers::from_json ( const wpi::json & j,
FiducialResultClass & t )
inline

Definition at line 599 of file LimelightHelpers.h.

◆ from_json() [4/6]

void LimelightHelpers::from_json ( const wpi::json & j,
LimelightResultsClass & t )
inline

Definition at line 695 of file LimelightHelpers.h.

◆ from_json() [5/6]

void LimelightHelpers::from_json ( const wpi::json & j,
RetroreflectiveResultClass & t )
inline

Definition at line 569 of file LimelightHelpers.h.

◆ from_json() [6/6]

void LimelightHelpers::from_json ( const wpi::json & j,
VisionResultsClass & t )
inline

Definition at line 666 of file LimelightHelpers.h.

◆ getBotpose()

std::vector< double > LimelightHelpers::getBotpose ( const std::string & limelightName = "")
inline

Definition at line 136 of file LimelightHelpers.h.

◆ getBotpose_TargetSpace()

std::vector< double > LimelightHelpers::getBotpose_TargetSpace ( const std::string & limelightName = "")
inline

Definition at line 151 of file LimelightHelpers.h.

◆ getBotpose_wpiBlue()

std::vector< double > LimelightHelpers::getBotpose_wpiBlue ( const std::string & limelightName = "")
inline

Definition at line 146 of file LimelightHelpers.h.

◆ getBotpose_wpiRed()

std::vector< double > LimelightHelpers::getBotpose_wpiRed ( const std::string & limelightName = "")
inline

Definition at line 141 of file LimelightHelpers.h.

◆ getBotPoseEstimate()

PoseEstimate LimelightHelpers::getBotPoseEstimate ( const std::string & limelightName,
const std::string & entryName )
inline

Definition at line 334 of file LimelightHelpers.h.

◆ getBotPoseEstimate_wpiBlue()

PoseEstimate LimelightHelpers::getBotPoseEstimate_wpiBlue ( const std::string & limelightName = "")
inline

Definition at line 375 of file LimelightHelpers.h.

◆ getBotPoseEstimate_wpiBlue_MegaTag2()

PoseEstimate LimelightHelpers::getBotPoseEstimate_wpiBlue_MegaTag2 ( const std::string & limelightName = "")
inline

Definition at line 385 of file LimelightHelpers.h.

◆ getBotPoseEstimate_wpiRed()

PoseEstimate LimelightHelpers::getBotPoseEstimate_wpiRed ( const std::string & limelightName = "")
inline

Definition at line 380 of file LimelightHelpers.h.

◆ getBotPoseEstimate_wpiRed_MegaTag2()

PoseEstimate LimelightHelpers::getBotPoseEstimate_wpiRed_MegaTag2 ( const std::string & limelightName = "")
inline

Definition at line 390 of file LimelightHelpers.h.

◆ getCameraPose_RobotSpace()

std::vector< double > LimelightHelpers::getCameraPose_RobotSpace ( const std::string & limelightName = "")
inline

Definition at line 161 of file LimelightHelpers.h.

◆ getCameraPose_TargetSpace()

std::vector< double > LimelightHelpers::getCameraPose_TargetSpace ( const std::string & limelightName = "")
inline

Definition at line 156 of file LimelightHelpers.h.

◆ getCurrentCorners()

std::optional< std::vector< double > > LimelightHelpers::getCurrentCorners ( const std::string & limelightName = "")
inline

Definition at line 729 of file LimelightHelpers.h.

◆ getFiducialID()

double LimelightHelpers::getFiducialID ( const std::string & limelightName = "")
inline

Definition at line 180 of file LimelightHelpers.h.

◆ getJSONDump()

std::string LimelightHelpers::getJSONDump ( const std::string & limelightName = "")
inline

Definition at line 132 of file LimelightHelpers.h.

◆ getLatency_Capture()

double LimelightHelpers::getLatency_Capture ( const std::string & limelightName = "")
inline

Definition at line 128 of file LimelightHelpers.h.

◆ getLatency_Pipeline()

double LimelightHelpers::getLatency_Pipeline ( const std::string & limelightName = "")
inline

Definition at line 124 of file LimelightHelpers.h.

◆ getLatestResults()

LimelightResultsClass LimelightHelpers::getLatestResults ( const std::string & limelightName = "",
bool profile = false )
inline

Definition at line 701 of file LimelightHelpers.h.

◆ getLimelightNTDouble()

double LimelightHelpers::getLimelightNTDouble ( const std::string & tableName,
const std::string & entryName )
inline

Definition at line 80 of file LimelightHelpers.h.

◆ getLimelightNTDoubleArray()

std::vector< double > LimelightHelpers::getLimelightNTDoubleArray ( const std::string & tableName,
const std::string & entryName )
inline

Definition at line 86 of file LimelightHelpers.h.

◆ getLimelightNTString()

std::string LimelightHelpers::getLimelightNTString ( const std::string & tableName,
const std::string & entryName )
inline

Definition at line 92 of file LimelightHelpers.h.

◆ getLimelightNTTable()

std::shared_ptr< nt::NetworkTable > LimelightHelpers::getLimelightNTTable ( const std::string & tableName)
inline

Definition at line 69 of file LimelightHelpers.h.

◆ getLimelightNTTableEntry()

nt::NetworkTableEntry LimelightHelpers::getLimelightNTTableEntry ( const std::string & tableName,
const std::string & entryName )
inline

Definition at line 75 of file LimelightHelpers.h.

◆ getNeuralClassID()

std::string LimelightHelpers::getNeuralClassID ( const std::string & limelightName = "")
inline

Definition at line 184 of file LimelightHelpers.h.

◆ getPythonScriptData()

std::vector< double > LimelightHelpers::getPythonScriptData ( const std::string & limelightName = "")
inline

Definition at line 277 of file LimelightHelpers.h.

◆ getTA()

double LimelightHelpers::getTA ( const std::string & limelightName = "")
inline

Definition at line 120 of file LimelightHelpers.h.

◆ getTargetColor()

std::vector< double > LimelightHelpers::getTargetColor ( const std::string & limelightName = "")
inline

Definition at line 176 of file LimelightHelpers.h.

◆ getTargetPose_CameraSpace()

std::vector< double > LimelightHelpers::getTargetPose_CameraSpace ( const std::string & limelightName = "")
inline

Definition at line 166 of file LimelightHelpers.h.

◆ getTargetPose_RobotSpace()

std::vector< double > LimelightHelpers::getTargetPose_RobotSpace ( const std::string & limelightName = "")
inline

Definition at line 171 of file LimelightHelpers.h.

◆ getTV()

double LimelightHelpers::getTV ( const std::string & limelightName = "")
inline

Definition at line 112 of file LimelightHelpers.h.

◆ getTX()

double LimelightHelpers::getTX ( const std::string & limelightName = "")
inline

Definition at line 108 of file LimelightHelpers.h.

◆ getTY()

double LimelightHelpers::getTY ( const std::string & limelightName = "")
inline

Definition at line 116 of file LimelightHelpers.h.

◆ SafeJSONAccess()

template<typename T , typename KeyType >
T LimelightHelpers::SafeJSONAccess ( const wpi::json & jsonData,
const KeyType & key,
const T & defaultValue )

Definition at line 559 of file LimelightHelpers.h.

◆ sanitizeName()

std::string LimelightHelpers::sanitizeName ( const std::string & name)
inline

Definition at line 38 of file LimelightHelpers.h.

◆ setCameraPose_RobotSpace()

void LimelightHelpers::setCameraPose_RobotSpace ( const std::string & limelightName,
double forward,
double side,
double up,
double roll,
double pitch,
double yaw )
inline

Sets the camera pose in robotspace. The UI camera pose must be set to zeros

Definition at line 261 of file LimelightHelpers.h.

◆ setCropWindow()

void LimelightHelpers::setCropWindow ( const std::string & limelightName,
double cropXMin,
double cropXMax,
double cropYMin,
double cropYMax )
inline

Sets the crop window. The crop window in the UI must be completely open for dynamic cropping to work.

Definition at line 231 of file LimelightHelpers.h.

◆ SetFiducialIDFiltersOverride()

void LimelightHelpers::SetFiducialIDFiltersOverride ( const std::string & limelightName,
const std::vector< int > & validIDs )
inline

Definition at line 248 of file LimelightHelpers.h.

◆ setLEDMode_ForceBlink()

void LimelightHelpers::setLEDMode_ForceBlink ( const std::string & limelightName = "")
inline

Definition at line 207 of file LimelightHelpers.h.

◆ setLEDMode_ForceOff()

void LimelightHelpers::setLEDMode_ForceOff ( const std::string & limelightName = "")
inline

Definition at line 203 of file LimelightHelpers.h.

◆ setLEDMode_ForceOn()

void LimelightHelpers::setLEDMode_ForceOn ( const std::string & limelightName = "")
inline

Definition at line 211 of file LimelightHelpers.h.

◆ setLEDMode_PipelineControl()

void LimelightHelpers::setLEDMode_PipelineControl ( const std::string & limelightName = "")
inline

Definition at line 199 of file LimelightHelpers.h.

◆ setLimelightNTDouble()

void LimelightHelpers::setLimelightNTDouble ( const std::string & tableName,
const std::string entryName,
double val )
inline

Definition at line 97 of file LimelightHelpers.h.

◆ setLimelightNTDoubleArray()

void LimelightHelpers::setLimelightNTDoubleArray ( const std::string & tableName,
const std::string & entryName,
const std::span< const double > & vals )
inline

Definition at line 102 of file LimelightHelpers.h.

◆ setPipelineIndex()

void LimelightHelpers::setPipelineIndex ( const std::string & limelightName,
int index )
inline

Definition at line 191 of file LimelightHelpers.h.

◆ setPriorityTagID()

void LimelightHelpers::setPriorityTagID ( const std::string & limelightName,
int ID )
inline

Definition at line 195 of file LimelightHelpers.h.

◆ setPythonScriptData()

void LimelightHelpers::setPythonScriptData ( const std::string & limelightName,
const std::vector< double > & outgoingPythonData )
inline

Definition at line 269 of file LimelightHelpers.h.

◆ SetRobotOrientation()

void LimelightHelpers::SetRobotOrientation ( const std::string & limelightName,
double yaw,
double yawRate,
double pitch,
double pitchRate,
double roll,
double rollRate )
inline

Sets the robot orientation for mt2.

Definition at line 240 of file LimelightHelpers.h.

◆ setStreamMode_PiPMain()

void LimelightHelpers::setStreamMode_PiPMain ( const std::string & limelightName = "")
inline

Definition at line 219 of file LimelightHelpers.h.

◆ setStreamMode_PiPSecondary()

void LimelightHelpers::setStreamMode_PiPSecondary ( const std::string & limelightName = "")
inline

Definition at line 223 of file LimelightHelpers.h.

◆ setStreamMode_Standard()

void LimelightHelpers::setStreamMode_Standard ( const std::string & limelightName = "")
inline

Definition at line 215 of file LimelightHelpers.h.

◆ SetupPortForwarding()

void LimelightHelpers::SetupPortForwarding ( const std::string & limelightName)
inline

Definition at line 544 of file LimelightHelpers.h.

◆ toPose2D()

frc::Pose2d LimelightHelpers::toPose2D ( const std::vector< double > & inData)
inline

Definition at line 58 of file LimelightHelpers.h.

◆ toPose3D()

frc::Pose3d LimelightHelpers::toPose3D ( const std::vector< double > & inData)
inline

Definition at line 45 of file LimelightHelpers.h.

Variable Documentation

◆ INVALID_TARGET

const double LimelightHelpers::INVALID_TARGET = 0.0
inline

Definition at line 394 of file LimelightHelpers.h.