Main Content

propagateWhileValid

Propagate system and return valid motion

Since R2021b

    Description

    [q,u,steps] = propagateWhileValid(mobileProp,q0,u0,qTgt,maxSteps) iteratively propagates the system from the current state q0 towards a target state qTgt with an initial control input u0 for a maximum number of steps maxSteps.

    At the end of each propagation step i, the system returns these values:

    • q(i,:) — Current state of the system

    • u(i,:) — Control input for step i + 1

    • steps(i) — Number of steps between i - 1 and i

    The function validates all propagations and returns system information between q0 and the last valid state.

    Input Arguments

    collapse all

    Mobile robot state propagator, specified as a mobileRobotPropagator object.

    Initial state of the system, specified as an s-element vector. s is the number of state variables in the state space.

    Initial control on the initial state, specified as an c-element vector. c is the number of control inputs.

    Target state of the system, specified as an s-element vector. s is the number of state variables in the state space.

    Maximum number of steps, specified as a positive scalar.

    Output Arguments

    collapse all

    Propagated states of the system, returned as an s-element vector. s is the number of state variables in the state space.

    Control inputs for propagating states, returned as an n-by-c matrix. c is the number of control inputs

    Number of steps from each state and control input to next, returned as an n-element vector of positive integers.

    Version History

    Introduced in R2021b