pub struct MapPoint {
pub x: i32,
pub y: i32,
pub point_type: MapPointType,
pub confidence: u8,
pub timestamp: CompactTimestamp,
pub observer_id: NodeId,
}Available on crate feature
robotics only.Expand description
Individual map point with metadata
Fields§
§x: i32X coordinate (millimeters)
y: i32Y coordinate (millimeters)
point_type: MapPointTypePoint type
confidence: u8Confidence level (0-255)
timestamp: CompactTimestampTimestamp when point was observed
observer_id: NodeIdRobot that observed this point
Implementations§
Source§impl MapPoint
impl MapPoint
Sourcepub fn new(
x: i32,
y: i32,
point_type: MapPointType,
confidence: u8,
timestamp: u64,
observer_id: NodeId,
) -> Self
pub fn new( x: i32, y: i32, point_type: MapPointType, confidence: u8, timestamp: u64, observer_id: NodeId, ) -> Self
Creates a new map point
Sourcepub fn grid_key(&self, grid_size: i32) -> (i32, i32)
pub fn grid_key(&self, grid_size: i32) -> (i32, i32)
Returns the grid key for this point (for spatial indexing)
Sourcepub fn distance_squared(&self, other: &MapPoint) -> u64
pub fn distance_squared(&self, other: &MapPoint) -> u64
Calculates distance squared to another point
Sourcepub fn should_override(&self, other: &MapPoint) -> bool
pub fn should_override(&self, other: &MapPoint) -> bool
Returns true if this point should override another based on confidence and timestamp
Trait Implementations§
impl Copy for MapPoint
impl Eq for MapPoint
impl StructuralPartialEq for MapPoint
Auto Trait Implementations§
impl Freeze for MapPoint
impl RefUnwindSafe for MapPoint
impl Send for MapPoint
impl Sync for MapPoint
impl Unpin for MapPoint
impl UnwindSafe for MapPoint
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