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.


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?

I have noticed this problem as well. I didn’t know how to fix it, but one time on accident I pressed “File->New” and it wiped the dashboard of anything that was being unused. Once I did that, the SendableChoosers became visible with their radio buttons. I can’t explain why, or a better way to do it. Although it’s a pretty good starting point

Thanks for the reply.

As far as I know, we never saw this occur at champs, which was my original concern. The only potentially related change I made in the code was that the chooser keys (thier string names) were changed. I’m not sure if this had any direct affect though since I haven’t identified a way to reliably reporoduce the problem.

There may be a lingering bug out there with the Choosers… Hopefully it doesn’t rear its head in the off season.

I saw two teams with this issue (once each) on the field at CMP. I don’t know what they did to fix it though.

Do you happen to know which teams?

I’m having the same problem as OP. Anyone have any solutions?

**

We had the same thing at champs. It cost us two matches because the FTA started before we were able to tell our problems. For us, the problem was random, but happened the most when we were on the competition field. Later in the day, we found some first person who was aware of the issue. We had a non programmer talk to him, and he said that some sort of connection or table ID is retained, and that it can be fixed by a reformat.

1 Like