pyrobosim.navigation.occupancy_grid.OccupancyGrid
- class pyrobosim.navigation.occupancy_grid.OccupancyGrid(data: ndarray, resolution: float, origin: Sequence[float] = (0.0, 0.0), occ_thresh: float = 0.65, free_thresh: float = 0.2)
Lightweight wrapper containing occupancy grid information.
Methods
__init__(data, resolution[, origin, ...])Creates an occupancy grid.
from_file(folder[, filename])Loads an occupancy grid from a folder containing a PGM image file and a YAML file.
from_world(world, resolution[, ...])Generates an occupancy grid of a world at a given resolution.
grid_to_world(pos)Convert a given world position in grid frame to world frame.
has_straight_line_connection(pointA, pointB)Checks if 2 points can be connected in a straight line.
is_in_bounds(pos)Check if a given (x,y) position is within grid limits
is_occupied(pos)Check if a given position in the grid is occupied
save_to_file(folder[, filename])Save occupancy grid to PGM and YAML files compatible with ROS tools.
show()Displays the occupancy grid as an image.
world_to_grid(pos)Convert a given world position in world frame to grid frame.