robotics_signals/sensors/
magnetic_field.rs

1use cdds_derive::*;
2use cyclonedds_rs::*;
3use serde_derive::{Deserialize, Serialize};
4
5use crate::{geometry::Vector3, standard::Header};
6
7#[repr(C)]
8#[derive(Serialize, Deserialize, Topic)]
9pub struct MagneticField {
10    /// timestamp is the time the
11    /// field was measured
12    /// frame_id is the location and orientation
13    /// of the field measurement
14    pub header: Header,
15
16    /// x, y, and z components of the
17    /// field vector in Tesla
18    /// If your sensor does not output 3 axes,
19    /// put NaNs in the components not reported.    
20    pub magnetic_field: Vector3,
21
22    /// Row major about x, y, z axes
23    /// 0 is interpreted as variance unknown
24    pub magnetic_field_covariance: [f64; 9],
25}