navlie.batch.estimator.BatchEstimator¶
- class navlie.batch.estimator.BatchEstimator(solver_type: str = 'GN', max_iters: int = 100, step_tol: float = 1e-07, ftol: float | None = None, gradient_tol: float | None = None, tau: float = 1e-11, verbose: bool = True)¶
Bases:
object
Main class for the batch estimator.
Instantiate
BatchEstiamtor
.- Parameters:
solver (str, optional) – Solver type, either “GN” or “LM”, by default “GN”.
max_iters (int, optional) – Maximum number of optimization iterations, by default 100.
step_tol (float, optional) –
Convergence step tolerance, by default 1e-7. The solver exits when
\[||\Delta x||_2 < \text{step_tol}\]where \(\Delta x\) is the change in the state estimate for successive steps.
ftol (float, optional) –
Convergence relative cost decrease tolerance, by default None (not used). The solver exits when
\[|\Delta C /C| < \text{ftol}\]where \(\Delta C\) is change in the cost function for successive accepted steps.
gradient_tol (float, optional) –
Convergence gradient infinity norm tolerance, by default None (not used). The solver exits when
\[\max_i |\nabla J|_i = \max_i |\mathbf{e}^T \mathbf{H}|_i < \text{gradient_tol}\]tau (float, optional) – tau parameter in LM, by default 1e-11.
verbose (bool, optional) – Print convergence during runtime, by default True.
- solve(x0: State, P0: ndarray, input_data: List[Input], meas_data: List[Measurement], process_model: ProcessModel, return_opt_results: bool = False) → List[StateWithCovariance]¶
Creates and solves a batch problem.
The input data is used to propagate the initial state x0 forward in time using the process model, to generate an initial estimate of the state at estimate timestep.
The batch problem created involves a
PriorResidual
, aProcessResidual
for each input used to connect subsequent states through the process model, and aMeasurementResiduals
for each measurement.- Parameters:
x0 (State) – x0: Initial state.
P0 (np.ndarray) – Initial covariance
input_data (List[Input]) – List of input data.
meas_data (List[Measurement]) – List of measurements.
process_model (ProcessModel) – Process model used to propagate the initial estimate and form ProcessResiduals.
return_opt_results (bool, optional) – Flag to optionally return the results dictionary from the batch problem, by default False
- Returns:
List of estimates with covariance.
- Return type:
List[StateWithCovariance]