pub struct PointCloud { /* private fields */ }Expand description
A point set with named per-point fields —
std/sensor/v1/PointCloud[fields=…], structure-of-arrays.
Deliberately not sensor_msgs/PointCloud2’s packed byte blob: each field
keeps its own typed, SIMD-ready buffer, so nothing has to unpack a
row-major blob to read z.
The layout depends on the URN’s fields parameter, which a const URN
cannot express — this type therefore carries the names and renders its own
PointCloud::urn rather than implementing AstrsMessage.
Implementations§
Source§impl PointCloud
impl PointCloud
Sourcepub fn from_columns(columns: Vec<(String, Vec<f32>)>) -> Result<Self>
pub fn from_columns(columns: Vec<(String, Vec<f32>)>) -> Result<Self>
A cloud from its named columns.
§Errors
DataError::DuplicateFieldName when a name repeats, and
DataError::ColumnLengthMismatch when the columns disagree on how
many points they describe.
Sourcepub fn field_names(&self) -> Vec<&str>
pub fn field_names(&self) -> Vec<&str>
The field names, in declaration order.
Sourcepub fn to_record_batch(&self) -> Result<RecordBatch>
pub fn to_record_batch(&self) -> Result<RecordBatch>
Encodes the cloud as a one-row payload batch.
The inherent twin of AstrsMessage::to_record_batch; see the type’s
documentation for why the trait itself does not apply.
§Errors
DataError when the cloud is malformed or the columns cannot be
assembled.