SubZero Common
Common library components for an FRC CommandRobot
Loading...
Searching...
No Matches
IPidMotorController.h
Go to the documentation of this file.
1#pragma once
2
3#include <units/angle.h>
4#include <units/angular_velocity.h>
5#include <units/voltage.h>
6
7#include <string>
8
9namespace subzero {
11 double p, i, d, iZone, ff;
12};
13
15public:
16 explicit IPidMotorController(std::string name) : m_name{name} {}
17
18 virtual void Set(double percentage) = 0;
19 virtual void Set(units::volt_t volts) = 0;
20 virtual void SetPidTolerance(double tolerance) = 0;
21 virtual void Update(void) = 0;
22 virtual void RunWithVelocity(units::revolutions_per_minute_t rpm) = 0;
23 virtual void RunWithVelocity(double percentage) = 0;
24 virtual void RunToPosition(double position) = 0;
25 virtual void ResetEncoder(void) = 0;
26 virtual double GetEncoderPosition(void) = 0;
27 virtual std::optional<double> GetAbsoluteEncoderPosition(void) = 0;
28 virtual void SetEncoderConversionFactor(double factor) = 0;
29 virtual void SetAbsoluteEncoderConversionFactor(double factor) = 0;
30 virtual void Stop(void) = 0;
31 virtual const PidSettings &GetPidSettings(void) = 0;
32 virtual void UpdatePidSettings(PidSettings settings) = 0;
33
34 const std::string m_name;
35};
36} // namespace subzero
virtual void SetEncoderConversionFactor(double factor)=0
virtual void Set(double percentage)=0
virtual const PidSettings & GetPidSettings(void)=0
virtual void Set(units::volt_t volts)=0
virtual void SetAbsoluteEncoderConversionFactor(double factor)=0
virtual void SetPidTolerance(double tolerance)=0
virtual void RunWithVelocity(units::revolutions_per_minute_t rpm)=0
virtual std::optional< double > GetAbsoluteEncoderPosition(void)=0
virtual void RunWithVelocity(double percentage)=0
virtual void RunToPosition(double position)=0
virtual void ResetEncoder(void)=0
virtual double GetEncoderPosition(void)=0
virtual void UpdatePidSettings(PidSettings settings)=0
virtual void Update(void)=0
virtual void Stop(void)=0