Go to Post I find this ironic. In English class our teacher's tell us how there is symbolism and such, and we don't understand it or think its there. Then FIRSTer's get a Game Hit, and we think EVERYTHING is a symbol and has some significance. - akoscielski3 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Spotlight this post!  
Unread 02-26-2015, 03:53 PM
shindigo shindigo is offline
Registered User
AKA: Mike Parker
FRC #0102
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Somerville, NJ
Posts: 33
shindigo is an unknown quantity at this point
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
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:04 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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