|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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?
|
|
#2
|
|||
|
|||
|
Re: Two Commands Co-Existing depsite Requires()
Are you able to post the code for both commands?
|
|
#3
|
|||
|
|||
|
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
) and we had a similar problem, which was fixed by making sure the commands actually ended when we wanted them to. |
|
#4
|
||||
|
||||
|
Re: Two Commands Co-Existing depsite Requires()
How do you know it's not interrupting the default command? Do you have code in the interrupted function?
|
|
#5
|
|||||
|
|||||
|
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?
|
|
#6
|
|||
|
|||
|
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!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|