Occupancy Extension [omni.isaac.occupancy_map]¶
-
class
Generator
¶ Bases:
pybind11_builtins.pybind11_object
This class is used to generate an occupancy map for a USD stage. Assuming the stage has collision geometry information, the following code can be used to generate the occupancy map information
Example
import omni from omni.isaac.occupancy_map import _occupancy_map physx = omni.physx.acquire_physx_interface() stage_id = omni.usd.get_context().get_stage_id() generator = _occupancy_map.Generator(physx, stage_id) generator.update_settings(5, 4, 5, 6) # Set location to map from and the min and max bounds to map to generator.set_transform((0, 0, 0), (-200, -200, 0), (200, 200, 0)) generator.generate() # Get locations of the occupied cells in the stage points = generator.get_occupied_positions() # Get computed 2d occupancy buffer buffer = generator.get_buffer() # Get dimensions for 2d buffer dims = generator.get_dimensions()
-
__init__
(self: omni.isaac.occupancy_map._occupancy_map.Generator, arg0: omni::physx::IPhysx, arg1: int) → None¶ - Parameters
Pointer to PhysX interface (arg0) –
Stage ID for the USD stage to map (arg1) –
-
generate
(self: omni.isaac.occupancy_map._occupancy_map.Generator) → None¶ Main function that generates a map based on the settings and transform set
-
get_buffer
(self: omni.isaac.occupancy_map._occupancy_map.Generator) → List[float]¶ - Returns
2D array containing values for each cell in the occupancy map.
- Return type
list
offloat
-
get_colored_byte_buffer
(self: omni.isaac.occupancy_map._occupancy_map.Generator, arg0: carb._carb.Int4, arg1: carb._carb.Int4, arg2: carb._carb.Int4) → List[str]¶ Convenience function to generate an image from the occupancy map
- Parameters
arg0 (
carb.Int4
) – RGBA Value used to denote an occupied cellarg1 (
carb.Int4
) – RGBA Value used to denote an unoccupied cellarg2 (
carb.Int4
) – RGBA Value used to denote unknown areas that could not be reached from the starting location
- Returns
Flattened buffer containing list of RGBA values for each pixel. Can be used to render as image directly
- Return type
list
ofint
-
get_dimensions
(self: omni.isaac.occupancy_map._occupancy_map.Generator) → carb._carb.Int2¶ - Returns
Dimensions for output buffer
- Return type
carb.Int2
-
get_free_positions
(self: omni.isaac.occupancy_map._occupancy_map.Generator) → List[carb._carb.Float2]¶ - Returns
List of 2d points in stage coordinates containing free locations.
- Return type
list
ofcarb.Float2
-
get_max_bound
(self: omni.isaac.occupancy_map._occupancy_map.Generator) → carb._carb.Float2¶ - Returns
Maximum bound for generated occupancy map instage coordinates
- Return type
carb.Float2
-
get_min_bound
(self: omni.isaac.occupancy_map._occupancy_map.Generator) → carb._carb.Float2¶ - Returns
Minimum bound for generated occupancy map instage coordinates
- Return type
carb.Float2
-
get_occupied_positions
(self: omni.isaac.occupancy_map._occupancy_map.Generator) → List[carb._carb.Float2]¶ - Returns
List of 2d points in stage coordinates containing occupied locations.
- Return type
list
ofcarb.Float2
-
set_transform
(self: omni.isaac.occupancy_map._occupancy_map.Generator, arg0: carb._carb.Float3, arg1: carb._carb.Float3, arg2: carb._carb.Float3) → None¶ Set origin and bounds for mapping
- Parameters
arg0 (
carb.Float3
) – Origin in stage to start mapping from, must be in unoccupied spacearg1 (
carb.Float3
) – Minimum bound to map up toarg2 (
carb.Float3
) – Maximum bound to map up to
-
update_settings
(self: omni.isaac.occupancy_map._occupancy_map.Generator, arg0: float, arg1: float, arg2: float, arg3: float) → None¶ Updates settings used for generating the occupancy map
- Parameters
arg0 (
float
) – Size of the cell in stage units, resolution of the gridarg1 (
float
) – Value used to denote an occupied cellarg2 (
float
) – Value used to denote an unoccupied cellarg3 (
float
) – Value used to denote unknown areas that could not be reached from the starting location
-