robokudo.utils.semantic_map

Semantic map utilities for Robokudo.

This module provides functions for working with semantic map regions and their transformations to different coordinate frames. It supports:

  • Converting semantic map regions to oriented bounding boxes

  • Transforming regions between world and camera coordinates

  • Applying arbitrary transforms to regions

The module integrates with: * Open3D for geometric operations * NumPy for numerical computations * Semantic map system for region definitions

Functions

get_obb_from_semantic_map_region(...)

Create oriented bounding box from semantic map region.

get_obb_from_semantic_map_region_in_cam_coordinates(...)

Transform semantic map region to camera coordinates.

get_obb_from_semantic_map_region_with_transform_matrix(...)

Transform semantic map region by arbitrary transform.

Module Contents

robokudo.utils.semantic_map.get_obb_from_semantic_map_region(region: robokudo.semantic_map.SemanticMapEntry) open3d.geometry.OrientedBoundingBox

Create oriented bounding box from semantic map region.

Instantiate an Open3D OrientedBoundingBox that represents a Semantic Map region. It can be used to crop pointclouds. It doesn’t carry any frame information, so make sure to translate/rotate it to the desired coordinate frame if necessary.

Note

The returned box does not carry frame information. Transform it to the desired coordinate frame if needed.

Parameters:

region (robokudo.semantic_map.SemanticMapEntry) – A semantic map entry that defines the region of interest in 3D

Returns:

The bounding box with the pose and extent defined by region

Return type:

o3d.geometry.OrientedBoundingBox

robokudo.utils.semantic_map.get_obb_from_semantic_map_region_in_cam_coordinates(region: robokudo.semantic_map.SemanticMapEntry, world_frame_name: str, world_to_cam_transform_matrix: numpy.ndarray) open3d.geometry.OrientedBoundingBox

Transform semantic map region to camera coordinates.

Creates oriented bounding box and transforms it to camera frame if needed.

Parameters:
  • region (robokudo.semantic_map.SemanticMapEntry) – Semantic map region definition

  • world_frame_name (str) – Name of world coordinate frame

  • world_to_cam_transform_matrix (numpy.ndarray) – 4x4 world-to-camera transform

Returns:

Oriented bounding box in camera coordinates

Return type:

o3d.geometry.OrientedBoundingBox

Note

If region is not in world frame, assumes region frame matches camera frame. TODO: Add proper TF-based transform for other frames.

robokudo.utils.semantic_map.get_obb_from_semantic_map_region_with_transform_matrix(region: robokudo.semantic_map.SemanticMapEntry, transform_matrix: numpy.ndarray) open3d.geometry.OrientedBoundingBox

Transform semantic map region by arbitrary transform.

Creates oriented bounding box and applies provided transform.

Parameters:
Returns:

Transformed oriented bounding box

Return type:

o3d.geometry.OrientedBoundingBox