navlie.batch.residuals.Residual¶
- class navlie.batch.residuals.Residual(keys: List[Hashable])¶
Bases:
ABC
Abstract class for a residual to be used in batch estimation.
Each residual must implement an evaluate(self, states) method, which returns an error and Jacobian of the error with respect to each of the states.
Each residual must contain a list of keys, where each key corresponds to a variable for optimization.
- abstract evaluate(states: List[State], compute_jacobian: List[bool] | None = None) → Tuple[ndarray, List[ndarray]]¶
Evaluates the residual and Jacobians.
- 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]