robokudo.utils.knowledge ======================== .. py:module:: robokudo.utils.knowledge .. autoapi-nested-parse:: Object knowledge utilities for Robokudo. This module provides utility functions for working with object knowledge bases and transforming object representations. It supports: * Transform matrix generation from object knowledge * Bounding box calculations * Object knowledge base loading * Oriented bounding box generation for objects and their parts The module integrates with: * Open3D for geometric operations * NumPy for numerical computations * Object knowledge base system Functions --------- .. autoapisummary:: robokudo.utils.knowledge.get_quaternion_from_rotation_information robokudo.utils.knowledge.get_transform_matrix_from_object_knowledge robokudo.utils.knowledge.get_bb_size_from_object_knowledge robokudo.utils.knowledge.load_object_knowledge_base robokudo.utils.knowledge.get_obb_for_object_and_transform robokudo.utils.knowledge.get_obb_for_child_object_and_transform robokudo.utils.knowledge.get_obbs_for_object_and_childs Module Contents --------------- .. py:function:: get_quaternion_from_rotation_information(ok: robokudo.object_knowledge_base.ObjectKnowledge) -> typing_extensions.Tuple[float, float, float, float] Return a quaternion based on the rotation in ObjectKnowledge, and its type of rotation. If the pose type is EULER, then it will be converted to Quaternion beforehand. :param ok: Object knowledge containing pose information :return: [x, y, z, w] rotation quaternion .. py:function:: get_transform_matrix_from_object_knowledge(ok: robokudo.object_knowledge_base.ObjectKnowledge) -> numpy.typing.NDArray Extract transform matrix from object knowledge. Creates a 4x4 transformation matrix from the object's position and orientation. :param ok: Object knowledge containing pose information :return: 4x4 transformation matrix .. py:function:: get_bb_size_from_object_knowledge(ok: robokudo.object_knowledge_base.ObjectKnowledge) -> numpy.typing.NDArray Extract bounding box dimensions from object knowledge. :param ok: Object knowledge containing size information :return: Array of [x_size, y_size, z_size] .. py:function:: load_object_knowledge_base(annotator: robokudo.annotators.core.BaseAnnotator) -> robokudo.object_knowledge_base.BaseObjectKnowledgeBase Load object knowledge base from annotator parameters. :param annotator: Annotator containing knowledge base parameters :return: Loaded object knowledge base .. py:function:: get_obb_for_object_and_transform(object_knowledge: robokudo.object_knowledge_base.ObjectKnowledge, transform_matrix: numpy.typing.NDArray) -> open3d.geometry.OrientedBoundingBox Get an OBB only for THIS object and not any descendants. :param object_knowledge: :param transform_matrix: Transformation matrix describing the position of the object. This is usually used for objects that have been perceived and do not have fixed Position/Orientation information. :return: A OrientedBoundingbox .. py:function:: get_obb_for_child_object_and_transform(object_knowledge: robokudo.object_knowledge_base.ObjectKnowledge, parent_transform: numpy.typing.NDArray) -> open3d.geometry.OrientedBoundingBox Create oriented bounding box for child object. Creates an oriented bounding box for a child object by combining its local transform with the parent's transform. :param object_knowledge: Knowledge about the child object :param parent_transform: 4x4 transformation matrix of parent object :return: Oriented bounding box for child object .. py:function:: get_obbs_for_object_and_childs(object_knowledge: robokudo.object_knowledge_base.ObjectKnowledge, transform_matrix: numpy.typing.NDArray) -> typing_extensions.Dict[str, open3d.geometry.OrientedBoundingBox] Create oriented bounding boxes for object and all children. Creates oriented bounding boxes for: * Main object * Component parts * Feature parts :param object_knowledge: Knowledge about main object and its parts :param transform_matrix: 4x4 transformation matrix for main object :return: Dictionary mapping object names to bounding boxes