pub struct IMUData {
pub accel: Vector3<f64>,
pub gyro: Vector3<f64>,
}
Expand description
Basic structure for holding IMU data in the form of acceleration and angular rate vectors.
The vectors are the body frame of the vehicle and represent relative movement. This structure and library is not intended to be a hardware driver for an IMU, thus the data is assumed to be pre-processed and ready for use in the mechanization equations (the IMU processing has already filtered out gravitational acceleration).
Fields§
§accel: Vector3<f64>
§gyro: Vector3<f64>
Implementations§
Source§impl IMUData
impl IMUData
Sourcepub fn new_from_vector(accel: Vector3<f64>, gyro: Vector3<f64>) -> IMUData
pub fn new_from_vector(accel: Vector3<f64>, gyro: Vector3<f64>) -> IMUData
Create a new IMUData instance from acceleration and gyro vectors
The vectors are in the body frame of the vehicle and represent relative movement. The acceleration vector is in m/s^2 and the gyro vector is in rad/s.
§Arguments
accel
- A Vector3 representing the acceleration in m/s^2 in the body frame x, y, z axis.gyro
- A Vector3 representing the angular rate in rad/s in the body frame x, y, z axis.
§Returns
- An IMUData instance containing the acceleration and gyro vectors.
§Example
use strapdown::IMUData;
use nalgebra::Vector3;
let imu_data = IMUData::new_from_vector(
Vector3::new(0.0, 0.0, -9.81), // free fall acceleration in m/s^2
Vector3::new(0.0, 0.0, 0.0) // No rotation
);
Sourcepub fn new_from_vec(accel: Vec<f64>, gyro: Vec<f64>) -> IMUData
pub fn new_from_vec(accel: Vec<f64>, gyro: Vec<f64>) -> IMUData
Create a new IMUData instance from acceleration and gyro vectors in Vec
The vectors are in the body frame of the vehicle and represent relative movement. The acceleration vector is in m/s^2 and the gyro vector is in rad/s.
§Arguments
accel
- A Vector3 representing the acceleration in m/s^2 in the body frame x, y, z axis.gyro
- A Vector3 representing the angular rate in rad/s in the body frame x, y, z axis.
§Returns
- An IMUData instance containing the acceleration and gyro vectors.
§Example
use strapdown::IMUData;
let imu_data = IMUData::new_from_vec(
vec![0.0, 0.0, -9.81], // free fall acceleration in m/s^2
vec![0.0, 0.0, 0.0] // No rotation
);
Trait Implementations§
impl Copy for IMUData
Auto Trait Implementations§
impl Freeze for IMUData
impl RefUnwindSafe for IMUData
impl Send for IMUData
impl Sync for IMUData
impl Unpin for IMUData
impl UnwindSafe for IMUData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.