pub struct LaserScan {
pub timestamp: u64,
pub angle_min: f32,
pub angle_max: f32,
pub angle_increment: f32,
pub time_increment: f32,
pub scan_time: f32,
pub range_min: f32,
pub range_max: f32,
pub ranges: Vec<f32>,
pub intensities: Option<Vec<f32>>,
pub frame_id: Option<String>,
}Expand description
2D laser scan data
Represents a planar laser scan (e.g., from RPLidar, Hokuyo)
Fields§
§timestamp: u64Timestamp in microseconds since epoch
angle_min: f32Start angle of the scan in radians
angle_max: f32End angle of the scan in radians
angle_increment: f32Angular distance between measurements in radians
time_increment: f32Time between measurements in seconds
scan_time: f32Time between scans in seconds
range_min: f32Minimum range value in meters
range_max: f32Maximum range value in meters
ranges: Vec<f32>Range data in meters (one per angle)
intensities: Option<Vec<f32>>Intensity data (optional)
frame_id: Option<String>Optional frame ID
Implementations§
Source§impl LaserScan
impl LaserScan
Sourcepub fn num_points(&self) -> usize
pub fn num_points(&self) -> usize
Returns the number of scan points
Sourcepub fn angle_at(&self, index: usize) -> Option<f32>
pub fn angle_at(&self, index: usize) -> Option<f32>
Returns the angle for a given index in radians
Sourcepub fn point_at(&self, index: usize) -> Option<(f32, f32)>
pub fn point_at(&self, index: usize) -> Option<(f32, f32)>
Converts scan point to (x, y) coordinates in meters
Sourcepub fn is_valid_range(&self, range: f32) -> bool
pub fn is_valid_range(&self, range: f32) -> bool
Checks if a range value is valid
Sourcepub fn valid_points(&self) -> Vec<(f32, f32)>
pub fn valid_points(&self) -> Vec<(f32, f32)>
Returns all valid points as (x, y) coordinates
Sourcepub fn age_micros(&self) -> u64
pub fn age_micros(&self) -> u64
Returns the age of this scan in microseconds
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LaserScan
impl<'de> Deserialize<'de> for LaserScan
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Message for LaserScan
Auto Trait Implementations§
impl Freeze for LaserScan
impl RefUnwindSafe for LaserScan
impl Send for LaserScan
impl Sync for LaserScan
impl Unpin for LaserScan
impl UnwindSafe for LaserScan
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more