Main Content

propagateWhileValid

Class: nav.StatePropagator
Package: nav

Propagate system and return valid motion

Syntax

[q,u,steps] = propagateWhileValid(spObj,q0,u0,qTgt,maxSteps)

Description

[q,u,steps] = propagateWhileValid(spObj,q0,u0,qTgt,maxSteps) iteratively propagates the system from the current state q0 towards a target state qTgt with an initial control input u0for a maximum number of steps maxSteps. All propagations are validated and the function returns system information between q0 and the last valid state.

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

  • 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

Input Arguments

expand all

State propagator object, specified as a handle from a child class of nav.StatePropagator.

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

Initial control input, specified as an c-element vector, where c is the number of control inputs.

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

Maximum number of steps, specified as a positive scalar.

Output Arguments

expand all

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

Control inputs for propagating states, specified as an s-element vector, where c is the number of control inputs.

Number of steps between each state and control input, specified as an n-element vector of positive integers.

Attributes

Abstracttrue

To learn about attributes of methods, see Method Attributes.

Introduced in R2021b