|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Why doesn't the SmartDashboard update?
Hi,
I am trying use the autonomous selector part of the Smartdashboard with this code in the init: Code:
self.auto_chooser=wpilib.SendableChooser()
self.auto_chooser.addObject("High Goal, Low Bar", "1")
self.auto_chooser.addDefault("Crosser Low Bar", "2")
self.auto_chooser.addObject("Reacher", "3")
self.auto_chooser.addObject("Crosser RT", "4")
wpilib.SmartDashboard.putData('Choice', self.auto_chooser)
Code:
wpilib.SmartDashboard.putNumber("Something", 3)
|
|
#2
|
||||
|
||||
|
Re: Why doesn't the SmartDashboard update?
We are a java team. Here is our code that does multiple autos
Code:
public void robotInit() {
updateDashboard();
autoChooser = new SendableChooser();
autoChooser.addDefault("Default Autonomous does nothing!", new Default());
// Default Autonomous does nothing
autoChooser.addObject("Cross the Low Bar Don't Run This it doesn't work", new LowBar());
autoChooser.addObject("Cross Rough Patch/Stone Wall", new Main());
autoChooser.addObject("Cross the Low Bar, Experimental!", new LowBarEx());
//autoChooser.addObject("If Jonathan lied to us and we can cross twice", new RoughPatch());
CameraServer server = CameraServer.getInstance();
server.setQuality(50);
SmartDashboard.putData("Autonomous", autoChooser);
}
|
|
#3
|
||||
|
||||
|
Re: Why doesn't the SmartDashboard update?
I can now found that I can do the normal "wpilib.SmartDashboard.putNumber" stuff, but the sendable chooser still refuses to work. I tried starting new dashboard, but the variables keep coming back from our old robot. I have even deleted the save file and somehow it stills finds it way back onto the dashboard.
|
|
#4
|
||||
|
||||
|
Re: Why doesn't the SmartDashboard update?
robotpy has an autonomous selector class that you can point at a directory of .py files and it'll setup a chooser that should work with SmartDashboard.
If you still want to roll your own, check out how it does it: https://github.com/robotpy/robotpy-w...lector.py#L151. Your code looks correct though, maybe there's something else missing... Additionally, with the latest version of pyfrc (as of a month ago or so?), there's an integrated chooser built into the simulator, using the key '/SmartDashboard/Autonomous Mode'. Run this sample for a cool demo of that working: https://github.com/robotpy/robotpy-w...ful_autonomous |
|
#5
|
||||
|
||||
|
Re: Why doesn't the SmartDashboard update?
Quote:
C:\Users\[Name]\SmartDashboard Find save.xml and make a back up copy Replace it with the clean copy of save.xml and see if that gets your old variables from popping up |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|