FRC Paradigm Shift #1259
Documentation for the 2021 Robot
VisionSubsystem.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <frc2/command/SubsystemBase.h>
5 
6 #include <frc/smartdashboard/SmartDashboard.h>
7 #include <networktables/NetworkTable.h>
8 #include <networktables/NetworkTableInstance.h>
9 
10 #include <wpi/math>
11 
12 #include "Constants.h"
13 #include "common/Util.h"
14 
15 using namespace std;
16 using namespace frc;
17 using namespace VisionConstants;
18 
19 class VisionSubsystem : public frc2::SubsystemBase
20 {
21 public:
23 
25  void Periodic() override;
26 
29  bool GetValidTarget();
31  double GetDistance();
33  double GetAngle();
36  void SetLED(bool on);
37 
38 protected:
41  double DegreesToRadians(double degrees);
42 
43 private:
44  shared_ptr<NetworkTable> m_dashboard;
45  shared_ptr<NetworkTable> m_networktable;
46  bool m_led;
47 
48  double m_tx;
49  double m_ty;
51  vector<double> m_averageDistance;
52  vector<double> m_averageAngle;
53 };
vector< double > m_averageAngle
STL namespace.
shared_ptr< NetworkTable > m_networktable
shared_ptr< NetworkTable > m_dashboard
vector< double > m_averageDistance