From af31bee50e3f6aea8d1edb6b08e9f78341be5ef4 Mon Sep 17 00:00:00 2001 From: Markus Mayer Date: Sun, 14 Jul 2024 14:13:47 +0200 Subject: [PATCH] Remove variance functions from simulation Signed-off-by: Markus Mayer --- examples/simulation.rs | 9 +++------ src/gyro_free/filter.rs | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/examples/simulation.rs b/examples/simulation.rs index c1c1ba7..3960a84 100644 --- a/examples/simulation.rs +++ b/examples/simulation.rs @@ -619,9 +619,8 @@ fn main() -> Result<(), Box> { // Display estimated angles. let info = format!( - "φ = {:+0.02} ± {:+0.02} rad ({:+0.02}°)", + "φ = {:+0.02} ({:+0.02}°)", estimated_angles.roll_phi, - estimator.roll_variance().sqrt(), estimated_angles.roll_phi * 180.0 / std::f32::consts::PI, ); window.draw_text( @@ -634,9 +633,8 @@ fn main() -> Result<(), Box> { // Display estimated angles. let info = format!( - "θ = {:+0.02} ± {:+0.02} rad ({:+0.02}°)", + "θ = {:+0.02} ({:+0.02}°)", estimated_angles.pitch_theta, - estimator.pitch_variance().sqrt(), estimated_angles.pitch_theta * 180.0 / std::f32::consts::PI, ); window.draw_text( @@ -649,9 +647,8 @@ fn main() -> Result<(), Box> { // Display estimated angles. let info = format!( - "ψ = {:+0.02} ± {:+0.02} rad ({:+0.02}°)", + "ψ = {:+0.02} ({:+0.02}°)", estimated_angles.yaw_psi, - estimator.yaw_variance().sqrt(), estimated_angles.yaw_psi * 180.0 / std::f32::consts::PI, ); window.draw_text( diff --git a/src/gyro_free/filter.rs b/src/gyro_free/filter.rs index 55b8f99..34dc85f 100644 --- a/src/gyro_free/filter.rs +++ b/src/gyro_free/filter.rs @@ -9,7 +9,6 @@ use minikalman::buffers::types::*; use minikalman::extended::{ExtendedKalmanBuilder, ExtendedObservationBuilder}; use minikalman::matrix::MatrixDataType; use minikalman::prelude::*; -use num_traits::Zero; /// A magnetic field reference vector. pub type MagneticReference = MagnetometerReading;