2015-11-06 12:05:40 -08:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2018-01-02 09:20:21 -08:00
|
|
|
/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
|
2015-11-06 12:05:40 -08:00
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
2016-01-02 03:02:34 -08:00
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
2015-11-06 12:05:40 -08:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2016-01-02 03:02:34 -08:00
|
|
|
|
2015-11-06 12:05:40 -08:00
|
|
|
#pragma once
|
|
|
|
|
|
2018-05-23 20:22:30 -07:00
|
|
|
#include "ErrorBase.h"
|
2015-11-06 12:05:40 -08:00
|
|
|
#include "PIDSource.h"
|
2018-05-23 20:22:30 -07:00
|
|
|
#include "SmartDashboard/SendableBase.h"
|
2015-11-06 12:05:40 -08:00
|
|
|
#include "interfaces/Gyro.h"
|
|
|
|
|
|
2016-11-01 22:33:12 -07:00
|
|
|
namespace frc {
|
|
|
|
|
|
2015-11-06 12:05:40 -08:00
|
|
|
/**
|
|
|
|
|
* GyroBase is the common base class for Gyro implementations such as
|
|
|
|
|
* AnalogGyro.
|
|
|
|
|
*/
|
2018-05-23 20:22:30 -07:00
|
|
|
class GyroBase : public Gyro,
|
|
|
|
|
public ErrorBase,
|
|
|
|
|
public SendableBase,
|
|
|
|
|
public PIDSource {
|
2015-11-06 12:05:40 -08:00
|
|
|
public:
|
|
|
|
|
// PIDSource interface
|
2018-05-31 20:47:15 -07:00
|
|
|
/**
|
|
|
|
|
* Get the PIDOutput for the PIDSource base object. Can be set to return
|
|
|
|
|
* angle or rate using SetPIDSourceType(). Defaults to angle.
|
|
|
|
|
*
|
|
|
|
|
* @return The PIDOutput (angle or rate, defaults to angle)
|
|
|
|
|
*/
|
2015-11-06 12:05:40 -08:00
|
|
|
double PIDGet() override;
|
|
|
|
|
|
2017-12-04 23:28:33 -08:00
|
|
|
void InitSendable(SendableBuilder& builder) override;
|
2015-11-06 12:05:40 -08:00
|
|
|
};
|
2016-11-01 22:33:12 -07:00
|
|
|
|
|
|
|
|
} // namespace frc
|