WPILibC++  unspecified
GyroBase.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2008-2017 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #include <memory>
11 #include <string>
12 
13 #include "LiveWindow/LiveWindowSendable.h"
14 #include "PIDSource.h"
15 #include "SensorBase.h"
16 #include "interfaces/Gyro.h"
17 #include "networktables/NetworkTableEntry.h"
18 
19 namespace frc {
20 
25 class GyroBase : public Gyro,
26  public SensorBase,
27  public PIDSource,
28  public LiveWindowSendable {
29  public:
30  virtual ~GyroBase() = default;
31 
32  // PIDSource interface
33  double PIDGet() override;
34 
35  void UpdateTable() override;
36  void StartLiveWindowMode() override;
37  void StopLiveWindowMode() override;
38  std::string GetSmartDashboardType() const override;
39  void InitTable(std::shared_ptr<nt::NetworkTable> subTable) override;
40 
41  private:
42  nt::NetworkTableEntry m_valueEntry;
43 };
44 
45 } // namespace frc
Definition: Timer.cpp:18
Live Window Sendable is a special type of object sendable to the live window.
Definition: LiveWindowSendable.h:17
Base class for all sensors.
Definition: SensorBase.h:20
void StartLiveWindowMode() override
Start having this sendable object automatically respond to value changes reflect the value on the tab...
Definition: GyroBase.cpp:36
PIDSource interface is a generic sensor source for the PID class.
Definition: PIDSource.h:19
void StopLiveWindowMode() override
Stop having this sendable object automatically respond to value changes.
Definition: GyroBase.cpp:38
GyroBase is the common base class for Gyro implementations such as AnalogGyro.
Definition: GyroBase.h:25
void UpdateTable() override
Update the table for this sendable object with the latest values.
Definition: GyroBase.cpp:32
Interface for yaw rate gyros.
Definition: Gyro.h:15
NetworkTables Entry.
Definition: NetworkTableEntry.h:30
double PIDGet() override
Get the PIDOutput for the PIDSource base object.
Definition: GyroBase.cpp:21
void InitTable(std::shared_ptr< nt::NetworkTable > subTable) override
Initializes a table for this sendable object.
Definition: GyroBase.cpp:42
std::string GetSmartDashboardType() const override
Definition: GyroBase.cpp:40