11 #include "SpeedController.h"
24 explicit Servo(uint32_t channel);
26 void Set(
float value);
31 static float GetMaxAngle() {
return kMaxServoAngle; }
32 static float GetMinAngle() {
return kMinServoAngle; }
35 std::shared_ptr<nt::Value> value,
bool isNew)
override;
40 void InitTable(std::shared_ptr<ITable> subTable)
override;
41 std::shared_ptr<ITable>
GetTable()
const override;
43 std::shared_ptr<ITable> m_table;
46 float GetServoAngleRange()
const {
return kMaxServoAngle - kMinServoAngle; }
48 static constexpr
float kMaxServoAngle = 180.0;
49 static constexpr
float kMinServoAngle = 0.0;
51 static constexpr
float kDefaultMaxServoPWM = 2.4;
52 static constexpr
float kDefaultMinServoPWM = .6;
void SetOffline()
Set the servo to offline.
Definition: Servo.cpp:53
A table whose values can be read and written to.
Definition: ITable.h:43
void InitTable(std::shared_ptr< ITable > subTable) override
Initializes a table for this sendable object.
Definition: Servo.cpp:127
void StartLiveWindowMode() override
Start having this sendable object automatically respond to value changes reflect the value on the tab...
Definition: Servo.cpp:113
A safe version of the PWM class.
Definition: SafePWM.h:25
void UpdateTable() override
Update the table for this sendable object with the latest values.
Definition: Servo.cpp:107
float Get() const
Get the servo position.
Definition: Servo.cpp:63
float GetAngle() const
Get the servo angle.
Definition: Servo.cpp:97
Servo(uint32_t channel)
Definition: Servo.cpp:22
void SetAngle(float angle)
Set the servo angle.
Definition: Servo.cpp:80
void Set(float value)
Set the servo position.
Definition: Servo.cpp:46
std::shared_ptr< ITable > GetTable() const override
Definition: Servo.cpp:132
std::string GetSmartDashboardType() const override
Definition: Servo.cpp:125
void StopLiveWindowMode() override
Stop having this sendable object automatically respond to value changes.
Definition: Servo.cpp:119
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:39
void ValueChanged(ITable *source, llvm::StringRef key, std::shared_ptr< nt::Value > value, bool isNew) override
Called when a key-value pair is changed in a ITable.
Definition: Servo.cpp:101
Standard hobby style servo.
Definition: Servo.h:22