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:
Peter Johnson
2018-07-28 14:04:46 -07:00
committed by GitHub
parent 5fafaf6272
commit 0614913f1a
25 changed files with 78 additions and 0 deletions

View File

@@ -87,6 +87,7 @@ void Solenoid::StartPulse() {
void Solenoid::InitSendable(SendableBuilder& builder) {
builder.SetSmartDashboardType("Solenoid");
builder.SetActuator(true);
builder.SetSafeState([=]() { Set(false); });
builder.AddBooleanProperty("Value", [=]() { return Get(); },
[=](bool value) { Set(value); });