View Single Post
  #7   Spotlight this post!  
Unread 10-03-2015, 23:01
TFleig78's Avatar
TFleig78 TFleig78 is offline
Registered User
AKA: Tyler
FRC #0078 (Air Strike)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Rhode Island
Posts: 58
TFleig78 will become famous soon enoughTFleig78 will become famous soon enough
Re: COmmand based software Interrupts

Quote:
Originally Posted by otherguy View Post
Is your repository private? Link doesn't work.

For the commands that are running "in parallel".
* Do they both require the same subsystem?
* What does their isFinished() code look like?
* What command is set as the default command for the subsystem?
* What does the code in OI look like that associates the commands with buttons (or where is new CommandXYZ() called for each command in question)?
Also, what is in interrupted()?

Quote:
Ok, thank you. I tried using the cancel command in the Interrupted function, but it still did not work :/ do you know how you can force a command to stop once it is interrupted?
You should very rarely (if ever) have to explicitly cancel a command. The command will end(the scheduler will stop it) if it is interrupted by another command using the same subsystem or if isFinished() returns true. From what's going on, it seems as though your two commands A and B don't require the same subsystem.
Also, how are you starting the commands? It's possible they both keep trying to start, and are therefore interrupting each other repeatedly.
Reply With Quote