14 #include "SpeedController.h" 15 #include "networktables/NetworkTableEntry.h" 28 explicit Servo(
int channel);
30 void Set(
double value);
35 static double GetMaxAngle() {
return kMaxServoAngle; }
36 static double GetMinAngle() {
return kMinServoAngle; }
42 void InitTable(std::shared_ptr<nt::NetworkTable> subTable)
override;
46 NT_EntryListener m_valueListener = 0;
49 double GetServoAngleRange()
const {
return kMaxServoAngle - kMinServoAngle; }
51 static constexpr
double kMaxServoAngle = 180.0;
52 static constexpr
double kMinServoAngle = 0.0;
54 static constexpr
double kDefaultMaxServoPWM = 2.4;
55 static constexpr
double kDefaultMinServoPWM = .6;
Standard hobby style servo.
Definition: Servo.h:26
double GetAngle() const
Get the servo angle.
Definition: Servo.cpp:99
void UpdateTable() override
Update the table for this sendable object with the latest values.
Definition: Servo.cpp:103
std::string GetSmartDashboardType() const override
Definition: Servo.cpp:125
void InitTable(std::shared_ptr< nt::NetworkTable > subTable) override
Initializes a table for this sendable object.
Definition: Servo.cpp:127
double Get() const
Get the servo position.
Definition: Servo.cpp:65
void SetAngle(double angle)
Set the servo angle.
Definition: Servo.cpp:81
void Set(double value)
Set the servo position.
Definition: Servo.cpp:48
void StopLiveWindowMode() override
Stop having this sendable object automatically respond to value changes.
Definition: Servo.cpp:118
void StartLiveWindowMode() override
Start having this sendable object automatically respond to value changes reflect the value on the tab...
Definition: Servo.cpp:107
A safe version of the PWM class.
Definition: SafePWM.h:27
NetworkTables Entry.
Definition: NetworkTableEntry.h:30
void SetOffline()
Set the servo to offline.
Definition: Servo.cpp:55
Servo(int channel)
Definition: Servo.cpp:26