How to run sequence while also being able to run other commands separately?

Hello, I am the programming mentor of our school’s robotics team and I have been trying to come up with a sequence of commands in order to bring out our arm, horizontal slide, and intake. I can get the sequence to work, however once I press the button that activates that sequence, the other commands (like the drive) will not respond until after the sequence is over. I take it that this may be an issue with the command scheduler not wanting to double call but I wanted to know if there is any way for me to get around this so that I can press the button for the sequence and still be able to do things like drive around while the sequence is playing out. Thanks in advance.

1 Like

Links to your code would help.

Off the top of my head it sounds like some of your commands may not be ending keeping the lock on the subsystems they call.

If your command sequence uses the drive subsystem it should cause the drive command to stop working until the sequence is over. If the sequence does not use the drive subsystem, then something weird sounds like it’s going on.

A link to your code is needed to help further.

This is happening because if a single command in the sequence requires the drive subsystem, the entire sequence command has that subsystem as a requirement, and will interrupt other commands requiring the subsystem.
To go around it, enclose the commands in the sequence that require the drive subsystem inside a ProxyCommand, so that the final sequence won’t have the drive as a requirement.
Hope this helps!

4 Likes