Run Smartdashboard command when disabled?

I’m looking to add a button to our dashboard that would reset our encoders before a match since our arm swings a little more than we’d like and can mess things up if we don’t zero it properly.
The button works fine, but only when we’re enabled. Was wondering if there was a way to be able to reset the encoders on a press while we’re disabled.
Or, if there’s an alternative idea that I’m missing, I’d love to hear it.

(Ik it’s very spaghetti coded don’t bully me) :skull:

Commands have a .ignoringDisable() method that you can use for this. It will allow the commands to be run even while the robot is disabled, though keep in mind you still can’t drive motors/actuators while disabled.

1 Like

That sounds like it would work to me, thanks a lot!
And yes, we’ll do all the zero-ing manually in the pits, but just an encoder reset for mainly the arm in case it slips from the time we get from the pits to the field. No need to run motors :slight_smile: