robotics_signals/sensors/relative_humidity.rs
1use cdds_derive::*;
2use cyclonedds_rs::*;
3use serde_derive::{Deserialize, Serialize};
4
5use crate::standard::Header;
6
7/// Single reading from a relative humidity sensor.
8/// Defines the ratio of partial pressure of water vapor to the saturated vapor
9/// pressure at a temperature.
10
11#[repr(C)]
12#[derive(Serialize, Deserialize, Topic)]
13pub struct RelativeHumdity {
14 // timestamp of the measurement
15 // frame_id is the location of the humidity sensor
16 pub header: Header,
17
18 /// Expression of the relative humidity
19 /// from 0.0 to 1.0.
20 /// 0.0 is no partial pressure of water vapor
21 /// 1.0 represents partial pressure of saturation
22 pub relative_humidity: f64,
23
24 /// 0 is interpreted as variance unknown
25 pub variance: f64,
26}