robokudo.utils.tree_execution

Tree execution utilities for RoboKudo.

This module provides utilities for executing behavior trees in ROS environments. It supports:

  • One-shot tree execution with GUI option

  • Rate-limited tree ticking

  • Status monitoring and completion detection

  • ROS time handling

Dependencies:

  • py_trees for behavior tree functionality

  • rospy for ROS integration

Functions

run_tree_once(→ py_trees.common.Status)

Execute a behavior tree once with monitoring.

Module Contents

robokudo.utils.tree_execution.run_tree_once(tree: py_trees.behaviour.Behaviour, node: rclpy.node.Node, include_gui: bool = False, max_iterations: int = 500, tick_rate: int = 5) py_trees.common.Status

Execute a behavior tree once with monitoring.

This function: * Grows the tree with optional GUI * Sets up all descendants * Ticks the tree at specified rate * Monitors for completion via OneShot decorator * Handles ROS time exceptions

Parameters:
  • tree (py_trees.Behaviour) – Root behavior of tree to execute

  • node (rclpy.node.Node) – a ros node

  • include_gui (bool, optional) – Whether to show GUI visualization, defaults to False

  • max_iterations (int, optional) – Maximum number of ticks before timeout, defaults to 500

  • tick_rate (int, optional) – Rate to tick tree in Hz, defaults to 5

Returns:

Final tree status (SUCCESS/FAILURE) or None if timed out

Return type:

Optional[py_trees.Status]