SubZero Common
Common library components for an FRC CommandRobot
Loading...
Searching...
No Matches
subzero::TargetTracker Class Reference

#include <TargetTracker.h>

Classes

struct  TargetTrackerConfig
 

Public Member Functions

 TargetTracker (TargetTrackerConfig config, std::function< frc::Pose2d()> poseGetter, std::function< frc::Field2d *()> fieldGetter)
 
std::vector< DetectedObjectGetTargets ()
 Get a list of all found, valid targets.
 
void UpdateTrackedTargets (const std::vector< DetectedObject > &objects)
 Push targets to SmartDashboard.
 
std::optional< DetectedObjectGetBestTarget (std::vector< DetectedObject > &)
 Get the best target for tracking/intaking.
 
bool HasTargetLock (std::vector< DetectedObject > &)
 Check if a target has been acquired.
 
std::optional< frc::Pose2d > GetTargetPose (const DetectedObject &)
 Get the pose of the given object.
 
std::optional< frc::Pose2d > GetBestTargetPose (std::vector< DetectedObject > &)
 From a list of detected objects, get the pose of the best one.
 
units::inch_t GetDistanceToTarget (const DetectedObject &)
 Get the estimated distance to the target.
 

Detailed Description

Definition at line 95 of file TargetTracker.h.

Constructor & Destructor Documentation

◆ TargetTracker()

subzero::TargetTracker::TargetTracker ( TargetTrackerConfig config,
std::function< frc::Pose2d()> poseGetter,
std::function< frc::Field2d *()> fieldGetter )

Member Function Documentation

◆ GetBestTarget()

std::optional< DetectedObject > subzero::TargetTracker::GetBestTarget ( std::vector< DetectedObject > & )

Get the best target for tracking/intaking.

Returns
std::optional<DetectedObject>

◆ GetBestTargetPose()

std::optional< frc::Pose2d > subzero::TargetTracker::GetBestTargetPose ( std::vector< DetectedObject > & )

From a list of detected objects, get the pose of the best one.

Returns
std::optional<frc::Pose2d>

◆ GetDistanceToTarget()

units::inch_t subzero::TargetTracker::GetDistanceToTarget ( const DetectedObject & )

Get the estimated distance to the target.

Returns
units::inch_t

◆ GetTargetPose()

std::optional< frc::Pose2d > subzero::TargetTracker::GetTargetPose ( const DetectedObject & )

Get the pose of the given object.

Returns
std::optional<frc::Pose2d>

◆ GetTargets()

std::vector< DetectedObject > subzero::TargetTracker::GetTargets ( )

Get a list of all found, valid targets.

Returns
std::vector<DetectedObject>

◆ HasTargetLock()

bool subzero::TargetTracker::HasTargetLock ( std::vector< DetectedObject > & )

Check if a target has been acquired.

Returns
true
false

◆ UpdateTrackedTargets()

void subzero::TargetTracker::UpdateTrackedTargets ( const std::vector< DetectedObject > & objects)

Push targets to SmartDashboard.

Parameters
objects

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