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(...)

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) typing_extensions.Optional[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 – Root behavior of tree to execute

  • node – a ros node

  • include_gui – Whether to show GUI visualization, defaults to False

  • max_iterations – Maximum number of ticks before timeout, defaults to 500

  • tick_rate – Rate to tick tree in Hz, defaults to 5

Returns:

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