pub struct PointCloud {
pub header: PointCloudHeader,
pub decompressed_buffer: Vec<u8>,
}
Expand description
PointCloud struct
Usage:
use pcd_reader::PointCloud;
let filename = "sample/sample_binary_compressed.pcd";
let pcd = PointCloud::from_filename(filename);
let x_data = pcd.get_data_f32("x");
let y_data = pcd.get_data_f32("y");
let z_data = pcd.get_data_f32("z");
let intensity_data = pcd.get_data_u8("intensity");
let ring_data = pcd.get_data_u8("ring");
assert_eq!(pcd.header.data_format, "binary_compressed");
assert_eq!(pcd.header.num_points, 159602);
assert_eq!(pcd.header.field_names, ["x", "y", "z", "intensity", "ring"]);
assert_eq!(pcd.header.size_list, [4, 4, 4, 1, 1]);
assert_eq!(pcd.header.type_list, ["F", "F", "F", "U", "U"]);
assert_eq!(pcd.decompressed_buffer.len(), 2234428);
assert_eq!(x_data.len(), 159602);
assert_eq!(y_data.len(), 159602);
assert_eq!(z_data.len(), 159602);
assert_eq!(intensity_data.len(), 159602);
assert_eq!(ring_data.len(), 159602);
Fields§
§header: PointCloudHeader
§decompressed_buffer: Vec<u8>
Implementations§
Source§impl PointCloud
impl PointCloud
pub fn from_filename(filename: &str) -> PointCloud
pub fn get_data_f32(&self, fieldname: &str) -> Vec<f32>
pub fn get_data_f64(&self, fieldname: &str) -> Vec<f64>
pub fn get_data_u8(&self, fieldname: &str) -> Vec<u8>
pub fn get_data_u16(&self, fieldname: &str) -> Vec<u16>
pub fn get_data_u32(&self, fieldname: &str) -> Vec<u32>
pub fn get_data_u64(&self, fieldname: &str) -> Vec<u64>
pub fn get_data_i16(&self, fieldname: &str) -> Vec<i16>
pub fn get_data_i32(&self, fieldname: &str) -> Vec<i32>
pub fn get_data_i64(&self, fieldname: &str) -> Vec<i64>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PointCloud
impl RefUnwindSafe for PointCloud
impl Send for PointCloud
impl Sync for PointCloud
impl Unpin for PointCloud
impl UnwindSafe for PointCloud
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