Skip to main content

next

Function next 

Source
pub fn next(
    observed_attempt: &Attempt,
) -> Result<Option<PlanningStep>, TrajectoryError>
Expand description

Tries to pop a step from the front of the TRAJECTORY. If the trajectory is empty, Ok(None) is returned. Otherwise checks that the popped planning_step matches the provided Attempt, and then returns a new PlanningStep (as an Ok(Some(planning_step))), with the Attempt in the popped step replaced with the provided Attempt. If the Attempts do not match, Err(TrajectoryError::OffTrajectory) is returned and a TrajectoryDeviation is sent up the pipe to the navigator.