![]() |
Autonomous: addParallel
So we are trying to run parallels in our autonomous, but for some reason when we add a parallel to the mix, that command won't run until after every other sequential command has finished. Any ideas for why this would happen? If someone could put up an example of a simple, working, auto code that uses parallels, t that would be great.
|
Re: Autonomous: addParallel
I believe a parallel command won't run until the sequential command above it has finished. if you want two things to happen simultaneously, make the first one parallel.
This is a snippet of our code from last year: Code:
addSequential(new ShootAndReloadBall()); |
Re: Autonomous: addParallel
Just to make sure everything is clear.
Code:
addSequential(new ShootAndReloadBall());The addX() functions basically apply to handling the next command's execution order. |
Re: Autonomous: addParallel
Deleting my post because I was wrong in several of my assumptions.
Thanks Matt for correcting me. Needless to say, adding parallel commands can certainly make your head spin. Good luck! |
Re: Autonomous: addParallel
Quote:
Quote:
|
Re: Autonomous: addParallel
We put all our sets of parallel commands in their own CommandGroup. We find this makes is clearer what is running in parallel and what is not.
In the Autonomous CommandGroup we have: AddSequential(new DoThing1()); AddSequential(new DoThings2and3()); AddSequential(new DoThing4()); Inside the CommandGroup called DoThings2and3 we have: AddParallel(new DoThing2()); AddParallel(new DoThing3()); Thing4 does not execute until 2 and 3 are finished. |
Re: Autonomous: addParallel
It's a little counter intuitive at first, but addParallel() commands run in parallel with the first addSequential() AFTER them.
Code:
addParallel(1) |
| All times are GMT -5. The time now is 10:27. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi