robokudo.behaviours.action_server_checks

Action server monitoring behaviors for RoboKudo behavior trees.

This module provides behaviors for monitoring and controlling ROS action servers in RoboKudo. It includes behaviors for:

  • Checking action server activity state

  • Handling preemption requests

  • Managing goal abortion

  • Exception handling

These behaviors are typically used in pipelines that interact with ROS action servers to ensure proper state management and error handling.

Classes

ActionServerActive

A behavior that checks if an action server is active.

ActionServerCheck

A behavior that monitors action server state transitions.

ActionServerNoPreemptRequest

A behavior that handles action server preemption requests.

AbortGoal

A behavior that aborts the current goal with an error message.

RunningUntilExceptionHandled

A behavior that waits for exception handling to complete.

ActionServerPresentAndDone

A behaviour that checks whether an action server is present and represents its state.

Module Contents

class robokudo.behaviours.action_server_checks.ActionServerActive(name: str = 'ActionServerActive')

Bases: py_trees.behaviour.Behaviour

A behavior that checks if an action server is active.

This behavior monitors the action server’s state and returns: * SUCCESS if the server is active and processing a goal * FAILURE if the server is not found or not active

update() py_trees.common.Status

Check if the action server is active.

This method: * Retrieves the action server from the blackboard * Checks if it exists and is active * Returns appropriate status based on server state

Returns:

SUCCESS if server is active, FAILURE otherwise

class robokudo.behaviours.action_server_checks.ActionServerCheck(name: str = 'ActionServerCheck')

Bases: py_trees.behaviour.Behaviour

A behavior that monitors action server state transitions.

This behavior is used to ensure proper pipeline synchronization with action server state. It returns: * RUNNING if the server is active (processing a goal) * FAILURE if the server is not found * SUCCESS if the server is no longer active

This prevents pipelines from proceeding until action server processing is complete.

update() py_trees.common.Status

Check action server state.

This method: * Retrieves the action server from the blackboard * Returns RUNNING if server is active * Returns FAILURE if server not found * Returns SUCCESS if server is no longer active

Returns:

Status based on server state

class robokudo.behaviours.action_server_checks.ActionServerNoPreemptRequest(name: str = 'ActionServerNoPreemptRequest')

Bases: py_trees.behaviour.Behaviour

A behavior that handles action server preemption requests.

This behavior monitors for preemption requests and handles them by: * Checking if a preempt request exists on the blackboard * Acknowledging the request if found * Returning appropriate status to trigger preemption

Variables:

name – Name of the behavior node

update() py_trees.common.Status

Check for and handle preemption requests.

This method: * Checks the blackboard for preemption requests * Acknowledges requests if found * Returns FAILURE to trigger preemption on request * Returns SUCCESS if no preemption requested

Returns:

FAILURE if preemption requested, SUCCESS otherwise

class robokudo.behaviours.action_server_checks.AbortGoal(name: str = 'AbortGoal', msg: str = 'Goal has been aborted')

Bases: py_trees.behaviour.Behaviour

A behavior that aborts the current goal with an error message.

This behavior raises an exception that is caught and stored on the blackboard to trigger goal abortion. It is used to explicitly terminate goals with a specified error message.

msg: str = 'Goal has been aborted'

Error message for goal abortion

update() py_trees.common.Status

Abort the current goal.

This method raises an exception with the specified message. The exception is caught by the decorator and stored on the blackboard.

Raises:

Exception – Always raises an exception with the abort message

Returns:

Never returns due to exception

class robokudo.behaviours.action_server_checks.RunningUntilExceptionHandled(name: str = 'RunningUntilExceptionHandled', msg: str = 'Running Until Exception Handled')

Bases: py_trees.behaviour.Behaviour

A behavior that waits for exception handling to complete.

This behavior monitors the blackboard for active exceptions and returns RUNNING until they are cleared. It is used to prevent further processing until error conditions are resolved.

msg: str = 'Running Until Exception Handled'

Status message for waiting state

update() py_trees.common.Status

Check if exception handling is complete.

This method: * Checks for active exceptions on the blackboard * Returns SUCCESS if no exceptions are present * Returns RUNNING if exceptions still need handling

Returns:

SUCCESS if no exceptions, RUNNING otherwise

class robokudo.behaviours.action_server_checks.ActionServerPresentAndDone(name: str = 'ActionServerPresentAndDone')

Bases: py_trees.behaviour.Behaviour

A behaviour that checks whether an action server is present and represents its state.

rk_logger: logging.Logger = None

Logger for this behaviour.

update() py_trees.common.Status