as2fm.scxml_converter.ascxml_extensions.ros_entries.scxml_ros_field.RosField

class as2fm.scxml_converter.ascxml_extensions.ros_entries.scxml_ros_field.RosField(name: str, *, expr: AscxmlConfiguration | str, cb_prefixes: List[str] | None = None)

Bases: ScxmlParam

Field of a ROS msg published in a topic.

__init__(name: str, *, expr: AscxmlConfiguration | str, cb_prefixes: List[str] | None = None)

Initialize the SCXML Parameter object.

The ‘location’ entry is kept for consistency, but using expr achieves the same result.

Parameters:
  • name – The name of the parameter.

  • expr – The expression to assign to the parameter. Can come from a BT port.

  • cb_prefixes – The list of prefixes we can expect in the expression.

Methods

__init__(name, *, expr[, cb_prefixes])

Initialize the SCXML Parameter object.

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.

evaluate_expr()

Replace expression of type AscxmlConfiguration with their current value.

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)

Create a ScxmlParam object from an XML tree.

get_custom_data_types()

Get the container with custom data types.

get_expr()

get_name()

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.

set_callback_prefixes(cb_prefixes)

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.

update_configured_value(ascxml_declarations)

Set the value of the configured value based on the declarations content.

as_plain_scxml(struct_declarations: ScxmlStructDeclarationsContainer, ascxml_declarations: List[AscxmlDeclaration], **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.

as_xml() _Element

Convert the object to an XML element.

check_validity() bool

Check if the object is valid.

evaluate_expr()

Replace expression of type AscxmlConfiguration with their current value.

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.

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

Create a ScxmlParam object from an XML tree.

get_custom_data_types() Dict[str, StructDefinition]

Get the container with custom data types.

static 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.

is_plain_scxml(verbose: bool = False)

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

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.

update_configured_value(ascxml_declarations: List[AscxmlDeclaration])

Set the value of the configured value based on the declarations content.