|
6 | 6 | //! to estimate the position and velocity of the sensor. While utilities exist for IMU data, this crate does |
7 | 7 | //! not currently support IMU output directly and should not be thought of as a full inertial navigation system |
8 | 8 | //! (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. |
10 | 11 | //! |
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: |
19 | 13 | //! - [`nav-types`](https://crates.io/crates/nav-types): Provides basic coordinate types and conversions. |
20 | 14 | //! - [`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). |
21 | 16 | //! |
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. |
29 | 24 | //! |
30 | | -//! # Strapdown mechanization data and equations |
| 25 | +//! ## Strapdown mechanization data and equations |
31 | 26 | //! |
32 | 27 | //! This crate contains the implementation details for the strapdown navigation equations implemented in the Local |
33 | 28 | //! Navigation Frame. The equations are based on the book _Principles of GNSS, Inertial, and Multisensor Integrated |
|
47 | 42 | //! - $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. |
48 | 43 | //! - $\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). |
49 | 44 | //! |
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. |
51 | 46 | //! |
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 |
54 | 50 | //! 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 |
56 | 52 | //! act on the given probability distribution and are largely ambivilent to the actual function and use generic representations |
57 | 53 | //! in thier mathematics. |
58 | 54 | //! |
59 | 55 | //! The equations are based on the book _Principles of GNSS, Inertial, and Multisensor Integrated Navigation Systems, Second Edition_ |
60 | 56 | //! by Paul D. Groves. Below is a summary of the equations implemented in Chapter 5.4 implemented by this module. |
61 | 57 | //! |
62 | | -//! ### Skew-Symmetric notation |
| 58 | +//! #### Skew-Symmetric notation |
63 | 59 | //! |
64 | 60 | //! 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 |
66 | 62 | //! letter for vector quantities (arrays of shape (N,) Python-style, or (N,1) nalgebra/Matlab style) and capital letters for the |
67 | 63 | //! skew-symmetric matrix representation of the same vector. |
68 | 64 | //! |
69 | 65 | //! $$ |
70 | 66 | //! x = \begin{bmatrix} a \\\\ b \\\\ c \end{bmatrix} \rightarrow X = \begin{bmatrix} 0 & -c & b \\\\ c & 0 & -a \\\\ -b & a & 0 \end{bmatrix} |
71 | 67 | //! $$ |
72 | 68 | //! |
73 | | -//! ### Attitude update |
| 69 | +//! #### Attitude update |
74 | 70 | //! |
75 | 71 | //! Given a direction-cosine matrix $C_b^n$ representing the orientation (attitude, rotation) of the platform's body frame ($b$) |
76 | 72 | //! with respect to the local level frame ($n$), the transport rate $\Omega_{en}^n$ representing the rotation of the local level frame |
|
88 | 84 | //! f_{ib}^n \approx \frac{1}{2} \left( C_b^n(+) + C_b^n(-) \right) f_{ib}^b |
89 | 85 | //! $$ |
90 | 86 | //! |
91 | | -//! ### Velocity Update |
| 87 | +//! #### Velocity Update |
92 | 88 | //! |
93 | 89 | //! The velocity update equation is given by: |
94 | 90 | //! |
95 | 91 | //! $$ |
96 | 92 | //! v(+) \approx v(-) + \left( f_{ib}^n + g_{b}^n - \left( \Omega_{en}^n - \Omega_{ie}^e \right) v(-) \right) t |
97 | 93 | //! $$ |
98 | 94 | //! |
99 | | -//! ### Position update |
| 95 | +//! #### Position update |
100 | 96 | //! |
101 | 97 | //! Finally, we update the base position states in three steps. First we update the altitude: |
102 | 98 | //! |
|
116 | 112 | //! 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 |
117 | 113 | //! $$ |
118 | 114 | //! |
| 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. |
119 | 117 |
|
120 | 118 | pub mod earth; |
121 | 119 | pub mod filter; |
|
0 commit comments