Skip to content

Commit bdb2299

Browse files
committed
added new documentation
1 parent c1ff6ec commit bdb2299

1 file changed

Lines changed: 24 additions & 26 deletions

File tree

core/src/strapdown.rs

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,23 @@
66
//! to estimate the position and velocity of the sensor. While utilities exist for IMU data, this crate does
77
//! not currently support IMU output directly and should not be thought of as a full inertial navigation system
88
//! (INS). This crate is designed to be used to test the filters that would be used in an INS. It does not
9-
//! provide utilities for reading raw output from the IMU or act as an IMU firmware or driver.
9+
//! provide utilities for reading raw output from the IMU or act as IMU firmware or driver. As such the IMU data
10+
//! is assumed to be pre-filtered and contain the total accelerations and relative rotations.
1011
//!
11-
//! As such the IMU data is assumed to be _relative_ accelerations and rotations with the orientation and gravity
12-
//! vector pre-filtered. Additional signals that can be derived using IMU data, such as gravity or magnetic vector
13-
//! and anomalies, should come be provided to this toolbox as a seperate sensor channel. In other words, to
14-
//! calculate the gravity vector the IMU output should be parsed to separately output the overall acceleration
15-
//! and rotation of the sensor whereas the navigation filter will use the gravity and orientation corrected
16-
//! acceleration and rotation to estimate the position
17-
//!
18-
//! Primarily built off of two crate dependencies:
12+
//! This crate is primarily built off of three additional dependencies:
1913
//! - [`nav-types`](https://crates.io/crates/nav-types): Provides basic coordinate types and conversions.
2014
//! - [`nalgebra`](https://crates.io/crates/nalgebra): Provides the linear algebra tools for the filters.
15+
//! - [`rand`](https://crates.io/crates/rand) and [`rand_distr`](https://crates.io/crates/rand_distr): Provides random number generation for noise and simulation (primarily for particle filter methods).
2116
//!
22-
//! All other functionality is built on top of these crates. The primary reference text is _Principles of GNSS,
23-
//! Inertial, and Multisensor Integrated Navigation Systems, 2nd Edition_ by Paul D. Groves. Where applicable,
24-
//! calculations will be referenced by the appropriate equation number tied to the book. In general, variables
25-
//! will be named according to the quantity they represent and not the symbol used in the book. For example,
26-
//! the Earth's equatorial radius is named `EQUATORIAL_RADIUS` instead of `a`. This style is sometimes relaxed
27-
//! within the body of a given function, but the general rule is to use descriptive names for variables and not
28-
//! mathematical symbols.
17+
//! All other functionality is built on top of these crates or is auxiliary functionality (e.g. I/O). The primary
18+
//! reference text is _Principles of GNSS, Inertial, and Multisensor Integrated Navigation Systems, 2nd Edition_
19+
//! by Paul D. Groves. Where applicable, calculations will be referenced by the appropriate equation number tied
20+
//! to the book. In general, variables will be named according to the quantity they represent and not the symbol
21+
//! used in the book. For example, the Earth's equatorial radius is named `EQUATORIAL_RADIUS` instead of `a`.
22+
//! This style is sometimes relaxed within the body of a given function, but the general rule is to use descriptive
23+
//! names for variables and not mathematical symbols.
2924
//!
30-
//! # Strapdown mechanization data and equations
25+
//! ## Strapdown mechanization data and equations
3126
//!
3227
//! This crate contains the implementation details for the strapdown navigation equations implemented in the Local
3328
//! Navigation Frame. The equations are based on the book _Principles of GNSS, Inertial, and Multisensor Integrated
@@ -47,30 +42,31 @@
4742
//! - $v_n$, $v_e$, and $v_d$ are the local level frame (NED/ENU) velocities (m/s) along the north axis, east axis, and vertical axis.
4843
//! - $\phi$, $\theta$, and $\psi$ are the Euler angles (radians) representing the orientation of the body frame relative to the local level frame (XYZ Euler rotation).
4944
//!
50-
//! The coordinate convention and order is in NED. ENU implementations are to be added in the future.
45+
//! The coordinate convention and order is in NED.
5146
//!
52-
//! ## Strapdown equations in the Local-Level Frame
53-
//! This crates implements the strapdown mechanization equations in the Local-Level Frame. These equations form the basis
47+
//! ### Strapdown equations in the Local-Level Frame
48+
//!
49+
//! This module implements the strapdown mechanization equations in the Local-Level Frame. These equations form the basis
5450
//! of the forward propagation step (motion/system/state-transition model) of all the filters implemented in this crate.
55-
//! The rational for this was to design and test it once, then re-used on the various filters which really only need to
51+
//! The rational for this was to design and test it once, then re-use it on the various filters which really only need to
5652
//! act on the given probability distribution and are largely ambivilent to the actual function and use generic representations
5753
//! in thier mathematics.
5854
//!
5955
//! The equations are based on the book _Principles of GNSS, Inertial, and Multisensor Integrated Navigation Systems, Second Edition_
6056
//! by Paul D. Groves. Below is a summary of the equations implemented in Chapter 5.4 implemented by this module.
6157
//!
62-
//! ### Skew-Symmetric notation
58+
//! #### Skew-Symmetric notation
6359
//!
6460
//! Groves uses a direction cosine matrix representation of orientation (attitude, rotation). As such, to make the matrix math
65-
//! work out, rotational quantities need to also be represented using matricies. As such, Groves' convention is to use a lower-case
61+
//! work out, rotational quantities need to also be represented using matricies. Groves' convention is to use a lower-case
6662
//! letter for vector quantities (arrays of shape (N,) Python-style, or (N,1) nalgebra/Matlab style) and capital letters for the
6763
//! skew-symmetric matrix representation of the same vector.
6864
//!
6965
//! $$
7066
//! x = \begin{bmatrix} a \\\\ b \\\\ c \end{bmatrix} \rightarrow X = \begin{bmatrix} 0 & -c & b \\\\ c & 0 & -a \\\\ -b & a & 0 \end{bmatrix}
7167
//! $$
7268
//!
73-
//! ### Attitude update
69+
//! #### Attitude update
7470
//!
7571
//! Given a direction-cosine matrix $C_b^n$ representing the orientation (attitude, rotation) of the platform's body frame ($b$)
7672
//! with respect to the local level frame ($n$), the transport rate $\Omega_{en}^n$ representing the rotation of the local level frame
@@ -88,15 +84,15 @@
8884
//! f_{ib}^n \approx \frac{1}{2} \left( C_b^n(+) + C_b^n(-) \right) f_{ib}^b
8985
//! $$
9086
//!
91-
//! ### Velocity Update
87+
//! #### Velocity Update
9288
//!
9389
//! The velocity update equation is given by:
9490
//!
9591
//! $$
9692
//! v(+) \approx v(-) + \left( f_{ib}^n + g_{b}^n - \left( \Omega_{en}^n - \Omega_{ie}^e \right) v(-) \right) t
9793
//! $$
9894
//!
99-
//! ### Position update
95+
//! #### Position update
10096
//!
10197
//! Finally, we update the base position states in three steps. First we update the altitude:
10298
//!
@@ -116,6 +112,8 @@
116112
//! p_e = p_e(-) + \frac{1}{2} \left( \frac{v_e(-)}{R_e + p_d(-) \cos(p_n(-))} + \frac{v_e(+)}{R_e + p_d(+) \cos(p_n(+))} \right) t
117113
//! $$
118114
//!
115+
//! This top-level module provides a public API for each step of the forward mechanization equations, allowing users to
116+
//! easily pass data in and out.
119117
120118
pub mod earth;
121119
pub mod filter;

0 commit comments

Comments
 (0)