pcd_reader

Struct PointCloud

Source
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

Source

pub fn from_filename(filename: &str) -> PointCloud

Source

pub fn get_data_f32(&self, fieldname: &str) -> Vec<f32>

Source

pub fn get_data_f64(&self, fieldname: &str) -> Vec<f64>

Source

pub fn get_data_u8(&self, fieldname: &str) -> Vec<u8>

Source

pub fn get_data_u16(&self, fieldname: &str) -> Vec<u16>

Source

pub fn get_data_u32(&self, fieldname: &str) -> Vec<u32>

Source

pub fn get_data_u64(&self, fieldname: &str) -> Vec<u64>

Source

pub fn get_data_i16(&self, fieldname: &str) -> Vec<i16>

Source

pub fn get_data_i32(&self, fieldname: &str) -> Vec<i32>

Source

pub fn get_data_i64(&self, fieldname: &str) -> Vec<i64>

Trait Implementations§

Source§

impl Debug for PointCloud

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.