navlie

  • Home
  • Tutorial
  • API
  • navlie.composite
    • navlie.composite.CompositeInput
    • navlie.composite.CompositeMeasurement
    • navlie.composite.CompositeMeasurementModel
    • navlie.composite.CompositeProcessModel
    • navlie.composite.CompositeState
  • navlie.datagen
    • navlie.datagen.generate_measurement
    • navlie.datagen.DataGenerator
  • navlie.filters
    • navlie.filters.check_outlier
    • navlie.filters.generate_sigmapoints
    • navlie.filters.mean_state
    • navlie.filters.run_filter
    • navlie.filters.run_gsf_filter
    • navlie.filters.run_imm_filter
    • navlie.filters.CubatureKalmanFilter
    • navlie.filters.ExtendedKalmanFilter
    • navlie.filters.GaussHermiteKalmanFilter
    • navlie.filters.GaussianSumFilter
    • navlie.filters.InteractingModelFilter
    • navlie.filters.IteratedKalmanFilter
    • navlie.filters.SigmaPointKalmanFilter
    • navlie.filters.UnscentedKalmanFilter
  • navlie.types
    • navlie.types.Dataset
    • navlie.types.Input
    • navlie.types.Measurement
    • navlie.types.MeasurementModel
    • navlie.types.ProcessModel
    • navlie.types.State
    • navlie.types.StateWithCovariance
  • navlie.utils
    • navlie.utils.alignment
      • navlie.utils.alignment.associate_and_align_trajectories
      • navlie.utils.alignment.evo_traj_to_state_list
      • navlie.utils.alignment.state_list_to_evo_traj
    • navlie.utils.common
      • navlie.utils.common.associate_stamps
      • navlie.utils.common.find_nearest_stamp_idx
      • navlie.utils.common.jacobian
      • navlie.utils.common.load_tum_trajectory
      • navlie.utils.common.monte_carlo
      • navlie.utils.common.randvec
      • navlie.utils.common.schedule_sequential_measurements
      • navlie.utils.common.state_interp
      • navlie.utils.common.van_loans
      • navlie.utils.common.GaussianResult
      • navlie.utils.common.GaussianResultList
      • navlie.utils.common.MixtureResult
      • navlie.utils.common.MixtureResultList
      • navlie.utils.common.MonteCarloResult
    • navlie.utils.mixture
      • navlie.utils.mixture.gaussian_mixing
      • navlie.utils.mixture.gaussian_mixing_vectorspace
      • navlie.utils.mixture.reparametrize_gaussians_about_X_par
      • navlie.utils.mixture.update_X
    • navlie.utils.plot
      • navlie.utils.plot.plot_camera_poses
      • navlie.utils.plot.plot_error
      • navlie.utils.plot.plot_meas
      • navlie.utils.plot.plot_meas_by_model
      • navlie.utils.plot.plot_nees
      • navlie.utils.plot.plot_poses
      • navlie.utils.plot.set_axes_equal
      • navlie.utils.plot.CameraPoseVisualizer
  • navlie.batch
    • navlie.batch.estimator
      • navlie.batch.estimator.BatchEstimator
    • navlie.batch.gaussian_mixtures
      • navlie.batch.gaussian_mixtures.GaussianMixtureResidual
      • navlie.batch.gaussian_mixtures.HessianSumMixtureResidual
      • navlie.batch.gaussian_mixtures.MaxMixtureResidual
      • navlie.batch.gaussian_mixtures.MaxSumMixtureResidual
      • navlie.batch.gaussian_mixtures.SumMixtureResidual
    • navlie.batch.losses
      • navlie.batch.losses.CauchyLoss
      • navlie.batch.losses.L2Loss
      • navlie.batch.losses.LossFunction
    • navlie.batch.problem
      • navlie.batch.problem.OptimizationSummary
      • navlie.batch.problem.Problem
    • navlie.batch.residuals
      • navlie.batch.residuals.MeasurementResidual
      • navlie.batch.residuals.PriorResidual
      • navlie.batch.residuals.ProcessResidual
      • navlie.batch.residuals.Residual
  • navlie.lib
    • navlie.lib.camera
      • navlie.lib.camera.PinholeCamera
      • navlie.lib.camera.PoseMatrix
    • navlie.lib.datasets
      • navlie.lib.datasets.generate_landmark_positions
      • navlie.lib.datasets.SimulatedInertialGPSDataset
      • navlie.lib.datasets.SimulatedInertialLandmarkDataset
      • navlie.lib.datasets.SimulatedPoseRangingDataset
    • navlie.lib.imu
      • navlie.lib.imu.G_matrix
      • navlie.lib.imu.G_matrix_inv
      • navlie.lib.imu.L_matrix
      • navlie.lib.imu.M_matrix
      • navlie.lib.imu.N_matrix
      • navlie.lib.imu.U_matrix
      • navlie.lib.imu.U_matrix_inv
      • navlie.lib.imu.U_tilde_matrix
      • navlie.lib.imu.adjoint_IE3
      • navlie.lib.imu.delta_matrix
      • navlie.lib.imu.get_unbiased_imu
      • navlie.lib.imu.inverse_IE3
      • navlie.lib.imu.IMU
      • navlie.lib.imu.IMUKinematics
      • navlie.lib.imu.IMUState
    • navlie.lib.models
      • navlie.lib.models.AbsolutePosition
      • navlie.lib.models.AbsoluteVelocity
      • navlie.lib.models.Altitude
      • navlie.lib.models.BodyFrameVelocity
      • navlie.lib.models.CameraProjection
      • navlie.lib.models.DoubleIntegrator
      • navlie.lib.models.DoubleIntegratorWithBias
      • navlie.lib.models.GlobalPosition
      • navlie.lib.models.Gravitometer
      • navlie.lib.models.InvariantMeasurement
      • navlie.lib.models.InvariantPointRelativePosition
      • navlie.lib.models.LinearMeasurement
      • navlie.lib.models.Magnetometer
      • navlie.lib.models.OneDimensionalPositionVelocityRange
      • navlie.lib.models.PointRelativePosition
      • navlie.lib.models.PointRelativePositionSLAM
      • navlie.lib.models.RangePointToAnchor
      • navlie.lib.models.RangePoseToAnchor
      • navlie.lib.models.RangePoseToPose
      • navlie.lib.models.RangeRelativePose
      • navlie.lib.models.RelativeBodyFrameVelocity
      • navlie.lib.models.SingleIntegrator
    • navlie.lib.preintegration
      • navlie.lib.preintegration.AngularVelocityIncrement
      • navlie.lib.preintegration.BodyVelocityIncrement
      • navlie.lib.preintegration.IMUIncrement
      • navlie.lib.preintegration.LinearIncrement
      • navlie.lib.preintegration.PreintegratedAngularVelocity
      • navlie.lib.preintegration.PreintegratedBodyVelocity
      • navlie.lib.preintegration.PreintegratedIMUKinematics
      • navlie.lib.preintegration.PreintegratedLinearModel
      • navlie.lib.preintegration.PreintegratedWheelOdometry
      • navlie.lib.preintegration.RelativeMotionIncrement
      • navlie.lib.preintegration.WheelOdometryIncrement
    • navlie.lib.states
      • navlie.lib.states.MatrixLieGroupState
      • navlie.lib.states.MixtureState
      • navlie.lib.states.SE23State
      • navlie.lib.states.SE2State
      • navlie.lib.states.SE3State
      • navlie.lib.states.SL3State
      • navlie.lib.states.SO2State
      • navlie.lib.states.SO3State
      • navlie.lib.states.StampedValue
      • navlie.lib.states.VectorInput
      • navlie.lib.states.VectorState
  • navlie.bspline
    • navlie.bspline.SE3Bspline
On this page
  • ProcessModel
    • ProcessModel.evaluate()
    • ProcessModel.covariance()
    • ProcessModel.jacobian()
    • ProcessModel.evaluate_with_jacobian()
    • ProcessModel.jacobian_fd()
    • ProcessModel.input_jacobian_fd()
    • ProcessModel.sqrt_information()
    • ProcessModel.input_covariance()

navlie.types.ProcessModel¶

class navlie.types.ProcessModel¶

Bases: ABC

Abstract process model base class for process models of the form

\[\mathcal{X}_k = f(\mathcal{X}_{k-1}, \mathbf{u}_{k-1}, \Delta t) \oplus \mathbf{w}_{k}\]

where \(\mathbf{u}_{k-1}\) is the input, \(\Delta t\) is the time period between the two states, and \(\mathbf{w}_{k} \sim \mathcal{N}(\mathbf{0}, \mathbf{Q}_k)\) is additive Gaussian noise.

To define a process model, you must inherit from this class and implement the evaluate method. You must also specify covariance information in one of either two ways.

1. Specifying the covariance matrix directly:

The first way is to specify the \(\mathbf{Q}_k\) covariance matrix directly by overriding the covariance method. This covariance matrix represents the distribution of process model errors directly.

2. Specifing the covariance of additive noise on the input: The second way is to specify the covariance of noise that is additive to the input. That is, if the process model is of the form

