|
Valkyrie 2026
|
Classes | |
| struct | TargetMetrics |
| Targeting metrics of the Limelight. More... | |
| struct | CornerCoordinates |
| Structure representing coordinates of a target. More... | |
| struct | IMUData |
| IMU data of the Limelight. More... | |
| struct | RawTarget |
| Raw target result of the Limelight. More... | |
| struct | RawFiducial |
| Raw fiducial result of the Limelight. More... | |
| struct | RawDetection |
| Raw detection result of the Limelight. More... | |
| struct | PoseEstimate |
| Pose Estimate of the Limelight. More... | |
Public Types | |
| enum class | Model { One , Two , TwoPlus , Three , ThreeA , ThreeG , Four } |
| Model of the physical Limelight. More... | |
| enum class | IMUMode { ExternalOnly = 0 , ExternalSeed = 1 , InternalOnly = 2 , InternalMT1Assist = 3 , InternalExternalAssist = 4 } |
| enum class | LEDMode { PipelineControl = 0 , ForceOff = 1 , ForceBlink = 2 , ForceOn = 3 , ForceOnLeft = 4 , ForceOnRight = 5 , BounceHalves = 6 , ForceBlinkLeft = 7 , ForceBlinkRight = 8 } |
| LED mode of the Limelight. More... | |
| enum class | StreamMode { Standard = 0 , PiPMain = 1 , PiPSecondary = 2 } |
| Limelight streaming mode. More... | |
Public Member Functions | |
| Limelight (std::string_view name) | |
| bool | GetTV () const |
| units::degree_t | GetTX () const |
| units::degree_t | GetTY () const |
| units::degree_t | GetTXNC () const |
| units::degree_t | GetTYNC () const |
| double | GetTA () const |
| TargetMetrics | GetTargetMetrics () const |
| int | GetTargetCount () const |
| int | GetClassifierClassIndex () const |
| int | GetDetectorClassIndex () const |
| std::string | GetClassifierClass () const |
| std::string | GetDetectorClass () const |
| units::millisecond_t | GetLatencyPipeline () const |
| units::millisecond_t | GetLatencyCapture () const |
| int | GetCurrentPipelineIndex () const |
| std::string | GetCurrentPipelineType () const |
| std::string | GetJSONDump () const |
| frc::Pose3d | GetBotPose () const |
| frc::Pose3d | GetBotPoseWpiRed () const |
| frc::Pose3d | GetBotPoseWpiBlue () const |
| frc::Pose3d | GetBotPoseTargetSpace () const |
| frc::Pose3d | GetCameraPoseTargetSpace () const |
| frc::Pose3d | GetCameraPoseRobotSpace () const |
| frc::Pose3d | GetTargetPoseCameraSpace () const |
| frc::Pose3d | GetTargetPoseRobotSpace () const |
| frc::Color | GetTargetColor () const |
| std::optional< int > | GetFiducialID () const |
| std::string | GetNeuralClassID () const |
| std::vector< std::string > | GetRawBarcodeData () const |
| int | GetHeartbeat () const |
| std::vector< CornerCoordinates > | GetCornerCoordinates () const |
| void | SetPipelineIndex (int index) |
| void | SetPriorityTagID (int ID) |
| void | SetLEDMode (LEDMode mode) |
| void | SetStreamMode (StreamMode mode) |
| void | SetCropWindow (double xMin, double xMax, double yMin, double yMax) |
| void | SetRobotOrientation (units::degree_t yaw, units::degrees_per_second_t yawRate, units::degree_t pitch, units::degrees_per_second_t pitchRate, units::degree_t roll, units::degrees_per_second_t rollRate, bool flush=true) |
| void | SetKeystone (double horizontal, double vertical) |
| void | SetIMUMode (IMUMode mode) |
| void | SetIMUAssistAlpha (double alpha) |
| void | SetThrottle (int throttle) |
| void | SetFiducial3DOffset (const frc::Translation3d &offset) |
| void | SetFiducialIDFiltersOverride (std::vector< int > validIDs) |
| void | SetFiducialDownscalingOverride (float downscale) |
| void | SetCameraPoseRobotSpace (const frc::Pose3d &pose) |
| void | SetPythonScriptData (const std::vector< double > &outgoingData) |
| std::vector< double > | GetPythonScriptData () const |
| void | TriggerSnapshot () |
| void | SetRewindEnabled (bool enabled) |
| void | TriggerRewindCapture (units::second_t duration) |
| PoseEstimate | GetBotPoseEstimateWpiBlue (bool mt2) const |
| PoseEstimate | GetBotPoseEstimateWpiRed (bool mt2) const |
| std::vector< RawFiducial > | GetRawFiducials () const |
| std::vector< RawDetection > | GetRawDetections () const |
| std::vector< RawTarget > | GetRawTargets () const |
| IMUData | GetIMUData () const |
| void | SetupPortForwarding () |
| LimelightHelpers::LimelightResultsClass | GetLatestResults (bool profile=false) const |
| void | LoggablePeriodic () override |
| Periodic callback for logging updates. | |
| Public Member Functions inherited from valor::Loggable | |
| Loggable (std::string_view name) | |
| Construct a Loggable that registers a top-level table name. | |
| Loggable (std::shared_ptr< nt::NetworkTable > table) | |
| Construct a Loggable that uses an existing NetworkTable. | |
| Loggable () | |
| Default construct an uninitialized Loggable. | |
| void | LogChild (std::string_view name, Loggable *child) |
| Register a child Loggable under a named subtree. | |
| void | LogChild (std::string_view name, wpi::Sendable *child) |
| Register a child Sendable under a named subtree. | |
| void | SetPeriodicLevel (LogLevel level) |
| Set the logging level for LoggablePeriodic. | |
| template<typename T> | |
| T | WriteLog (std::string_view field, const T &data, LogLevel level=LogLevel::Normal) |
| Publish a value to NetworkTables under the given field. | |
| template<typename T> | |
| T | ReadLog (std::string_view field, const T &defaultValue={}) |
| Read a value from NetworkTables for the given field. | |
| template<> | |
| decltype(Loggable::subscribers) ::iterator | addSubscriber (std::string_view field, const std::vector< bool > &defaultValue) |
| template<> | |
| void | WriteLogImpl (nt::Publisher *pub, const std::vector< bool > &data) |
| template<> | |
| std::vector< bool > | ReadLogImpl (nt::Subscriber *sub) |
Static Public Member Functions | |
| static void | SetupPortForwardingUSB (int usbIndex) |
| static constexpr std::pair< units::degree_t, units::degree_t > | GetFOV (Model model) |
| Static Public Member Functions inherited from valor::Loggable | |
| static units::millisecond_t | GetLoggingTime () |
| static constexpr Loggable & | GetRoot () |
Additional Inherited Members | |
| Protected Member Functions inherited from valor::Loggable | |
| virtual void | OnLoggingStart () |
| Hook invoked when logging is started for this object. | |
|
strong |
IMU mode of the Limelight
This is typically used to determine the strategy for determining the rotation for MT2
|
strong |
LED mode of the Limelight.
|
strong |
|
strong |
Limelight streaming mode.
| Enumerator | |
|---|---|
| Standard | Side-by-side streams if a webcam is attached to the Limelight. |
| PiPMain | The secondary camera stream is placed in the lower-right corner of the primary camera stream. |
| PiPSecondary | The primary camera stream is placed in the lower-right corner of the secondary camera stream. |
|
inlineexplicit |
|
inline |
Gets the robot's 3D pose in field-space.
| PoseEstimate valor::cameras::Limelight::GetBotPoseEstimateWpiBlue | ( | bool | mt2 | ) | const |
Gets the robot pose estimate in WPILib Blue Alliance field-space. This is the recommended method for getting robot pose for vision-based localization.
| mt2 | Whether the estimate should be Megatag2 or Megatag1 |
| PoseEstimate valor::cameras::Limelight::GetBotPoseEstimateWpiRed | ( | bool | mt2 | ) | const |
Gets the robot pose estimate in WPILib Red Alliance field-space.
| mt2 | Whether the estimate should be Megatag2 or Megatag1 |
|
inline |
Gets the robot's 3D pose with respect to the currently tracked target's coordinate system.
|
inline |
(Recommended) Gets the robot's 3D pose in the WPILib Blue Alliance Coordinate System.
|
inline |
(Not Recommended) Gets the robot's 3D pose in the WPILib Red Alliance Coordinate System.
|
inline |
Gets the camera's 3D pose with respect to the robot's coordinate system.
|
inline |
Gets the camera's 3D pose with respect to the currently tracked target's coordinate system.
|
inline |
Gets the current neural classifier result class name.
|
inline |
Gets the classifier class index from the currently running neural classifier pipeline
| std::vector< CornerCoordinates > valor::cameras::Limelight::GetCornerCoordinates | ( | ) | const |
Gets the corner coordinates of detected targets from NetworkTables. Requires "send contours" to be enabled in the Limelight Output tab.
|
inline |
Gets the active pipeline index.
|
inline |
Gets the current pipeline type.
|
inline |
Gets the primary neural detector result class name.
|
inline |
Gets the detector class index from the primary result of the currently running neural detector pipeline.
| std::optional< int > valor::cameras::Limelight::GetFiducialID | ( | ) | const |
Gets the ID of the primary AprilTag in view.
|
inlinestaticconstexpr |
|
inline |
|
inline |
|
inline |
Gets the full JSON results dump.
|
inline |
Gets the capture latency.
|
inline |
Gets the pipeline's processing latency contribution.
| LimelightHelpers::LimelightResultsClass valor::cameras::Limelight::GetLatestResults | ( | bool | profile = false | ) | const |
Gets the latest JSON results and parses them into a LimelightResultsClass object. This provides access to all targeting data including neural network results, AprilTag detections, retroreflective targets, and barcodes.
| profile | If true, prints JSON parsing time to stdout |
|
inline |
Gets the neural network class name for the primary detected object.
|
inline |
Gets data from a Python SnapScript running on the Limelight.
|
inline |
Gets raw barcode data from the barcode scanner pipeline.
| std::vector< RawDetection > valor::cameras::Limelight::GetRawDetections | ( | ) | const |
Gets the latest raw neural detector results from NetworkTables
| std::vector< RawFiducial > valor::cameras::Limelight::GetRawFiducials | ( | ) | const |
Gets the latest raw fiducial/AprilTag detection results from NetworkTables.
| std::vector< RawTarget > valor::cameras::Limelight::GetRawTargets | ( | ) | const |
|
inline |
Gets the target area as a percentage of the image (0-100%).
| frc::Color valor::cameras::Limelight::GetTargetColor | ( | ) | const |
Gets the target color as RGB values.
|
inline |
Gets the number of targets currently detected.
| TargetMetrics valor::cameras::Limelight::GetTargetMetrics | ( | ) | const |
|
inline |
Gets the target's 3D pose with respect to the camera's coordinate system.
|
inline |
Gets the target's 3D pose with respect to the robot's coordinate system.
|
inline |
Does the Limelight have a valid target?
|
inline |
Gets the horizontal offset from the crosshair to the target in degrees.
|
inline |
Gets the horizontal offset from the principal pixel/point to the target in degrees. This is the most accurate 2d metric if you are using a calibrated camera and you don't need adjustable crosshair functionality.
|
inline |
Gets the vertical offset from the crosshair to the target in degrees.
|
inline |
Gets the vertical offset from the principal pixel/point to the target in degrees. This is the most accurate 2d metric if you are using a calibrated camera and you don't need adjustable crosshair functionality.
|
overridevirtual |
Periodic callback for logging updates.
If a derived class needs to perform periodic updates to published values, override this method. It is intended to be called by the logging framework; this base class provides an empty implementation.
Reimplemented from valor::Loggable.
| void valor::cameras::Limelight::SetCameraPoseRobotSpace | ( | const frc::Pose3d & | pose | ) |
Sets the camera pose relative to the robot. The UI camera pose must be set to zeros for this to take effect.
| pose | Pose of the camera relative to the robot |
| void valor::cameras::Limelight::SetCropWindow | ( | double | xMin, |
| double | xMax, | ||
| double | yMin, | ||
| double | yMax ) |
Sets the crop window for the camera. The crop window in the UI must be completely open.
| xMin | Minimum X value (-1 to 1) |
| xMax | Maximum X value (-1 to 1) |
| yMin | Minimum Y value (-1 to 1) |
| yMax | Maximum Y value (-1 to 1) |
| void valor::cameras::Limelight::SetFiducial3DOffset | ( | const frc::Translation3d & | offset | ) |
Sets the 3D point-of-interest offset for the current fiducial pipeline. https://docs.limelightvision.io/docs/docs-limelight/pipeline-apriltag/apriltag-3d#point-of-interest-tracking
| x | X offset in meters |
| y | Y offset in meters |
| z | Z offset in meters |
|
inline |
Sets the downscaling factor for AprilTag detection. Increasing downscale can improve performance at the cost of potentially reduced detection range.
| downscale | Downscale factor. Valid values: 1.0 (no downscale), 1.5, 2.0, 3.0, 4.0. Set to 0 for pipeline control. |
|
inline |
Overrides the valid AprilTag IDs for the current pipeline. Only tags with IDs in this list will be used for localization.
| validIDs | Vector of valid AprilTag IDs to track |
|
inline |
Configures the complementary filter alpha value for IMU Assist Modes (Modes 3 and 4)
| alpha | Defaults to .001. Higher values will cause the internal IMU to converge onto the assist source more rapidly. |
|
inline |
|
inline |
Sets the keystone modification for the crop window.
| horizontal | Horizontal keystone value (-0.95 to 0.95) |
| vertical | Vertical keystone value (-0.95 to 0.95) |
| void valor::cameras::Limelight::SetLEDMode | ( | LEDMode | mode | ) |
|
inline |
Sets the active pipeline index on the Limelight.
| index | Pipeline index (0-9) |
|
inline |
Sets the priority AprilTag ID for the Limelight to track.
| ID | The AprilTag ID to prioritize |
|
inline |
Sends data to a Python SnapScript running on the Limelight.
| outgoingData | Vector of doubles to send to the Python script |
|
inline |
Enables or pauses the rewind buffer recording.
| enabled | True to enable recording, false to pause |
| void valor::cameras::Limelight::SetRobotOrientation | ( | units::degree_t | yaw, |
| units::degrees_per_second_t | yawRate, | ||
| units::degree_t | pitch, | ||
| units::degrees_per_second_t | pitchRate, | ||
| units::degree_t | roll, | ||
| units::degrees_per_second_t | rollRate, | ||
| bool | flush = true ) |
Sets the robot orientation for MegaTag2 localization. This should be called every frame with your robot's current orientation from a gyro.
| void valor::cameras::Limelight::SetStreamMode | ( | StreamMode | mode | ) |
Sets the stream mode to standard (side-by-side).
|
inline |
Configures the throttle value. Set to 100-200 while disabled to reduce temp.
| throttle | Defaults to 0. Your Limelight will process one frame after skipping <throttle> frames. |
|
inline |
|
inlinestatic |
Sets up port forwarding for a Limelight 3A/3G connected via USB. This allows access to the Limelight web interface and video stream when connected to the robot over USB.
For usbIndex 0: ports 5800-5809 forward to 172.29.0.1 For usbIndex 1: ports 5810-5819 forward to 172.29.1.1 etc.
Call this method once during robot initialization. To access the interface of the camera with usbIndex0, you would go to roboRIO-(teamnum)-FRC.local:5801. Port 5811 for usb index 1
| usbIndex | The USB index of the Limelight (0, 1, 2, etc.) |
|
inline |
Triggers a rewind capture with the specified duration. Maximum duration is 165 seconds. Rate-limited on the Limelight.
| durationSeconds | Duration of rewind capture in seconds (max 165) |
|
inline |
Triggers a snapshot capture via NetworkTables by incrementing the snapshot counter. Rate-limited to once per 10 frames on the Limelight.