step.wait_for_seconds

Classes

WaitForSeconds

Pause execution for a fixed number of seconds.

Module Contents

class step.wait_for_seconds.WaitForSeconds(seconds: float | int)

Bases: step.Step

Pause execution for a fixed number of seconds.

Suspends the current step sequence for the specified duration using an async sleep. No hardware commands are issued during the wait, and other concurrent tasks (e.g. odometry updates) continue running normally. The wait duration is deterministic and is reflected accurately in simulation estimates.

Parameters:

seconds – Duration to pause in seconds. Must be non-negative. Passing 0 yields control to the event loop for one tick without any meaningful delay.

Example:

from raccoon.step import wait

# Pause between two motor commands
sequence(
    motor_power(robot.motor(0), 100),
    wait(2.5),
    motor_brake(robot.motor(0)),
)

# Brief yield to let sensors settle
wait(0.1)
seconds
to_simulation_step() step.SimulationStep