libstp.step.timing.wait_for_checkpoint¶
Classes¶
Wait until the robot synchronizer reaches a mission-relative checkpoint. |
Functions¶
|
Wait until a mission-relative time checkpoint is reached. |
Module Contents¶
- class libstp.step.timing.wait_for_checkpoint.WaitForCheckpoint(checkpoint_seconds: float | int)¶
Bases:
libstp.step.StepWait until the robot synchronizer reaches a mission-relative checkpoint.
- checkpoint_seconds¶
- libstp.step.timing.wait_for_checkpoint.wait_for_checkpoint(checkpoint_seconds: float) WaitForCheckpoint¶
Wait until a mission-relative time checkpoint is reached.
Pauses execution until the robot’s global synchronizer clock reaches the specified number of seconds since mission start. If the checkpoint time has already passed, the step returns immediately. This is useful for synchronizing actions to absolute times within a timed Botball run (e.g. “at T=20s, start collecting”).
- Prerequisites:
The robot must have a
synchronizerconfigured. The synchronizer clock starts when the mission begins.
- Parameters:
checkpoint_seconds – The mission-relative time (in seconds) to wait for. Must be non-negative.
- Returns:
A step that blocks until the checkpoint time.
- Return type:
Example:
from libstp.step.timing import wait_for_checkpoint seq([ drive_forward(50), # Ensure we don't start the next action before T=10s wait_for_checkpoint(10.0), pick_up_tribble(), # Gate the final action to T=25s wait_for_checkpoint(25.0), drive_to_bin(), ])