blob: 82c77d8f57295c892129f8a8ea85d980223a3c89 [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#define DEFAULT_SAFETY_EXPIRATION 0.1
11
12#include <sstream>
13
14class MotorSafety
15{
16public:
17 virtual void SetExpiration(float timeout) = 0;
18 virtual float GetExpiration() const = 0;
19 virtual bool IsAlive() const = 0;
20 virtual void StopMotor() = 0;
21 virtual void SetSafetyEnabled(bool enabled) = 0;
22 virtual bool IsSafetyEnabled() const = 0;
23 virtual void GetDescription(std::ostringstream& desc) const = 0;
24};