Sendable Chooser often fails to appear on Smart Dashboard

We are observing that a number (SmartDashboard.putNumber) and a SendableChooser (SmartDashboard.putData) that we use to configure our autonomous at the beginning of each match often do not appear on the SmartDashboard running on the driverstation computer. We need to use SmartDashboard rather than Shuffleboard for unrelated, but critical to us reasons. If we run Shuffleboard or Glass the chooser and the number appear there and can be configured. Running Glass is our workaround for the moment.
What we have noticed though is that immediately after rebooting both the driverstation laptop and the roborio the problem does not occur. Since rebooting both is our standard way of setting up on the field it has not been a problem so far, but it gives us heart failure every time it happens as we wonder if we’ve only been lucky with the reboot technique.
Any insights would be most appreciated.

What version of SmartDashboard are you using? Since it doesn’t display it in the gui, you can check the manifest in the jar file.

This happened a few times to us and we needed to click File → New in SmartDashboard to get it to show again. This will reset any layout you have set up, though. One theory was that SmartDashboard was rendering the chooser outside of the window, so we switched the chooser to a dropdown instead of the radio button style (by right-clicking on it and changing it while View → Editable is turned on). I don’t remember if this fixed our issues or not.

It’s the latest version from WPILib - 2023.4.3.

I am able to reproduce the behavior with the robot code running in simulation on one machine (Linux) and SmartDashboard running on a Windows 10 22H2 machine – having set the Linux machine’s IP address in the SD preferences. The following actions seem to get the chooser to appear:

  • Delete c:/users/hauser/SmartDashboard/save.xml; if automatically add widgets is chosen in the SD preferences the chooser will appear on the next startup of SD.
  • Delete the section pertaining to the chooser from save.xml. if automatically add widgets is enabled, on next startup the chooser appears.
  • With a save.xml file containing a section for the chooser, logout/login or restart windows. On next startup the chooser appears. (I think without having “automatically add” enabled but I’m not completely sure of that).

I don’t know where the state is that is being cleared by the logout or reboot but it is somehow relevant.

I tried a few tests with SmartDashboard running on Linux and was not able to reproduce the problem there.

I’ve managed to do some more debugging of this. What I’ve found is that if the chooser is in the save.xml file and the DriverStation is running and connected to the robot when SmartDashboard starts up, then the chooser will not appear. If either of those things is not true the chooser will appear.

The problem seems to be that when the DriverStation is running and connected, SmartDashboard acquires the robot address from the DriverStation very early in its startup and then immediately connects and starts processing the NetworkTable that it receives from the robot. If the DriverStation is not running, SmartDashboard gets the address from the save.xml file and doesn’t connect to the robot until it has processed the saved widgets from the file. And in this case it works.

Apparently, there is a race condition between when saved widgets are processed and when the NetworkTable is processed; I have not been able to track down that race.
Meanwhile I’ve submitted a PR for SmartDashboard that disables the “get the address from the DriverStation” feature. This trades off reliable display of the chooser for the inconvenience of needing to set the robot address (or team number) in the SmartDashboard preferences.


We’ve been experiencing the SendableChooser bug since we switched back to SmartDashboard in the 2022 season due to memory issues in ShuffleBoard that were causing problems on our driver station laptop. Thank you for looking into this!