as2fm.scxml_converter.scxml_entries.scxml_ros_service.RosServiceHandleRequest

class as2fm.scxml_converter.scxml_entries.scxml_ros_service.RosServiceHandleRequest(interface_decl: str | RosDeclaration, target_state: str, condition: str | None = None, exec_body: List[ScxmlAssign | ScxmlIf | ScxmlSend] | None = None)

Bases: RosCallback

SCXML object representing a ROS service callback on the server, acting upon a request.

__init__(interface_decl: str | RosDeclaration, target_state: str, condition: str | None = None, exec_body: List[ScxmlAssign | ScxmlIf | ScxmlSend] | None = None) None

Constructor of ROS callback.

Parameters:
  • interface_decl – ROS interface declaration to be used in the callback, or its name.

  • target_state – Name of the state to transition to after the callback.

  • condition – Condition to be met for the callback to be executed.

  • exec_body – Executable body of the callback.

Methods

__init__(interface_decl, target_state[, ...])

Constructor of ROS callback.

add_event(event)

append_body_executable_entry(exec_entry)

as_plain_scxml(ros_declarations)

Convert the object to its plain SCXML version.

as_xml()

Convert the ROS callback to an XML element.

check_interface_defined(ros_declarations)

Check if the ROS interface used in the callback exists.

check_valid_ros_instantiations(ros_declarations)

Check if the ROS entries in the callback are correctly defined.

check_validity()

Check if the object is valid.

from_xml_tree(xml_tree)

Create an instance of the class from an XML tree.

get_body()

Return the executable content of this transition.

get_callback_type()

Return the callback type of a specific ROS Callback subclass

get_condition()

Return the condition required to execute this transition (if any).

get_data_model()

Get the data model of the object.

get_declaration_type()

Get the type of ROS declaration related to the callback.

get_events()

Return the events that trigger this transition (if any).

get_id()

Get the ID of the object.

get_plain_scxml_event(ros_declarations)

Translate the ROS interface name to a plain scxml event.

get_states()

Get the states of the object.

get_tag_name()

XML tag name for the ROS callback type.

get_target_state_id()

Return the ID of the target state of this transition.

instantiate_bt_events(instance_id, children_ids)

Instantiate the BT events of this transition.

set_body(body)

Set the body of this transition.

set_thread_id(thread_id)

Set the thread ID for the executable entries of this transition.

update_bt_ports_values(bt_ports_handler)

Update the values of potential entries making use of BT ports.

as_plain_scxml(ros_declarations: ScxmlRosDeclarationsContainer) ScxmlTransition

Convert the object to its plain SCXML version.

as_xml() Element

Convert the ROS callback to an XML element.

check_interface_defined(ros_declarations: ScxmlRosDeclarationsContainer) bool

Check if the ROS interface used in the callback exists.

check_valid_ros_instantiations(ros_declarations: ScxmlRosDeclarationsContainer) bool

Check if the ROS entries in the callback are correctly defined.

check_validity() bool

Check if the object is valid.

classmethod from_xml_tree(xml_tree: Element) RosCallback

Create an instance of the class from an XML tree.

get_body() List[ScxmlAssign | ScxmlIf | ScxmlSend]

Return the executable content of this transition.

static get_callback_type() CallbackType

Return the callback type of a specific ROS Callback subclass

get_condition() str | None

Return the condition required to execute this transition (if any).

get_data_model()

Get the data model of the object.

static get_declaration_type() Type[RosServiceServer]

Get the type of ROS declaration related to the callback.

Examples: RosSubscriber, RosPublisher, …

get_events() List[str]

Return the events that trigger this transition (if any).

get_id() str

Get the ID of the object.

get_plain_scxml_event(ros_declarations: ScxmlRosDeclarationsContainer) str

Translate the ROS interface name to a plain scxml event.

get_states()

Get the states of the object.

static get_tag_name() str

XML tag name for the ROS callback type.

get_target_state_id() str

Return the ID of the target state of this transition.

instantiate_bt_events(instance_id: int, children_ids: List[int]) List[ScxmlTransition]

Instantiate the BT events of this transition.

set_body(body: List[ScxmlAssign | ScxmlIf | ScxmlSend]) None

Set the body of this transition.

set_thread_id(thread_id: int) None

Set the thread ID for the executable entries of this transition.

update_bt_ports_values(bt_ports_handler: BtPortsHandler) None

Update the values of potential entries making use of BT ports.