|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#6
|
|||
|
|||
|
Re: Handling Exceptional Cases in a CommandGroup
Hi all -
We tested out a successful solution last night: as GeeTwo suggested, a command that requires the same subsystem(s) as a scheduled command will interrupt the scheduled commands. So in the original Command (within the CommandGroup) when we get a timeout, we schedule a new Command with (something like) Scheduler.Instance.Add(New StopAllMotors()); This StopAllMotors command requires all subsystems that we want to stop, thus interrupting any running commands. This works in practice for us - we can see running commands getting interrupted and canceled. I suppose if we wanted to extend this to do something other than stop all motors, we could try something like: Scheduler.Instance.Add(New InterruptAllCommands()); Scheduler.Instance.Add(New ExecutePlanB()); Where InterruptAllCommands is a command that just requires all the subsystems we want to reset and ExecutePlanB is our CommandGroup to execute an alternative autonomous plan. Thanks again for all your great suggestions. Hope someone else profits from this... mp |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|