|
Re: Using Coniditionals to Build Custom Command Groups
One thing we did, was stored the hot value in the Robot variable to reference later.
Here is an example of how we did that:
DriveForwardAndWatch:
-drives forward for n seconds
-watches while doing it
-if it determines the goal is hot, writes to the Robot hot variable.
WaitForShot:
-checks to see whether or not the first command saw hot through the Robot hot variable
-if it saw hot, finish
-if it didn't wait for n seconds
Shoot:
-
Not exactly what you were looking for, but may be good enough.
I for one wish there was a better way to do conditional commands, to support more complex state machines (i.e. firing different commands on success, failure, and timeout). However, I've never really been able to get this to work with the wpilib command structure.
__________________
"Never let your schooling interfere with your education" -Mark Twain
|