Running commands from shuffleboard

Does anyone know how to run commands from Shuffleboard? There’s a command widget which looks like it should allow you to enable and disable a command at will, but after throwing a command onto shuffleboard via LiveWindow.add(command); and clicking the created command widget, the command turns on for a hot second then disables itself immediately. This happens in both test and teleop mode.

Have you tried adding it to the Smartdashboard using Smartdashboard.putdata("Command", new Command)?

1 Like

If you could post the source code for the command you are trying to run on Shuffleboard that would help in debugging.

If you could post your entire robot code that would be even more beneficial in general.

ScreenStepsLive actually shows using the SmartDashboard Class to put a Command on the Shuffleboard, as @jdao describes, so do try that. https://wpilib.screenstepslive.com/s/currentCS/m/shuffleboard/l/831050-working-with-commands-and-subsystems

As for other guesses off the top of my head:

  • Does the command’s isFinished() method immediately return true? If so, the command is ending itself after a single execution cycle.
  • Is there another command that may be started right away that requires() the same subsystem? If so, the command would be interrupted().

Turns out I had to put the command onto smartdashboard and not the live window. I should probably figure out the difference.

ScreenStepsLive actually shows using the SmartDashboard Class to put a Command on the Shuffleboard…

Or using the WPILib docs link https://docs.wpilib.org/en/latest/docs/software/wpilib-tools/shuffleboard/advanced-usage/shuffleboard-commands-subsystems.html