I’m having a bit of trouble implementing Sendable for our subsystems that extend SubsystemBase. I have code similar to this:
public class Foo extends SubsystemBase {
private boolean bar = false;
/* Various constructors and methods */
@Override
public void initSendable(SendableBuilder builder) {
super.initSendable(builder);
builder.addBooleanProperty("Bar", () -> bar, null);
}
}
I expect this to add the Bar property to the dashboard (ShuffleBoard for us), but I just see the default Subsystem display with the current command and such, without the Bar property.
Do I have to add implements Sendable to the class as well, or is it just inherited through SubsystemBase?
The default subsystem widget will display (in Shuffleboard) because the data type that is set by SubsystemBase’s initSendable is subsystem. Shuffleboard sees this and will display this data as the subsystem widget. This widget only shows the command aspects. If you open NT up in an app that shows all entries (like Glass, or the side menu of Shuffleboard) you will likely see the Bar property.
(This is assuming the widget that is currently showing in Shuffleboard is this and not a tree view)