robokudo.annotators.region_filter ================================= .. py:module:: robokudo.annotators.region_filter .. autoapi-nested-parse:: Point cloud filtering based on semantic regions. This module provides an annotator for: * Filtering point clouds using semantic map regions * Supporting regions in world and local frames * Creating region hypotheses with poses * Visualizing filtered regions and clouds The module uses: * Semantic maps to define regions of interest * Frame transformations for region alignment * Oriented bounding boxes for point filtering .. note:: Regions can be defined in either world frame or local frames. Classes ------- .. autoapisummary:: robokudo.annotators.region_filter.RegionFilter Module Contents --------------- .. py:class:: RegionFilter(name='RegionFilter', descriptor=Descriptor()) Bases: :py:obj:`robokudo.annotators.core.ThreadedAnnotator` Point cloud filtering using semantic map regions. The RegionFilter can be used to filter point clouds based on a environment model based on different regions. These regions are collected in a 'SemanticMap' which has one 'SemanticMapEntry' per region of interest. Semantics to these regions are linked by referencing well-known names from your URDF and/or knowledge base. .. note:: Regions are defined in a SemanticMap with SemanticMapEntry objects. .. py:class:: Descriptor Bases: :py:obj:`robokudo.annotators.core.BaseAnnotator.Descriptor` Configuration descriptor for region filtering. .. py:class:: Parameters Parameters for configuring region filtering. Frame parameters: :ivar world_frame_name: Name of the world coordinate frame, defaults to "map" :type world_frame_name: str Semantic map parameters: :ivar semantic_map_ros_package: ROS package containing semantic map, defaults to "robokudo" :type semantic_map_ros_package: str :ivar semantic_map_name: Name of semantic map module, defaults to "semantic_map_iai_kitchen" :type semantic_map_name: str Region selection: :ivar active_region: Name of active region to filter, empty for all regions :type active_region: str .. py:attribute:: world_frame_name :value: 'map' .. py:attribute:: semantic_map_ros_package :value: 'robokudo' .. py:attribute:: semantic_map_name :value: 'semantic_map_iai_kitchen' .. py:attribute:: active_region :value: '' .. py:attribute:: parameters .. py:attribute:: world_frame_name .. py:attribute:: semantic_map :value: None .. py:attribute:: active_region .. py:method:: load_semantic_map() -> None Load semantic map from configured package and module. Uses ModuleLoader to dynamically load the semantic map module. .. py:method:: compute() Filter point cloud using semantic map regions. The method: * Loads point cloud and query from CAS * Updates semantic map and active regions * For each active region: * Transforms region to camera frame * Creates oriented bounding box * Filters points within box * Creates region hypothesis with pose * Updates CAS with filtered cloud * Creates visualization markers :return: SUCCESS after processing :rtype: py_trees.Status :raises Exception: If queried region not found in map