Skip to main content

nominal_api/conjure/objects/scout/spatial/api/
point_cloud_metadata.rs

1/// Metadata about the sensor that captured a point cloud.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    conjure_object::private::DeriveWith
8)]
9#[serde(crate = "conjure_object::serde")]
10#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
11#[conjure_object::private::staged_builder::staged_builder]
12#[builder(crate = conjure_object::private::staged_builder, update, inline)]
13pub struct PointCloudMetadata {
14    #[builder(default, into)]
15    #[serde(rename = "sensorModel", skip_serializing_if = "Option::is_none", default)]
16    sensor_model: Option<String>,
17    #[builder(default, into)]
18    #[serde(
19        rename = "coordinateSystem",
20        skip_serializing_if = "Option::is_none",
21        default
22    )]
23    coordinate_system: Option<String>,
24    #[builder(default, into)]
25    #[serde(rename = "resolutionMm", skip_serializing_if = "Option::is_none", default)]
26    #[derive_with(with = conjure_object::private::DoubleWrapper)]
27    resolution_mm: Option<f64>,
28    #[builder(default, into)]
29    #[serde(rename = "scanPattern", skip_serializing_if = "Option::is_none", default)]
30    scan_pattern: Option<super::ScanPattern>,
31}
32impl PointCloudMetadata {
33    /// Constructs a new instance of the type.
34    #[inline]
35    pub fn new() -> Self {
36        Self::builder().build()
37    }
38    /// The sensor model name, e.g. "Velodyne VLP-16", "Ouster OS1-128".
39    #[inline]
40    pub fn sensor_model(&self) -> Option<&str> {
41        self.sensor_model.as_ref().map(|o| &**o)
42    }
43    /// Coordinate reference system identifier, e.g. "EPSG:4326", "ENU".
44    #[inline]
45    pub fn coordinate_system(&self) -> Option<&str> {
46        self.coordinate_system.as_ref().map(|o| &**o)
47    }
48    /// Spatial resolution of the point cloud in millimeters.
49    #[inline]
50    pub fn resolution_mm(&self) -> Option<f64> {
51        self.resolution_mm.as_ref().map(|o| *o)
52    }
53    /// The scan pattern of the lidar sensor.
54    #[inline]
55    pub fn scan_pattern(&self) -> Option<&super::ScanPattern> {
56        self.scan_pattern.as_ref().map(|o| &*o)
57    }
58}