Implementing custom Sendable for subsystem

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)

Would setting a different data type with builder.setSmartDashboardType work?
If so, is there a list of data type names for Smart Dashboard?

Most of the built-in widgets are in this directory. The names for them are in the @Description annotation.

IIRC there should also be a right click menu on the title of the widget that lets you switch it to tree view?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.