pub struct CompassReading {
pub available: bool,
pub magnetic_heading_deg: f32,
pub true_heading_deg: f32,
pub heading_accuracy_deg: f32,
pub magnetic_field_ut: [f32; 3],
}Expand description
Magnetometer / compass telemetry.
Fields§
§available: bool§magnetic_heading_deg: f32Magnetic heading in degrees [0.0, 360.0) clockwise from magnetic north.
true_heading_deg: f32True geographic heading in degrees [0.0, 360.0) clockwise from true north.
heading_accuracy_deg: f32Estimated heading uncertainty in degrees.
magnetic_field_ut: [f32; 3]Raw magnetic flux density vector [x, y, z] in microteslas (uT).
Implementations§
Source§impl CompassReading
impl CompassReading
Sourcepub fn from_magnetic_field_ut(
magnetic_field_ut: [f32; 3],
declination_deg: f32,
) -> CompassReading
pub fn from_magnetic_field_ut( magnetic_field_ut: [f32; 3], declination_deg: f32, ) -> CompassReading
Computes normalized compass heading from a horizontal/3-axis magnetometer reading [mx, my, mz]
in microteslas (uT) and optional magnetic declination in degrees.
Trait Implementations§
Source§impl Clone for CompassReading
impl Clone for CompassReading
Source§fn clone(&self) -> CompassReading
fn clone(&self) -> CompassReading
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CompassReading
Source§impl Debug for CompassReading
impl Debug for CompassReading
Source§impl Default for CompassReading
impl Default for CompassReading
Source§fn default() -> CompassReading
fn default() -> CompassReading
Returns the “default value” for a type. Read more
Source§impl PartialEq for CompassReading
impl PartialEq for CompassReading
impl StructuralPartialEq for CompassReading
Auto Trait Implementations§
impl Forget for CompassReading
impl Freeze for CompassReading
impl Move for CompassReading
impl RefUnwindSafe for CompassReading
impl Send for CompassReading
impl Sync for CompassReading
impl Unpin for CompassReading
impl UnsafeUnpin for CompassReading
impl UnwindSafe for CompassReading
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
Mutably borrows from an owned value. Read more