[commands] SubsystemBase: allow setting name in constructor (#6052)

This commit is contained in:
Eli Barnett
2023-12-16 14:05:53 -05:00
committed by GitHub
parent 0b4c6a1546
commit a004c9e05f
3 changed files with 26 additions and 1 deletions

View File

@@ -17,6 +17,11 @@ SubsystemBase::SubsystemBase() {
CommandScheduler::GetInstance().RegisterSubsystem({this});
}
SubsystemBase::SubsystemBase(std::string_view name) {
wpi::SendableRegistry::AddLW(this, name);
CommandScheduler::GetInstance().RegisterSubsystem({this});
}
void SubsystemBase::InitSendable(wpi::SendableBuilder& builder) {
builder.SetSmartDashboardType("Subsystem");
builder.AddBooleanProperty(