Go to Post Cue all the jokes about natural selection in the Darwin division - TDav540 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 20-04-2013, 21:57
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 429
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
SmartDashboard Sendable Chooser not showing up on dasboard

I've been making some changes to our dashboard in preparation for championships. I've added a few SendableChoosers to the dashboard which drive some case statements in our commands.

I only have a few days of testing on this code, but it has been working reliably until today. On numerous occasions I would start the driver station, dashboard, and robot (order didn't seem to make a difference) and some times one of the lists of radio buttons (sendable chooser) would not show up. The default option would be observed by the code (there is an associated getNumber call in a later method).

I'm not sure what it takes to get the chooser back. Either cRIO, robot, or dashboard reboot - or some combination thereof. I haven't had enough time to troubleshoot this completely.

I'm concerned this will happen on the field and it would likely have undesirable results.

The code in question is below.
I've changed some of the names of variables, but other than that it's functionally equivalent. Sorry if it doesn't make much sense after the variable name changes.

Code:
private static double disc1Delay = 3.5,
                      disc2Delay = 0.7,
                      disc3Delay = 0.7;
private static final String TIME_1_DELAY_KEY = "Delay before shot 1",
                            TIME_2_DELAY_KEY = "Delay before shot 2",
                            TIME_3_DELAY_KEY = "Delay before shot 3";

public static final int A_1 = 1,
                      A_2 = 2,
                      A_3 = 3,
                      A_4 = 4,
                      B_1 = 1,
                      B_2 = 2,
                      B_3 = 3;

    public void robotInit() {
        // Initialize all subsystems
        CommandBase.init();
        
        //Start the compressor
        compressor = new Compressor(RobotMap.compressorPressureSwitch, RobotMap.compressorPower);
        compressor.start();
                
        SmartDashboard.putBoolean("SomeBoolean", someBoolean);

        //This set of radio buttons always seems to show up fine on the dashboard
    	aChooser = new SendableChooser();
    	aChooser.addDefault("a1", new Integer(A_1));
    	aChooser.addDefault("a2", new Integer(A_2));
    	aChooser.addDefault("a3", new Integer(A_3));
    	afterShotChooser.addDefault("a4", new Integer(A_4));
    	SmartDashboard.putData("A Chooser", aChooser);
    	
    	SmartDashboard.putNumber(TIME_1_DELAY_KEY, disc1Delay);
    	SmartDashboard.putNumber(TIME_2_DELAY_KEY, disc2Delay);
    	SmartDashboard.putNumber(TIME_3_DELAY_KEY, disc3Delay);
    	
        //Methods to display some parameters of one of the Drivetrain Commands
    	SmartDashboard.putNumber("fast speed", DriveDrivetrainTurn_Simple.getFastSpeed());
    	SmartDashboard.putNumber("slow speed", DriveDrivetrainTurn_Simple.getSlowSpeed());
    	
    	//this chooser doesn't show sometimes.
        //I've tried running it later (here) and earlier in the robotInit() method.
        //I've also tried calling the putData method multiple times. Same results
    	bChooser = new SendableChooser();
    	bChooser.addDefault("b1", new Integer(B_1));
    	bChooser.addObject("b2", new Integer(B_2));
    	bChooser.addObject("b3", new Integer(B_3));
    	SmartDashboard.putData("B Chooser", bChooser);
    }

Has anyone seen sendableChoosers not show up on the dashboard?
It's strange since it only happens with this one chooser.

I've tried saving the layout when the chooser was there, then reloading the saved layout (to get the chooser to show back up), but that didn't fix the problem.

I can open the dashboard now on my computer (no robot online). And none of the choosers show up. All other elements appear to be there though.
What's so special about the SendableChooser?

What is the mechanism that actually causes the chooser to get displayed?
__________________
http://team2168.org
Reply With Quote
 


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 10:00.

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