blob: 03b46173624d7aabd4dc7c40f8f2843bc8385cfb [file] [log] [blame]
Brian Silvermanf7f267a2017-02-04 16:16:08 -08001/*----------------------------------------------------------------------------*/
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
18namespace frc {
19
20/**
21 * GyroBase is the common base class for Gyro implementations such as
22 * AnalogGyro.
23 */
24class 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