Open PeterJohnson opened 7 years ago
Here's a stack trace when it happens. It happens around 1/10 when running SD for me. When this happens, my sendable chooser also disappears.
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at edu.wpi.first.smartdashboard.gui.elements.Command$1.actionPerformed(Command.java:48)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Seeing similar problem with the FRC 2019 smart dashboard.
Command buttons work when SD is started up standalone and automatically loads the last saved layout.
They don't when SD is started by drive station, nor when the SD is started after the drive station was already running. Command buttons will work again after creating a new auto-populated layout via File/New, but not when saving and then loading that layout in the same instance.
Is this difficult to reproduce? I'm surprised to see it has been around since 2017.
We have ran into this occasionally over the past couple of weeks. This bit us at our event this past weekend. We have buttons on the dashboard that we use to prep the robot before a match. We were in the semifinals and couldn't get the dashboard to connect in a state that the buttons were clickable. We were not able to start the robot in the frame perimeter and the head ref noticed so we had to depressurize our pneumatics to avoid being DQ.
All other values update on the dashboard but the buttons don't respond to being clicked. Our solution is typically to reboot the RoboRio and relaunch the SmartDashboard. It sounds like the trick is that the SmartDashboard is starting up before the robot connects to the DriveStation so it works.
Are bugs still being fixed in SmartDashboard or do we need to use Shuffleboard / a custom solution?
Is this difficult to reproduce?
Happened to us every time on multiple computers: Start smart dashboard first, it automatically loads the last-saved layout, then start drive station: OK. But try to now load another saved layout into the smart dashboard: Buttons don't function.
do we need to use Shuffleboard
Our main reason for using the smart dashboard is that it's more compact. A text indicator is just that, while the Shuffleboard creates a rather large widget for each data item, unless we're missing some basic idea in how to configure the Shuffleboard.
It seems like loading an existing SD dashboard save file causes command buttons to stop working. If we do "new", the buttons work. If we save that file and load it, the command buttons don't work.
Robot code:
putData("command", new MyCommand());
The buttons can be clicked but don't transition through cancel, and the Outline Viewer shows the running value never transitions to true. If you do new, then load a save file with just one button, only that button doesn't work, other existing buttons work.
Also reported at https://www.chiefdelphi.com/forums/showthread.php?threadid=156514