Log in

View Full Version : Two Commands Co-Existing depsite Requires()


pluto7443
02-02-2015, 18:50
So, we have a problem with using two commands that both require our IntakeSub subsystem. One is the default command, used for manual control of the intake with a joystick, and the other is a command which should override the default. The manual control works fine, however, when the command is called (by pressing a button), the command starts to run, not interrupting the default command. Both commands use Requires(mIntakeSub) in their constructor - why doesn't the button command interrupt the default?

afiolmahon
02-02-2015, 20:48
Are you able to post the code for both commands?

JohnSmooth42
02-02-2015, 21:52
Have you made sure you have code in the IsInterrupted() function of the command? I decided to try out the command based framework two days ago(ported all the SampleRobot code in 10 hours :P) and we had a similar problem, which was fixed by making sure the commands actually ended when we wanted them to.

TFleig78
02-02-2015, 22:43
why doesn't the button command interrupt the default?

How do you know it's not interrupting the default command? Do you have code in the interrupted function?

GeeTwo
02-02-2015, 22:46
This may sound like "is the computer plugged in", but is this actually running under the command based robot model?

pluto7443
09-02-2015, 19:46
The solution was that we had OI initialized before some other subsystems, which was causing strange behaviour. ALWAYS INIT OI LAST!