wpilibsuite / shuffleboard

A modern dashboard for FRC
Other
80 stars 83 forks source link

Sendable Chooser returns default option despite correct option selected #775

Open VincentZhao12 opened 1 year ago

VincentZhao12 commented 1 year ago

Note this is all from memory as our team hasn't been back in the lab since this issue occurred

We set up our SendableChooser as WPILib does in their CommandBased Choosing an Autonomous Program tutorial. Throughout our competition, we've been able to properly select autonomous routines this way, except for two matches. During those matches, the robot ran the default option of the SendableChooser rather than the selected path. When tested in pits, the SendableChooser appeared with a checkmark next to it however it still ran the default path rather than the selected one. No code was changed between matches before issue occurred. Returning the command we wanted directly from where we said autonSelector.getSelected() solved the issue, however we don't want to have to resort to using that and switching out between every match.

WPILib Java, Version 2023.4.2 Roborio Version 2023_v3.2

Shuffleboard Log files from around the time that the issue occurred.

shuffleboard.2023-03-19-15.39.47.log shuffleboard.2023-03-19-15.39.18.log

Match Videos from about when the issue occurred: First Occurrence Second Occurrence

Match Video of expected behavior, one match before the issue occurred: Video

Match Video of just returning the command rather than the result of the SendableChooser: Video

jasondaming commented 1 year ago

I have seen this happen before when the robot loses communication with the robot (like the field prestarting). You will see a check before the loss of communication but may not notice the X after. In which case the robot will run the default option. This happened to the team I helped at one of their matches, another team on the other alliance was having connection issues.

I do think we should try to do more to actively send sendables upon a reconnect and not force a new selection in order to do anything. Further it seems that if the same option as was already selected is chosen then it will not send it and nothing changes causeing teams have to select "something else" then back to what they actually wanted.

PeterJohnson commented 1 year ago

I need to double-check to see if we aren’t already doing this, but Shuffleboard should set the “retained” property on the Sendable chooser’s selected entry so it is not unpublished if the dashboard disconnects, which is what sounds like may be happening. We could also consider doing this on the robot code side.

VincentZhao12 commented 1 year ago

Yes, once we get back in the lab we will try to recreate the issue just to make sure it wasn't somehow a robot code thing, but I'm very confident we didn't change anything code wise between the match where it worked vs the match where it didn't.

jasondaming commented 1 year ago

Another note here is that we also use FRC-web-components and the sendable chooser there has the same issue.

Starlight220 commented 1 year ago

Does this reproduce with the newly-releases 2023.4.3? We hope that #778 fixed this.