pub struct OccupancyGrid {
pub resolution: f32,
pub width: u32,
pub height: u32,
pub origin: Pose,
pub cells: Vec<i8>,
}Expand description
A 2-D occupancy costmap — std/nav/v1/OccupancyGrid, row-major.
Fields§
§resolution: f32The size of one cell, in metres.
width: u32The grid’s width in cells.
height: u32The grid’s height in cells.
origin: PoseThe pose of cell (0, 0).
cells: Vec<i8>width * height occupancy values, row-major: -1 unknown, 0..=100
the occupancy probability as a percentage.
Implementations§
Source§impl OccupancyGrid
impl OccupancyGrid
Sourcepub fn new(
resolution: f32,
width: u32,
height: u32,
origin: Pose,
cells: Vec<i8>,
) -> Result<Self>
pub fn new( resolution: f32, width: u32, height: u32, origin: Pose, cells: Vec<i8>, ) -> Result<Self>
A grid whose cell count matches its dimensions.
§Errors
DataError::ChildLengthMismatch when cells.len() != width * height.
Sourcepub fn cell_at(&self, x: u32, y: u32) -> Option<i8>
pub fn cell_at(&self, x: u32, y: u32) -> Option<i8>
The occupancy at (x, y), or None outside the grid.
Sourcepub fn check_dimensions(&self) -> Result<()>
pub fn check_dimensions(&self) -> Result<()>
Trait Implementations§
Source§impl AstrsMessage for OccupancyGrid
impl AstrsMessage for OccupancyGrid
Source§const URN: &'static str = "std/nav/v1/OccupancyGrid"
const URN: &'static str = "std/nav/v1/OccupancyGrid"
The type URN this message’s columnar layout is declared against
(blueprint §24.3), e.g.
"std/vision/v1/Detections".Source§fn data_type() -> DataType
fn data_type() -> DataType
The columnar layout
AstrsMessage::to_record_batch produces and
AstrsMessage::from_record_batch expects.Source§fn to_record_batch(&self) -> Result<RecordBatch>
fn to_record_batch(&self) -> Result<RecordBatch>
Encodes one message into a one-row
RecordBatch (blueprint §6.1’s
“one record batch per message”). Read moreSource§fn from_record_batch(batch: &RecordBatch) -> Result<Self>
fn from_record_batch(batch: &RecordBatch) -> Result<Self>
Decodes one message from a one-row
RecordBatch. Read moreSource§fn schema() -> Schema
fn schema() -> Schema
The single-column
Schema wrapping AstrsMessage::data_type
under crate::DATA_COLUMN (blueprint §6.1).Source§fn type_urn() -> Result<TypeUrn, TypeUrnError>
fn type_urn() -> Result<TypeUrn, TypeUrnError>
Parses
AstrsMessage::URN. Read moreSource§impl Clone for OccupancyGrid
impl Clone for OccupancyGrid
Source§impl Debug for OccupancyGrid
impl Debug for OccupancyGrid
Source§impl Default for OccupancyGrid
impl Default for OccupancyGrid
Source§impl FromPayload for OccupancyGrid
impl FromPayload for OccupancyGrid
Source§fn from_batch(batch: &RecordBatch) -> Result<Self>
fn from_batch(batch: &RecordBatch) -> Result<Self>
Reads the value from a decoded payload batch. Read more
Source§impl PartialEq for OccupancyGrid
impl PartialEq for OccupancyGrid
impl StructuralPartialEq for OccupancyGrid
Auto Trait Implementations§
impl Freeze for OccupancyGrid
impl RefUnwindSafe for OccupancyGrid
impl Send for OccupancyGrid
impl Sync for OccupancyGrid
impl Unpin for OccupancyGrid
impl UnsafeUnpin for OccupancyGrid
impl UnwindSafe for OccupancyGrid
Blanket Implementations§
impl<T> Allocation for T
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