blob: 5d93fc4ca863031d649698e859b9f5246a7bc8b6 [file] [log] [blame]
Brian Silverman26e4e522015-12-17 01:56:40 -05001/*----------------------------------------------------------------------------*/
Brian Silverman1a675112016-02-20 20:42:49 -05002/* Copyright (c) FIRST 2008-2016. All Rights Reserved. */
Brian Silverman26e4e522015-12-17 01:56:40 -05003/* Open Source Software - may be modified and shared by FRC teams. The code */
Brian Silverman1a675112016-02-20 20:42:49 -05004/* must be accompanied by the FIRST BSD license file in the root directory of */
5/* the project. */
Brian Silverman26e4e522015-12-17 01:56:40 -05006/*----------------------------------------------------------------------------*/
Brian Silverman1a675112016-02-20 20:42:49 -05007
Brian Silverman26e4e522015-12-17 01:56:40 -05008#pragma once
9
10#include "SensorBase.h"
11#include "PIDSource.h"
12#include "interfaces/Gyro.h"
13#include "LiveWindow/LiveWindowSendable.h"
14
15#include <memory>
16
17/**
18 * GyroBase is the common base class for Gyro implementations such as
19 * AnalogGyro.
20 */
21class GyroBase : public Gyro, public SensorBase, public PIDSource, public LiveWindowSendable {
22 public:
23 virtual ~GyroBase() = default;
24
25 // PIDSource interface
26 double PIDGet() override;
27
28 void UpdateTable() override;
29 void StartLiveWindowMode() override;
30 void StopLiveWindowMode() override;
31 std::string GetSmartDashboardType() const override;
32 void InitTable(std::shared_ptr<ITable> subTable) override;
33 std::shared_ptr<ITable> GetTable() const override;
34
35 private:
36 std::shared_ptr<ITable> m_table;
37};