synchros2.single_goal_multiple_action_servers module

class synchros2.single_goal_multiple_action_servers.SingleGoalMultipleActionServers[source]

Bases: object

Wrapper around multiple action servers that only allows a single Action to be executing at one time.

If a new Action.Goal is received by any of the action servers, the existing Action (if there is one) is preemptively canceled.

__init__(node: rclpy.node.Node, action_server_parameters: List[Tuple[ActionType, str, Callable, rclpy.callback_groups.CallbackGroup | None]], nosync: bool = False) None[source]

Constructor.

Parameters:
  • node – ROS 2 node to use for action servers.

  • action_server_parameters – tuples per action server, listing action type, action name,

  • callback (action execution)

  • group (and action callback)

  • nosync – whether to synchronize action execution callbacks using locks or not.

  • exclusion. (Set to True when action execution callback already enforce mutual)

cancel_callback(cancel_request: Any) rclpy.action.CancelResponse[source]

Accept or reject a client’s request to cancel an action.

destroy() None[source]

Destroy all of the internal action servers

get_logger() rclpy.impl.rcutils_logger.RcutilsLogger[source]

Returns the ros logger

goal_callback(goal: Any) rclpy.action.GoalResponse[source]

Accept or reject a client request to begin an action.

handle_accepted_callback(goal_handle: rclpy.action.server.ServerGoalHandle) None[source]

Callback triggered when an action is accepted.