Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Two Commands Co-Existing depsite Requires() (http://www.chiefdelphi.com/forums/showthread.php?t=133882)

pluto7443 02-02-2015 18:50

Two Commands Co-Existing depsite Requires()
 
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

Re: Two Commands Co-Existing depsite Requires()
 
Are you able to post the code for both commands?

JohnSmooth42 02-02-2015 21:52

Re: Two Commands Co-Existing depsite Requires()
 
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

Re: Two Commands Co-Existing depsite Requires()
 
Quote:

Originally Posted by pluto7443 (Post 1437441)
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

Re: Two Commands Co-Existing depsite Requires()
 
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

Re: Two Commands Co-Existing depsite Requires()
 
The solution was that we had OI initialized before some other subsystems, which was causing strange behaviour. ALWAYS INIT OI LAST!


All times are GMT -5. The time now is 12:06.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi