View Single Post
  #4   Spotlight this post!  
Unread 23-03-2016, 14:57
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is online now
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,713
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Manually cancelling a Command

Quote:
Originally Posted by axiomofdarkness View Post
Hello,

I am trying to create a Command subclass which listens for an interrupt to cancel the command. When cancelling the command, I have tried using the Cancel() method, but it fails when the command is part of a CommandGroup. Is there a universal way to forcibly end a command from within the command itself?

EDIT: Also, can the Cancel() method be used on a CommandGroup object? If so, I could work around this issue.
What about listening for the interrupt and setting a variable that will finish the command during the next iteration?