pub struct KalmanState {
pub timestamp: f64,
pub position_m: [f64; 3],
pub velocity_ms: [f64; 3],
pub quaternion: [f64; 4],
pub accel_bias: [f64; 3],
pub gyro_bias: [f64; 3],
pub cov_diagonal: [f64; 15],
}Expand description
The fused navigation state from a Kalman filter.
State vector: position (3), velocity (3), orientation quaternion (4), accelerometer bias (3), gyroscope bias (3) → total 16 scalars. The covariance diagonal (15 terms) is stored separately.
Fields§
§timestamp: f64Timestamp in seconds.
position_m: [f64; 3]Position [x, y, z] in metres (ECEF or local NED depending on frame).
velocity_ms: [f64; 3]Velocity [vx, vy, vz] in m/s.
quaternion: [f64; 4]Orientation quaternion [qw, qx, qy, qz] (unit quaternion).
accel_bias: [f64; 3]Accelerometer bias estimate [bax, bay, baz] in m/s².
gyro_bias: [f64; 3]Gyroscope bias estimate [bgx, bgy, bgz] in rad/s.
cov_diagonal: [f64; 15]Diagonal of the 15×15 error covariance matrix.
Implementations§
Source§impl KalmanState
impl KalmanState
Sourcepub fn identity(timestamp: f64) -> Self
pub fn identity(timestamp: f64) -> Self
Create a new Kalman state with identity quaternion and zero everything else.
Sourcepub fn quaternion_is_unit(&self) -> bool
pub fn quaternion_is_unit(&self) -> bool
Check that the quaternion is (approximately) normalised.
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Serialize to bytes (timestamp 8B + 3+3+4+3+3 f64s + 15 cov f64s = 8+95×8 = 768B).
Sourcepub fn from_bytes(data: &[u8]) -> Option<Self>
pub fn from_bytes(data: &[u8]) -> Option<Self>
Deserialize from bytes.
Trait Implementations§
Source§impl Clone for KalmanState
impl Clone for KalmanState
Source§fn clone(&self) -> KalmanState
fn clone(&self) -> KalmanState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for KalmanState
impl RefUnwindSafe for KalmanState
impl Send for KalmanState
impl Sync for KalmanState
impl Unpin for KalmanState
impl UnsafeUnpin for KalmanState
impl UnwindSafe for KalmanState
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.