robokudo.pipeline ================= .. py:module:: robokudo.pipeline .. autoapi-nested-parse:: Pipeline implementation for RoboKudo. This module provides the Pipeline class, which is a specialized version of py_trees' Sequence behavior. A Pipeline manages its own Common Analysis Structure (CAS) and provides visualization capabilities for its annotators. Key features: * Automatic CAS management for each pipeline iteration * Visualization support through annotator outputs * Helper methods for accessing annotators and CAS * Nested pipeline support with proper scoping Classes ------- .. autoapisummary:: robokudo.pipeline.Pipeline Module Contents --------------- .. py:class:: Pipeline(name='Sequence', children=None, *args, **kwargs) Bases: :py:obj:`py_trees.composites.Sequence` A RoboKudo pipeline composed of annotators with its own CAS. A Pipeline is a specialized sequence behavior that manages a Common Analysis Structure (CAS) for its annotators. It provides visualization capabilities and helper methods for accessing annotators and CAS data. :ivar cas: The Common Analysis Structure for this pipeline :type cas: :class:`robokudo.cas.CAS` :ivar cas_start_timer: Timer for measuring pipeline execution time :type cas_start_timer: float :ivar rk_logger: Logger instance for this pipeline :type rk_logger: :class:`logging.Logger` .. py:attribute:: cas :value: None .. py:attribute:: cas_start_timer :value: None .. py:attribute:: rk_logger :value: None .. py:method:: create_new_cas() Create a new Common Analysis Structure (CAS) for this pipeline. Also resets the execution timer. .. py:method:: setup(timeout: float = None, node: rclpy.node.Node = None, visitor=None) Set up the pipeline and its annotator outputs. Creates output structures for all annotators in the pipeline and marks them for initial rendering. :param timeout: Setup timeout in seconds :type timeout: float :param node: a ros node :type node: rclpy.node.Node :param visitor: :type visitor: :return: True if setup was successful :rtype: bool .. py:method:: get_cas() Get the pipeline's Common Analysis Structure. :return: The pipeline's CAS :rtype: :class:`robokudo.cas.CAS` .. py:method:: get_annotators() Get all annotators in this pipeline. Returns a list of all annotators in this pipeline, including those nested in other behaviors (except other pipelines). :return: List of annotators :rtype: list[:class:`robokudo.annotators.core.BaseAnnotator`] .. py:method:: pipeline_children() Get all children of this pipeline. Returns a list of all children in this pipeline, stopping at nested Pipeline objects. The order is given by utils.tree.behavior_iterate_except_type. :return: List of child behaviors :rtype: list[:class:`py_trees.behaviour.Behaviour`] .. py:method:: update() Update the pipeline's state. Handles pipeline execution status and triggers GUI updates on failure. :return: Execution status :rtype: :class:`py_trees.common.Status` .. py:method:: terminate(new_status) Handle pipeline termination. Called when the pipeline switches to a non-RUNNING state. Updates GUI on success and logs execution time statistics. :param new_status: New execution status :type new_status: :class:`py_trees.common.Status`