navlie.batch.residuals.ProcessResidual¶
- class navlie.batch.residuals.ProcessResidual(keys: List[Hashable], process_model: ProcessModel, u: Input)¶
Bases:
Residual
A generic process residual.
Can be used with any
navlie.types.ProcessModel
.- evaluate(states: List[State], compute_jacobians: List[bool] | None = None) → Tuple[ndarray, List[ndarray]]¶
Evaluates the process residual.
An input \(\mathbf{u}\) is used to propagate the state :math:mathbf{x}_{k-1}` through the process model, to generate \(\hat{\mathbf{x}}_{k}\). This operation is written as
\[\hat{\mathbf{x}}_k = \mathbf{f}(\mathbf{x}_{k-1}, \mathbf{u}, \Delta t).\]An error is then created as
e = x_k.minus(x_k_hat),
where \(\mathbf{x}_k\) is our current operating point at time \(t_k\).
- jacobian_fd(states: List[State], step_size=1e-06) → List[ndarray]¶
Calculates the model jacobian with finite difference.
- Parameters:
states (List[State]) – Evaluation point of Jacobians, a list of states that the residual is a function of.
- Returns:
A list of Jacobians of the measurement model with respect to each of the input states. For example, the first element of the return list is the Jacobian of the residual w.r.t states[0], the second element is the Jacobian of the residual w.r.t states[1], etc.
- Return type:
List[np.ndarray]