How does wpilib framework handle .andThen

We have the following command in a ParallelRaceGroup

new WaitUntilStable(m_limelight::getDistance, 0.01, 10).withTimeout(1).andThen(m_limelight::snapshotDistance)

So m_limelight is extend from CommandBase.

Once the command is running, each loop of the wpilib framework will call the following…

Is Finished
(if finished returns true) End

My question is will the “.andThen” execute in the immediately after End, or will it wait until the next 20ms cycle?


andThen forms a sequential command group. When the previous command ends, end will be called, then the next command will be initialized in the same loop. The next commands execute won’t be called until the next cycle.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.