Go to Post Success isn't from winning nationals but from improving as a person or as team. Putting the minds together in order to get the job done is success. - Melissa Nute [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-04-2016, 14:07
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 222
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
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)
The problem is that it never actually shows up. I use the connector indicator icon and it shows that it is indeed connected but my options never show up. Is there something else I should be doing? I have tried just doing
Code:
wpilib.SmartDashboard.putNumber("Something", 3)
and that doesn't show either when connected. Any ideas or suggestions are welcome! Thanks!
Reply With Quote
  #2   Spotlight this post!  
Unread 01-04-2016, 14:33
josephno1's Avatar
josephno1 josephno1 is offline
Registered User
FRC #3647
Team Role: Programmer
 
Join Date: Oct 2015
Rookie Year: 2015
Location: murica
Posts: 21
josephno1 is an unknown quantity at this point
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);
}
Try opening a new dashboard/recompiling/running teleop for a bit
__________________
Go Team 3647 Millennium Falcons!
Reply With Quote
  #3   Spotlight this post!  
Unread 01-04-2016, 14:53
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 222
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Re: Why doesn't the SmartDashboard update?

Quote:
Originally Posted by josephno1 View Post
We are a java team. Here is our code that does multiple autos

Try opening a new dashboard/recompiling/running teleop for a bit
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.
Reply With Quote
  #4   Spotlight this post!  
Unread 01-04-2016, 15:56
virtuald's Avatar
virtuald virtuald is online now
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,058
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
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
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote
  #5   Spotlight this post!  
Unread 01-04-2016, 17:18
josephno1's Avatar
josephno1 josephno1 is offline
Registered User
FRC #3647
Team Role: Programmer
 
Join Date: Oct 2015
Rookie Year: 2015
Location: murica
Posts: 21
josephno1 is an unknown quantity at this point
Re: Why doesn't the SmartDashboard update?

Quote:
Originally Posted by team-4480 View Post
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.
Go to:
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
Attached Files
File Type: zip save.zip (213 Bytes, 9 views)
__________________
Go Team 3647 Millennium Falcons!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 00:54.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi