2022-Robot
Robot code for 2022 FRC Season by Argos, FRC team #1756
Loading...
Searching...
No Matches
LimelightTarget Class Reference

Wraps a limelight target in a usable object. More...

#include <shooter_subsystem.h>

Classes

struct  tValues
 Wraps members of LimelightTarget for use elsewhere. More...
 

Public Member Functions

 LimelightTarget ()=default
 
tValues GetTarget ()
 Get the values of the camera's current target. More...
 
bool HasTarget ()
 Does the camera see a target? More...
 
void adjustPerspective (units::degree_t &currentPitch, const units::degree_t &currentYaw)
 Adjusts pitch based on the current yaw to correct the camera perspective. Perspective distortion polynomial determined empirically. More...
 

Private Attributes

units::degree_t m_pitch
 Pitch of target relative to camera -20.5 to 20.5 degrees. More...
 
units::degree_t m_yaw
 Yaw of target relative to camera -27 to 27 degrees. More...
 
double m_bboxHor
 Longest edge of bounding box (horizontal in our case) in px. More...
 
double m_bboxVer
 Shortest edge of bounding box (vertical in our case) in px. More...
 
units::degree_t m_skew
 The skew or rotation -90 to 0 degrees. More...
 
bool m_hasTargets
 True if the camera has a target it can read. More...
 
units::millisecond_t m_pipelineLatency
 Pipeline latency contribution. More...
 

Static Private Attributes

static constexpr units::millisecond_t m_miscLatency {11_ms}
 Any extra latency to account for. More...
 

Detailed Description

Wraps a limelight target in a usable object.

Constructor & Destructor Documentation

◆ LimelightTarget()

LimelightTarget::LimelightTarget ( )
default

Member Function Documentation

◆ adjustPerspective()

void LimelightTarget::adjustPerspective ( units::degree_t &  currentPitch,
const units::degree_t &  currentYaw 
)

Adjusts pitch based on the current yaw to correct the camera perspective. Perspective distortion polynomial determined empirically.

Parameters
[in,out]currentPitchPitch reported by camera; updated according to perspective distortion
[in]currentYawYaw reported by camera

◆ GetTarget()

LimelightTarget::tValues LimelightTarget::GetTarget ( )

Get the values of the camera's current target.

Returns
tValues

◆ HasTarget()

bool LimelightTarget::HasTarget ( )

Does the camera see a target?

Returns
true - The camera does see a target
false - The camera does not see a target

Member Data Documentation

◆ m_bboxHor

double LimelightTarget::m_bboxHor
private

Longest edge of bounding box (horizontal in our case) in px.

◆ m_bboxVer

double LimelightTarget::m_bboxVer
private

Shortest edge of bounding box (vertical in our case) in px.

◆ m_hasTargets

bool LimelightTarget::m_hasTargets
private

True if the camera has a target it can read.

◆ m_miscLatency

constexpr units::millisecond_t LimelightTarget::m_miscLatency {11_ms}
staticconstexprprivate

Any extra latency to account for.

◆ m_pipelineLatency

units::millisecond_t LimelightTarget::m_pipelineLatency
private

Pipeline latency contribution.

◆ m_pitch

units::degree_t LimelightTarget::m_pitch
private

Pitch of target relative to camera -20.5 to 20.5 degrees.

◆ m_skew

units::degree_t LimelightTarget::m_skew
private

The skew or rotation -90 to 0 degrees.

◆ m_yaw

units::degree_t LimelightTarget::m_yaw
private

Yaw of target relative to camera -27 to 27 degrees.


The documentation for this class was generated from the following files: