navlie.utils.common.GaussianResultList¶
- class navlie.utils.common.GaussianResultList(result_list: List[GaussianResult])¶
Bases:
object
A data container that accepts a list of
GaussianResult
objects and stacks the attributes in numpy arrays. Convenient for plotting. This object does nothing more than array-ifying the attributes ofGaussianResult
.This object also supports slicing, which will return a new
GaussianResultList
object with the sliced attributes either through time or through the degrees of freedom themselves. For example,results = GaussianResultList.from_estimates(estimates, state_true_list) results[0:10] # returns the first 10 time steps results[:, 0] # returns the first degree of freedom results[0:10, 0] # returns the first degree of freedom for the first 10 time steps results[0:10, [0, 1]] # returns the first two degrees of freedom for the first 10 time steps results[:, 3:] # returns all degrees of freedom except the first three
This can be very useful if you want to examine the nees or rmse of just some states, or if you want to plot the error of just some states. For example, if you have an SE3State, where the first 3 degrees of freedom are attitude, and the last 3 are position, you can plot only the attitude error with
nav.plot_error(results[:, 0:3])
and likewise get only the attitude NEES with
results[:, 0:3].nees
.- Parameters:
result_list (List[GaussianResult]) – A list of GaussianResult, intended such that each element corresponds to a different time point
Let
N = len(result_list)
- stamp¶
timestamp
- Type:
numpy.ndarray with shape (N,)
- error¶
error throughout trajectory
- Type:
numpy.ndarray with shape (N, dof)
- ees¶
EES throughout trajectory
- Type:
numpy.ndarray with shape (N,)
- rmse¶
EES throughout trajectory
- Type:
numpy.ndarray with shape (N,)
- nees¶
NEES throughout trajectory
- Type:
numpy.ndarray with shape (N,)
- md¶
Mahalanobis distance throughout trajectory
- Type:
numpy.ndarray with shape (N,)
- three_sigma¶
three-sigma bounds
- Type:
numpy.ndarray with shape (N, dof)
- value¶
state value. type depends on implementation
- Type:
numpy.ndarray with shape (N,)
- dof¶
dof throughout trajectory
- Type:
numpy.ndarray with shape (N,)
- value_true¶
true state value. type depends on implementation
- Type:
numpy.ndarray with shape (N,)
- nees_lower_bound(confidence_interval: float)¶
Calculates the NEES lower bound throughout the trajectory.
- Parameters:
confidence_interval (float) – Single-sided cumulative probability threshold that defines the bound. Must be between 0 and 1
- Returns:
NEES value corresponding to confidence interval
- Return type:
numpy.ndarray with shape (N,)
An example of how to make a NEES plot with both upper and lower bounds:
ax.plot(results.stamp, results.nees) ax.plot(results.stamp, results.nees_lower_bound(0.99)) ax.plot(results.stamp, results.nees_upper_bound(0.99))
- nees_upper_bound(confidence_interval: float, double_sided=True)¶
Calculates the NEES upper bound throughout the trajectory
- Parameters:
- Returns:
numpy.ndarray with shape (N,) – NEES value corresponding to confidence interval
An example of how to make a NEES plot with only upper bounds
.. code-block:: python – ax.plot(results.stamp, results.nees) ax.plot(results.stamp, results.nees_upper_bound(0.99, double_sided=False))
- static from_estimates(estimate_list: List[StateWithCovariance], state_true_list: List[State], method='nearest')¶
A convenience function that creates a GaussianResultList from a list of StateWithCovariance and a list of true State objects
- Parameters:
estimate_list (List[StateWithCovariance]) – A list of StateWithCovariance objects
state_true_list (List[State]) – A list of true State objects
method ("nearest" or "linear", optional) – The method used to interpolate the true state when the timestamps do not line up exactly, by default “nearest”.
- Returns:
A GaussianResultList object
- Return type: