Reactor step that waits for a robot to reach a specific state.
This step checks the current robot state and, if not already in a target
state, subscribes to [:state_machine] events and waits for a transition
to one of the target states.
Options
:states- (required) List of target states to wait for:timeout- Timeout in milliseconds (default::infinity)
Result
Returns the state that was reached on success.
Examples
step :wait_for_idle do
impl {BB.Reactor.Step.WaitForState, states: [:idle], timeout: 5000}
end
step :wait_for_ready do
impl {BB.Reactor.Step.WaitForState, states: [:idle, :executing]}
end