robokudo.behaviours.run_until ============================= .. py:module:: robokudo.behaviours.run_until .. autoapi-nested-parse:: Timing behavior for RoboKudo behavior trees. This module provides a behavior that runs for a specified duration before succeeding. It can be used to: * Create timed delays in behavior trees * Implement timeout mechanisms * Create periodic behaviors with reset capability The behavior tracks elapsed time across multiple ticks and supports optional automatic reset after completion. Classes ------- .. autoapisummary:: robokudo.behaviours.run_until.RunUntil Module Contents --------------- .. py:class:: RunUntil(name='RunUntil', wait_seconds: float = 10, reset_on_done: bool = True) Bases: :py:obj:`py_trees.Behaviour` Returns py_trees.Status.RUNNING until wait_seconds is reached starting from the first call to update. If update is called after the Behaviour waited for wait_seconds or longer py_trees.Status.SUCCESS will be returned. If reset_on_done is True this will start over after returning py_trees.Status.SUCCESS once. :ivar wait_seconds: Number of seconds to wait before succeeding :type wait_seconds: float :ivar reset_on_done: Whether to reset timer after succeeding :type reset_on_done: bool :ivar waited_seconds: Accumulated wait time so far :type waited_seconds: float :ivar last_time: Timestamp of last update :type last_time: float .. py:attribute:: wait_seconds :value: 10 .. py:attribute:: reset_on_done :value: True .. py:attribute:: waited_seconds :value: 0 .. py:attribute:: last_time :value: None .. py:method:: initialise() -> None Reset the behavior's internal timing state. Called when the behavior is first ticked and after it completes if reset_on_done is True. .. py:method:: update() -> py_trees.common.Status Update the behavior's elapsed time and check for completion. This method: * Updates the total elapsed time since initialization * Checks if the wait duration has been reached * Handles resetting if configured to do so * Returns appropriate status based on elapsed time :return: SUCCESS if wait_seconds has elapsed, RUNNING otherwise :rtype: py_trees.common.Status