as2fm.scxml_converter.scxml_entries.ascxml_declaration.AscxmlDeclaration

class as2fm.scxml_converter.scxml_entries.ascxml_declaration.AscxmlDeclaration

Bases: ScxmlBase

Base class for declarations in ASCXML.

Declarations are used for preparing framework specific functionalities. Exemplary declarations are ROS 2 topics, services, actions, timers and BT ports.

__init__()

Methods

__init__()

as_plain_scxml(struct_declarations, ...)

Convert the object to its plain SCXML version.

as_xml()

Convert the object to an XML element.

check_validity()

Check if the object is valid.

from_xml_tree(xml_tree, custom_data_types, ...)

External interface to create a ScxmlBase object from an XML tree.

from_xml_tree_impl(xml_tree, custom_data_types)

Child-specific implementation to create a ScxmlBase object from an XML tree.

get_custom_data_types()

Get the container with custom data types.

get_tag_name()

Get the tag name of the XML element.

get_xml_origin()

Get the xml_element this object was made from.

is_plain_scxml([verbose])

Check if the object is compatible with the plain SCXML standard.

preprocess_declaration(ascxml_declarations, ...)

Update the content of this declaration if needed, using the other declarations.

set_custom_data_types(custom_data_types)

Save container with custom data types.

set_xml_origin(xml_origin)

Set the xml_element this object was made from.

abstract as_plain_scxml(struct_declarations, ascxml_declarations, **kwargs) List[ScxmlBase]

Convert the object to its plain SCXML version.

Parameters:
  • struct_declarations – List of custom structures defined in the model

  • ascxml_declarations – Additional declarations, like ROS or BT specific ones

  • kwargs – Additional framework specific entries, e.g. the BT plugin ID.

abstract as_xml()

Convert the object to an XML element.

abstract check_validity() bool

Check if the object is valid.

classmethod from_xml_tree(xml_tree: _Element, custom_data_types: Dict[str, StructDefinition], **kwargs) Self

External interface to create a ScxmlBase object from an XML tree.

abstract classmethod from_xml_tree_impl(xml_tree: _Element, custom_data_types: Dict[str, StructDefinition]) Self

Child-specific implementation to create a ScxmlBase object from an XML tree.

get_custom_data_types() Dict[str, StructDefinition]

Get the container with custom data types.

abstract classmethod get_tag_name() str

Get the tag name of the XML element.

get_xml_origin() _Element | None

Get the xml_element this object was made from.

abstract is_plain_scxml(verbose: bool = False) bool

Check if the object is compatible with the plain SCXML standard.

abstract preprocess_declaration(ascxml_declarations: List[AscxmlDeclaration], **kwargs)

Update the content of this declaration if needed, using the other declarations.

set_custom_data_types(custom_data_types: Dict[str, StructDefinition])

Save container with custom data types.

set_xml_origin(xml_origin: _Element)

Set the xml_element this object was made from.