mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Add a way to indicate a Sendable is an actuator (#1226)
SendableBuilder.setActuator() sets the .actuator key in the network table so dashboards can change behavior on the client side if desired, and also sets a local flag (retrievable via isActuator()). Both make drive bases actuators and call setSafeState on them.
This commit is contained in:
@@ -184,6 +184,7 @@ int PWM::GetChannel() const { return m_channel; }
|
||||
|
||||
void PWM::InitSendable(SendableBuilder& builder) {
|
||||
builder.SetSmartDashboardType("PWM");
|
||||
builder.SetActuator(true);
|
||||
builder.SetSafeState([=]() { SetDisabled(); });
|
||||
builder.AddDoubleProperty("Value", [=]() { return GetRaw(); },
|
||||
[=](double value) { SetRaw(value); });
|
||||
|
||||
Reference in New Issue
Block a user