How does sendable chooser work with the 2020 command system?

In this photo, my TestAuto file is an updated wpilibj2 command that I just made, and the rest are outdated commands. How do I add this new kind of command to my SmartDashboard?Capture2

1 Like

You can’t mix-and-match the command library versions; the SendableChooser is confused because you are giving it arguments of inconsistent type.

I commented out all but the test auto option, it’s still mad at me. Any ideas?

What is the declared type parameter for the chooser?

string, command

Make sure Command is the one from the WPILibJ2 package.

1 Like

Got it, thanks for helping me like 5 times today. Really appreciate what you guys do.

1 Like

What did you change to make this work? Ours looks the same.

I just made sure all the objects that sendable chooser was taking were wpilibj2 commands

1 Like

The real irony here is that SendableChooser does not know or care what the actual types of its arguments are (hooray type erasure) and if you could make the compiler shut up about it you could totally mix-and-match types in the chooser without issue (not that that would be a good idea architecturally…).

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.