Clear SmartDashboard

I just recently joined a robotics team and I’m working on my first robot. I created a brand new Java project and added some code for my drivebase. I want to display some data on the SmartDashboard, just for testing. However, when I open the SmartDashboard from the FRC Driver Station, it is cluttered with all sorts of useless fields from previous projects that the team has worked on. I want to clear this data so I have a clean dashboard to work with, but I cannot figure out how to do it. This was the only thing I could think of:

  @Override
  public void robotInit() {
    SmartDashboard.getKeys().stream().map(SmartDashboard::getEntry).peek(NetworkTableEntry::clearPersistent)
        .forEach(NetworkTableEntry::close);
    // ...
  }

It didn’t work…

Any advice?

Try in smart dashboard to click file in the top left then click new

See stale data here:

Works like a charm!

1 Like