as2fm.scxml_converter.scxml_entries.scxml_root.ScxmlRoot
- class as2fm.scxml_converter.scxml_entries.scxml_root.ScxmlRoot(name: str)
Bases:
ScxmlBase
This class represents a whole scxml model, that is used to define specific skills.
- __init__(name: str)
Methods
__init__
(name)add_action_thread
(action_thread)add_bt_port_declaration
(bt_port_decl)Add a BT port declaration to the handler.
add_ros_declaration
(ros_declaration)add_state
(state, *[, initial])Append a state to the list of states in the SCXML model.
add_targets_to_scxml_sends
(events_to_targets)append_bt_child_id
(child_id)Append a child ID to the list of child IDs.
as_plain_scxml
(ros_declarations)Convert the object to its plain SCXML version.
as_xml
(**kwargs)Convert the object to an XML element.
as_xml_string
(**kwargs)Check if the object is valid.
from_scxml_file
(xml_file)Create a ScxmlRoot object from an SCXML file.
from_xml_tree
(xml_tree)Create a ScxmlRoot object from an XML tree.
get_body
()Get the body of the object.
Get the ID of the BT plugin instance, if any.
Get the data model of the object.
get_id
()Get the ID of the object.
Get the ID of the initial state of the SCXML model.
get_name
()Get the name of the automaton represented by this SCXML model.
get_state_by_id
(state_id)Get the states of the object.
Get the tag name of the XML element.
Generate the set of events that are expected by the SCXML automaton.
Instantiate the values of BT ports and children IDs in the SCXML entries.
Check whether there are ROS specific features or all entries are plain SCXML.
set_bt_plugin_id
(instance_id)Update all BT-related events to use the assigned instance ID.
set_bt_port_value
(port_name, port_value)Set the value of an input port.
set_bt_ports_values
(ports_values)Set the values of multiple input ports.
set_data_model
(data_model)set_name
(name)Rename the automaton represented by this SCXML model.
Convert all internal ROS specific entries to plain SCXML.
update_bt_ports_values
(bt_ports_handler)Update the values of potential entries making use of BT ports.
- add_bt_port_declaration(bt_port_decl: BtInputPortDeclaration | BtOutputPortDeclaration)
Add a BT port declaration to the handler.
- add_state(state: ScxmlState, *, initial: bool = False)
Append a state to the list of states in the SCXML model. If initial is True, set it as the initial state.
- append_bt_child_id(child_id: int)
Append a child ID to the list of child IDs.
- as_xml(**kwargs) Element
Convert the object to an XML element.
- check_validity() bool
Check if the object is valid.
- get_body()
Get the body of the object.
- get_bt_plugin_id() int | None
Get the ID of the BT plugin instance, if any.
- get_data_model() ScxmlDataModel | None
Get the data model of the object.
- get_id() str
Get the ID of the object.
- get_initial_state_id() str
Get the ID of the initial state of the SCXML model.
- get_name() str
Get the name of the automaton represented by this SCXML model.
- get_states() List[ScxmlState]
Get the states of the object.
- static get_tag_name() str
Get the tag name of the XML element.
- get_transition_events() Set[str]
Generate the set of events that are expected by the SCXML automaton.
- instantiate_bt_information()
Instantiate the values of BT ports and children IDs in the SCXML entries.
- is_plain_scxml() bool
Check whether there are ROS specific features or all entries are plain SCXML.
- set_bt_plugin_id(instance_id: int) None
Update all BT-related events to use the assigned instance ID.
- set_bt_port_value(port_name: str, port_value: str)
Set the value of an input port.
- set_bt_ports_values(ports_values: List[Tuple[str, str]])
Set the values of multiple input ports.
- set_name(name: str) None
Rename the automaton represented by this SCXML model.
- to_plain_scxml_and_declarations() Tuple[List[ScxmlRoot], ScxmlRosDeclarationsContainer]
Convert all internal ROS specific entries to plain SCXML.
- Returns:
A tuple with: - a list of ScxmlRoot objects with all ROS specific entries converted to plain SCXML - The Ros declarations contained in the original SCXML object
- update_bt_ports_values(bt_ports_handler)
Update the values of potential entries making use of BT ports.