\[\mathcal{X}_k = f(\mathcal{X}_{k-1}, \mathbf{u}_{k-1} + \mathbf{w}^u_{k-1}, \Delta t)\]

where \(\mathbf{w}^u_{k-1} \sim \mathcal{N}(\mathbf{0}, \mathbf{Q}^u_{k-1})\). In this case, you should override the input_covariance method, at which point the covariance of the process model error is approximated using a linearization procedure,

\[\mathbf{Q}_k = \mathbf{L} \mathbf{Q}^u_{k-1} \mathbf{L}^T\]

where \(\mathbf{L} = D \mathbf{f}(\mathcal{X}_{k-1}, \mathbf{u}_{k-1}, dt) / D \mathbf{u}_{k-1}\) is the input jacobian. This is calculated using finite difference by default, but can be overridden by implementing the input_jacobian method.

abstract evaluate(x: State, u: Input, dt: float) → State¶

Implementation of \({f}(\mathcal{X}_{k-1}, \mathbf{u}, \Delta t)\).

Parameters:
  • x (State) – State at time \(k-1\).

  • u (Input) – The input value \(\mathbf{u}\) provided as a Input object. The actual numerical value is accessed via u.value.

  • dt (float) – The time interval \(\Delta t\) between the two states.

Returns:

State at time \(k\).

Return type:

State

covariance(x: State, u: Input, dt: float) → ndarray¶

Covariance matrix \(\mathbf{Q}_k\) of the additive Gaussian noise \(\mathbf{w}_{k} \sim \mathcal{N}(\mathbf{0}, \mathbf{Q}_k)\). If this method is not overridden, the covariance of the process model error is approximated from the input covariance using a linearization procedure, with the input Jacobian evaluated using finite difference.

Parameters:
  • x (State) – State at time \(k-1\).

  • u (Input) – The input value \(\mathbf{u}\) provided as a Input object.

  • dt (float) – The time interval \(\Delta t\) between the two states.

Returns:

Covariance matrix \(\mathbf{Q}_k\).

Return type:

np.ndarray

jacobian(x: State, u: Input, dt: float) → ndarray¶

Implementation of the process model Jacobian with respect to the state.

\[\mathbf{F} = \frac{D {f}(\mathcal{X}_{k-1}, \mathbf{u}, \Delta t)}{D \mathcal{X}_{k-1}}\]
Parameters:
  • x (State) – State at time \(k-1\).

  • u (Input) – The input value \(\mathbf{u}\) provided as a Input object.

  • dt (float) – The time interval \(\Delta t\) between the two states.

Returns:

Process model Jacobian with respect to the state \(\mathbf{F}\).

Return type:

np.ndarray

evaluate_with_jacobian(x: ~navlie.types.State, u: ~navlie.types.Input, dt: float) -> (<class 'navlie.types.State'>, <class 'numpy.ndarray'>)¶

Evaluates the process model and simultaneously returns the Jacobian as its second output argument. This is useful to override for performance reasons when the model evaluation and Jacobian have a lot of common calculations, and it is more efficient to calculate them in the same function call.

jacobian_fd(x: State, u: Input, dt: float, step_size=1e-06, *args, **kwargs) → ndarray¶

Calculates the model jacobian with finite difference.

input_jacobian_fd(x: State, u: Input, dt: float, step_size=1e-06, *args, **kwargs) → ndarray¶

Calculates the input jacobian with finite difference.

sqrt_information(x: State, u: Input, dt: float) → ndarray¶
input_covariance(x: State, u: Input, dt: float) → ndarray¶

Covariance matrix of additive noise on the input.

Parameters:
  • x (State) – State at time \(k-1\).

  • u (Input) – The input value \(\mathbf{u}\) provided as a Input object.

  • dt (float) – The time interval \(\Delta t\) between the two states.

Returns:

Covariance matrix \(\mathbf{R}_k\).

Return type:

np.ndarray

previous

navlie.types.MeasurementModel

next

navlie.types.State

© Copyright 2022.

Created using Sphinx 7.1.2.