Can you schedule a command within a command?

The question is in the title, I have my shooter code implemented in command and was wondering for the low ring shot if I could just have it update some variable and then schedule the shooter command in initialize. I’d test it myself but I don’t have access to the robot at the moment.

To answer the topic title, yes-- read about the ScheduleCommand and ProxyScheduleCommand here. As the docs explain, though, this is useful for scheduling some command while inside a command group that you don’t want to take the requirements of. I’m not sure what you’re trying to accomplish, could you explain a bit more? It sounds like you might be looking for default commands.

(FYI the functionality of ScheduleCommand is literally just an instant command that performs command.schedule())

Have you tried to use simulation? Even with 0 extra additions you should be able to see what motor controllers are being set to. Now I don’t know your whole system so maybe currently a sensor needs to be read or something which is a minor inconvenience to set.

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