robokudo.semantic_map¶
Semantic map management for RoboKudo.
This module provides classes for managing semantic maps in RoboKudo. A semantic map represents the environment as a collection of named regions with spatial properties. The module supports:
Storage and retrieval of semantic map entries
Visualization of regions using ROS markers
Region definitions with position, orientation and size
Classes¶
A single entry in a semantic map. |
|
Base class for managing semantic maps. |
Module Contents¶
- class robokudo.semantic_map.SemanticMapEntry¶
-
Bases:
robokudo.defs.Region3DWithNameA single entry in a semantic map.
This class extends Region3DWithName to add semantic information to regions. Each entry has a reference frame ID and a semantic type.
- frame_id: str = ''¶
-
The reference frame this region is defined in
- type: str = ''¶
-
The semantic type of this region (e.g. “CounterTop”)
- plane_equation: typing_extensions.List[float] = None¶
-
Plane equation coefficients
- class robokudo.semantic_map.BaseSemanticMap¶
-
Base class for managing semantic maps.
This class provides functionality to store and visualize semantic map entries. Each entry represents a named region in the environment with spatial properties. The map can be visualized using ROS visualization markers.
- entries: typing_extensions.Dict¶
-
Dictionary mapping region names to SemanticMapEntry objects.
- node: rclpy.node.Node¶
-
ROS node for publishing visualization markers.
- vis_publisher: rclpy.publisher.Publisher¶
-
ROS publisher for visualization markers
- add_entry(entry: SemanticMapEntry) None¶
-
Add a single semantic map entry.
- Parameters:
-
entry – The semantic map entry to add
- Raises:
-
Exception – If the entry has no name attribute
- add_entries(entries: typing_extensions.List[SemanticMapEntry]) None¶
-
Add multiple semantic map entries.
- Parameters:
-
entries – List of semantic map entries to add
- publish_visualization_markers(highlighted: typing_extensions.Set[str] = None, highlight_color: typing_extensions.Tuple[float, float, float] = (0.0, 1.0, 0.0), default_color: typing_extensions.Tuple[float, float, float] = (0.0, 0.0, 0.7)) None¶
-
Publish visualization markers for all map entries.
Creates and publishes ROS visualization markers for each semantic map entry. Each entry is visualized as a cube with a text label showing its name.
- Parameters:
-
highlighted – Set of region names to highlight (default: None)
highlight_color – Color to use for highlighted regions (default: green)
default_color – Color to use for non-highlighted regions (default: dark blue)