Skip to main content

register_observed

Function register_observed 

Source
pub fn register_observed<S, F>(
    source: &Surface<'_>,
    target: &Surface<'_>,
    search: &S,
    initial: Se3,
    config: &IcpConfig,
    observer: F,
) -> IcpResult
Expand description

The same, with an observer called after every accepted iteration.

The iso-accuracy protocol needs it: comparing “time to a given accuracy” rather than “time to one’s own stopping criterion” requires seeing the intermediate poses. Comparing stopping criteria measures a difference in settings, not in code.

§Stopping early

Returning ControlFlow::Break ends the run. The result then carries the last accepted pose with converged: false: an interrupted run is not a converged one, and nothing in the result may suggest otherwise.

The observer only sees accepted iterations, so a caller watching a cancellation flag is answered after the next accepted step rather than at once — a rejected step raises the damping and retries without reporting. The delay is a few assemblies of the system and is bounded by max_iterations. Making it immediate would mean reporting rejected steps too, which would change what an IterationReport means for every existing consumer.