robokudo.descriptors.analysis_engines.query_test¶
This script defines a Robokudo-based behavior tree pipeline for processing queries related to numbers.
Features: - Implements a PyTrees behavior tree to handle query processing. - Includes a PrintNumbers behavior that sequentially processes numbers from 1 to 10. - Utilizes a CheckQueryType annotator to validate if the query type is ‘numbers’. - Incorporates a conditional selector to manage task execution with preemption handling. - Integrates with the Robokudo analysis engine and pipeline framework. - Uses a feedback mechanism to report progress dynamically.
Classes¶
Base class for all RoboKudo annotators. |
|
Checks if the query type on the CAS is 'numbers'. |
|
Protocol defining the interface for Analysis Engines. |
Module Contents¶
- class robokudo.descriptors.analysis_engines.query_test.PrintNumbers(name='PrintNumbers')¶
-
Bases:
robokudo.annotators.core.BaseAnnotatorBase class for all RoboKudo annotators.
This class provides core functionality for CAS access, tree structure navigation, and GUI result handling. It serves as the foundation for implementing annotators in the RoboKudo framework.
- Parameters:
-
name (str, optional) – Name of the annotator instance, defaults to “Annotator”
descriptor (BaseAnnotator.Descriptor, optional) – Configuration descriptor for the annotator, defaults to Descriptor()
ros_pkg_name (str, optional) – Name of the ROS package, defaults to robokudo.defs.PACKAGE_NAME
- current_number = 1¶
- completed = False¶
- result = []¶
- result_string = ''¶
- initialise()¶
-
Initialize the annotator state.
Called when first tick is received and anytime status is not running.
- update()¶
-
Update the annotator state.
Called every time the behavior is ticked.
- Returns:
-
Status of the behavior after update
- Return type:
-
py_trees.common.Status
- class robokudo.descriptors.analysis_engines.query_test.CheckQueryType(name='CheckQueryType')¶
-
Bases:
robokudo.annotators.core.BaseAnnotatorChecks if the query type on the CAS is ‘numbers’.
- update()¶
-
Update the annotator state.
Called every time the behavior is ticked.
- Returns:
-
Status of the behavior after update
- Return type:
-
py_trees.common.Status
- class robokudo.descriptors.analysis_engines.query_test.AnalysisEngine¶
-
Bases:
robokudo.analysis_engine.AnalysisEngineInterfaceProtocol defining the interface for Analysis Engines.
This interface must be implemented by all Analysis Engines in RoboKudo. Each Analysis Engine provides a behavior tree implementation for a specific task or pipeline. The RoboKudo runner will load and execute these implementations.
Warning
Do not instantiate this class directly. Instead, create a subclass that implements this interface.
See
robokudo.descriptors.analysis_enginesfor example implementations.- name()¶
-
Get the name of this Analysis Engine.
- Returns:
-
The unique name identifying this Analysis Engine
- Return type:
-
str
- implementation() robokudo.pipeline.Pipeline¶
-
Get the behavior tree implementation for this Analysis Engine.
- Returns:
-
The root node of the behavior tree implementing this engine
- Return type:
-
py_trees.Behaviour