|
| None | __init__ (self) |
| |
| AddTwoInts.Request | create_request_handler (self, Blackboard blackboard) |
| |
| str | response_handler (self, Blackboard blackboard, AddTwoInts.Response response) |
| |
| None | __init__ (self, Type srv_type, str srv_name, Callable create_request_handler, Set[str] outcomes=None, Callable response_handler=None, Node node=None, float timeout=None) |
| |
| str | execute (self, Blackboard blackboard) |
| |
| None | __init__ (self, Set[str] outcomes) |
| |
| str | __call__ (self, Blackboard blackboard=None) |
| |
| str | __str__ (self) |
| |
| None | cancel_state (self) |
| |
| bool | is_canceled (self) |
| |
| bool | is_running (self) |
| |
| Set[str] | get_outcomes (self) |
| |
|
| Callable[[Blackboard], Any] | _create_request_handler = create_request_handler |
| | A function that creates the service request.
|
| |
| Callable[[Blackboard, Any], str] | _response_handler = response_handler |
| | A function that processes the service response.
|
| |
| float | _timeout = timeout |
| | Timeout duration for the service call.
|
| |
| Node | _node = node |
| | The ROS node used to communicate with the service.
|
| |
| str | _srv_name = srv_name |
| | The name of the service to call.
|
| |
| Client | _service_client = self._node.create_client(srv_type, srv_name) |
| | The client used to call the service.
|
| |
| Set | _outcomes = set() |
| | A set of valid outcomes for this state.
|
| |
| bool | _running = False |
| | A flag indicating whether the state is currently running.
|
| |
| bool | _canceled = False |
| | A flag indicating whether the state has been canceled.
|
| |
A state that calls the AddTwoInts service to add two integers.
This class is a state in a finite state machine that sends a request
to the AddTwoInts service, retrieves the response, and updates the
blackboard with the result.
Attributes:
service_type (type): The service type being used (AddTwoInts).
service_name (str): The name of the service.
outcomes (list): The list of possible outcomes for this state.