|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||||
|
||||||
|
Re: Java Conditional Command
In this particular case of the example, I think it would be easier to build the logic into a single command.
However, the pattern is definitely useful. We had cases last year where we wanted to start a parallel command halfway through another command (for a different subsytem). We sequenced them with waits, but a way to generically peek at the progress of the first command would be much better. |
|
#2
|
||||
|
||||
|
Re: Java Conditional Command
Quote:
|
|
#3
|
|||||
|
|||||
|
Re: Java Conditional Command
Quote:
What is the CommandGroup paradigm for doing down a different command path based on a decision from a previous step? Think hot goals in 2014. |
|
#4
|
||||
|
||||
|
Re: Java Conditional Command
Quote:
That's not how CommandGroups were intended to be used, which is why it breaks the paradigm. |
|
#5
|
|||||
|
|||||
|
Re: Java Conditional Command
My Java is a bit rusty, but won't this command in the DriveToLine instantiator:
Code:
addSequential(waitUntil(drivetrain.getDistance(), GREATER_THAN, 50)); |
|
#6
|
|||
|
|||
|
Re: Java Conditional Command
How do I describe what the robot should do if the distance never exceeds 50?
|
|
#7
|
|||||
|
|||||
|
Re: Java Conditional Command
If you're expecting it to timeout you could just call the addSequential() that takes a timeout parameter also.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|