robokudo.annotators.location

Location annotator for RoboKudo.

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

  • World descriptor 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: str = 'LocationAnnotator', descriptor: LocationAnnotator = 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 world descriptor 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

class Descriptor

Bases: robokudo.annotators.core.BaseAnnotator.Descriptor

Configuration descriptor for location annotator.

class Parameters

Parameter container for location configuration.

percentage: int = 50

Threshold percentage for an object to be considered in a region

world_frame_name: str = 'map'

Name of the world coordinate frame

desired_regions: typing_extensions.List[str] = ['kitchen_island']

List of region names to consider. Leave empty to include all regions.

parameters
add_location_in_object_hypotheses(region: semantic_digital_twin.world_description.world_entity.Region, world_to_cam_transform_matrix: numpy.typing.NDArray, object_hypotheses: collections.abc.Iterable[robokudo.types.scene.ObjectHypothesis]) 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:
  • region – Semantic map region entry

  • world_to_cam_transform_matrix – Transform from world to camera frame

  • object_hypotheses – List of object hypotheses to check

compute() py_trees.common.Status

Process object hypotheses to determine their locations.

The method:

  • Loads and updates world descriptor

  • 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