as2fm.scxml_converter.scxml_entries.scxml_ros_service.RosServiceSendResponse
- class as2fm.scxml_converter.scxml_entries.scxml_ros_service.RosServiceSendResponse(interface_decl: str | RosDeclaration, fields: List[RosField], additional_args: Dict[str, str] | None = None)
Bases:
RosTrigger
SCXML object representing the response from a service server.
- __init__(interface_decl: str | RosDeclaration, fields: List[RosField], additional_args: Dict[str, str] | None = None) None
Constructor of a generic ROS trigger.
- Parameters:
interface_decl – ROS interface declaration to be used in the trigger, or its name.
fields – Name of fields that are sent together with the trigger.
additional_args – Additional arguments in the SCXML-ROS tag.
Methods
__init__
(interface_decl, fields[, ...])Constructor of a generic ROS trigger.
append_field
(field)append_param
(param)as_plain_scxml
(ros_declarations)Convert the object to its plain SCXML version.
as_xml
()Convert the object to an XML element.
check_fields_validity
(ros_declarations)Check if all fields are assigned, given the ROS interface definition.
check_interface_defined
(ros_declarations)Check if the ROS interface used in the trigger exists.
check_valid_ros_instantiations
(ros_declarations)Check if the ROS entries in the trigger are correctly defined.
Check if the object is valid.
from_xml_tree
(xml_tree)Create an instance of the class from an XML tree.
Get the names of additional arguments in the SCXML-ROS tag.
get_body
()Get the body of the object.
Get the data model of the object.
Get the type of ROS declaration related to the trigger.
Get the event to send.
get_id
()Get the ID of the object.
Get the parameters to send.
get_plain_scxml_event
(ros_declarations)Translate the ROS interface name to a plain scxml event.
Get the states of the object.
XML tag name for the ROS trigger type.
Get the target automata associated to this send event.
instantiate_bt_events
(instance_id, _)Instantiate the behavior tree events in the send action, if available.
set_callback_type
(cb_type)Set the callback executing this trigger for this instance and its children.
set_target_automaton
(target_automaton)Set the target automata associated to this send event.
update_bt_ports_values
(bt_ports_handler)Update the values of potential entries making use of BT ports.
- as_plain_scxml(ros_declarations: ScxmlRosDeclarationsContainer) ScxmlSend
Convert the object to its plain SCXML version.
- as_xml() Element
Convert the object to an XML element.
- check_fields_validity(ros_declarations: ScxmlRosDeclarationsContainer) bool
Check if all fields are assigned, given the ROS interface definition.
- check_interface_defined(ros_declarations: ScxmlRosDeclarationsContainer) bool
Check if the ROS interface used in the trigger exists.
- check_valid_ros_instantiations(ros_declarations: ScxmlRosDeclarationsContainer) bool
Check if the ROS entries in the trigger are correctly defined.
- check_validity() bool
Check if the object is valid.
- classmethod from_xml_tree(xml_tree: Element) RosTrigger
Create an instance of the class from an XML tree.
- Parameters:
xml_tree – XML tree to be used for the creation of the instance.
additional_args – Additional arguments to be parsed from the SCXML-ROS tag.
- static get_additional_arguments() List[str]
Get the names of additional arguments in the SCXML-ROS tag.
- get_body()
Get the body of the object.
- 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 trigger.
Examples: RosServiceClient, RosActionClient, …
- get_event() str
Get the event to send.
- get_id() str
Get the ID of the object.
- get_params() List[ScxmlParam]
Get the parameters to send.
- 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 trigger type.
- get_target_automaton() str | None
Get the target automata associated to this send event.
- instantiate_bt_events(instance_id: int, _) ScxmlSend
Instantiate the behavior tree events in the send action, if available.
- set_callback_type(cb_type: CallbackType)
Set the callback executing this trigger for this instance and its children.
- set_target_automaton(target_automaton: str) None
Set the target automata associated to this send event.
- update_bt_ports_values(bt_ports_handler: BtPortsHandler)
Update the values of potential entries making use of BT ports.