navlie.batch.residuals.MeasurementResidual¶
- class navlie.batch.residuals.MeasurementResidual(keys: List[Hashable], measurement: Measurement)¶
Bases:
Residual
A generic measurement residual.
Can be used with any
navlie.Measurement
.- evaluate(states: List[State], compute_jacobians: List[bool] | None = None) → Tuple[ndarray, List[ndarray]]¶
Evaluates the measurement residual.
The error is computed as
\[\mathbf{e} = \mathbf{y} - \mathbf{g} (\mathbf{x}).\]The Jacobian of the residual with respect to the state is then the negative of the measurement model Jacobian.
- 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]