WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
GyroBase.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2008-2017. 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 
18 namespace frc {
19 
24 class GyroBase : public Gyro,
25  public SensorBase,
26  public PIDSource,
27  public LiveWindowSendable {
28  public:
29  virtual ~GyroBase() = default;
30 
31  // PIDSource interface
32  double PIDGet() override;
33 
34  void UpdateTable() override;
35  void StartLiveWindowMode() override;
36  void StopLiveWindowMode() override;
37  std::string GetSmartDashboardType() const override;
38  void InitTable(std::shared_ptr<ITable> subTable) override;
39  std::shared_ptr<ITable> GetTable() const override;
40 
41  private:
42  std::shared_ptr<ITable> m_table;
43 };
44 
45 } // namespace frc
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:22
void StartLiveWindowMode() override
Start having this sendable object automatically respond to value changes reflect the value on the tab...
Definition: GyroBase.cpp:38
void InitTable(std::shared_ptr< ITable > subTable) override
Initializes a table for this sendable object.
Definition: GyroBase.cpp:44
PIDSource interface is a generic sensor source for the PID class.
Definition: PIDSource.h:19
std::shared_ptr< ITable > GetTable() const override
Definition: GyroBase.cpp:49
void StopLiveWindowMode() override
Stop having this sendable object automatically respond to value changes.
Definition: GyroBase.cpp:40
GyroBase is the common base class for Gyro implementations such as AnalogGyro.
Definition: GyroBase.h:24
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
double PIDGet() override
Get the PIDOutput for the PIDSource base object.
Definition: GyroBase.cpp:21
std::string GetSmartDashboardType() const override
Definition: GyroBase.cpp:42