Definition at line 19 of file VisionSubsystem.h.
VisionSubsystem::VisionSubsystem |
( |
| ) |
|
Definition at line 5 of file VisionSubsystem.cpp.
References m_averageAngle, m_averageDistance, and SetLED().
6 :
m_dashboard (nt::NetworkTableInstance::GetDefault().GetTable(
"SmartDashboard"))
7 ,
m_networktable(nt::NetworkTableInstance::GetDefault().GetTable(
"limelight"))
vector< double > m_averageAngle
shared_ptr< NetworkTable > m_networktable
shared_ptr< NetworkTable > m_dashboard
vector< double > m_averageDistance
void VisionSubsystem::Periodic |
( |
| ) |
|
|
override |
Will be called periodically whenever the CommandScheduler runs.
Definition at line 18 of file VisionSubsystem.cpp.
References Util::DegreesToRadians(), GetAngle(), GetDistance(), VisionConstants::kMaxTargetDistance, VisionConstants::kMinTargetDistance, VisionConstants::kMountingAngle, VisionConstants::kMountingHeight, VisionConstants::kTargetHeight, m_averageAngle, m_averageDistance, m_led, m_networktable, m_tx, m_ty, and m_validTarget.
29 double horizontalAngle =
m_tx;
53 SmartDashboard::PutNumber(
"D_V_Distance", distance);
55 SmartDashboard::PutNumber(
"D_V_Average Distance",
GetDistance());
56 SmartDashboard::PutNumber(
"D_V_Average Angle",
GetAngle());
double GetDistance()
Retrieves the distance calculation from the target via the limelight.
constexpr double kMinTargetDistance
constexpr double kMountingAngle
vector< double > m_averageAngle
constexpr double kMaxTargetDistance
shared_ptr< NetworkTable > m_networktable
static double DegreesToRadians(double theta)
Convert any angle theta in degrees to radians.
constexpr double kTargetHeight
constexpr double kMountingHeight
vector< double > m_averageDistance
bool VisionSubsystem::GetValidTarget |
( |
| ) |
|
Determine valid vision based on returned distance values
- Returns
- Whether or not the Vision Subsystem is giving accurate values
Definition at line 59 of file VisionSubsystem.cpp.
References m_validTarget.
double VisionSubsystem::GetDistance |
( |
| ) |
|
double VisionSubsystem::GetAngle |
( |
| ) |
|
void VisionSubsystem::SetLED |
( |
bool |
on | ) |
|
Turns the limelight LED on or off
- Parameters
-
on | Boolean where true = LED on |
3 forces limelight led on
1 forces limelight led off
Definition at line 75 of file VisionSubsystem.cpp.
References m_led, and m_networktable.
88 }
shared_ptr< NetworkTable > m_networktable
double VisionSubsystem::DegreesToRadians |
( |
double |
degrees | ) |
|
|
protected |
Converts degrees to radians
- Parameters
-
degrees | Degrees to convert |
shared_ptr<NetworkTable> VisionSubsystem::m_dashboard |
|
private |
shared_ptr<NetworkTable> VisionSubsystem::m_networktable |
|
private |
bool VisionSubsystem::m_led |
|
private |
double VisionSubsystem::m_tx |
|
private |
double VisionSubsystem::m_ty |
|
private |
bool VisionSubsystem::m_validTarget |
|
private |
vector<double> VisionSubsystem::m_averageDistance |
|
private |
vector<double> VisionSubsystem::m_averageAngle |
|
private |
The documentation for this class was generated from the following files: