robokudo.annotators.location

Location annotator for RoboKudo.

This module provides an annotator for determining object locations relative to semantic regions. It supports:

  • Semantic map integration

  • Region-based location analysis

  • Percentage-based containment checks

  • World frame transformations

  • Multi-region handling

The module is used for:

  • Object localization

  • Spatial reasoning

  • Scene understanding

  • Region-based filtering

Classes

LocationAnnotator

Determine object locations within semantic regions.

Module Contents

class robokudo.annotators.location.LocationAnnotator(name='LocationAnnotator', descriptor=Descriptor())

Bases: robokudo.annotators.core.ThreadedAnnotator

Determine object locations within semantic regions.

The purpose of this location annotator is to receive a list of intriguing regions and incorporate the corresponding region names into the location annotations for objects that reside within those specific regions.

The annotator:

  • Loads and manages semantic map data

  • Transforms regions between world and camera frames

  • Checks object containment in regions

  • Creates location annotations for contained objects

  • Supports filtering by desired regions

  • Handles coordinate frame transformations

Variables:

semantic_map – Loaded semantic map instance

class Descriptor

Bases: robokudo.annotators.core.BaseAnnotator.Descriptor

Configuration descriptor for location annotator.

Variables:

parameters – Location analysis parameters

class Parameters

Parameter container for location configuration.

Variables:
  • percentage – Threshold percentage for region containment

  • world_frame_name – Name of the world coordinate frame

  • semantic_map_ros_package – ROS package containing semantic map

  • semantic_map_name – Name of semantic map descriptor

  • desired_regions – List of regions to consider

percentage = 50
world_frame_name = 'map'
semantic_map_ros_package = 'robokudo'
semantic_map_name = 'semantic_map_iai_kitchen'
desired_regions = ['kitchen_island']
parameters
semantic_map = None
load_semantic_map() None

Load semantic map from configured package and name.

Uses ModuleLoader to dynamically load the semantic map descriptor from the configured ROS package.

Returns:

None

add_location_in_object_hypotheses(region_name: str, region, world_to_cam_transform_matrix, object_hypotheses) None

Add location annotations to objects within a region.

For each object hypothesis:

  • Transforms region to camera frame

  • Checks point containment in region

  • Calculates containment percentage

  • Creates location annotation if above threshold

Parameters:
Returns:

None

compute()

Process object hypotheses to determine their locations.

The method:

  • Loads and updates semantic map

  • Gets camera to world transform

  • For each active region:
    • Checks if region is in desired list

    • Processes objects in region

    • Adds location annotations

Returns:

SUCCESS after processing

Return type:

py_trees.Status