### xacro Python API Reference Source: https://docs.ros.org/en/humble/p/xacro/__README Detailed reference for the xacro Python package, outlining its structure, submodules, and the various classes and functions available for programmatic interaction. This section serves as a comprehensive guide to the xacro library's public interface. ```APIDOC xacro package Submodules: xacro.cli module xacro.color module xacro.substitution_args module xacro.xmlutils module Module contents: Classes: ConstructUnits Macro NameSpace QuickLexer Table XacroException YamlDictWrapper YamlListWrapper Functions: abs_filename_spec() check_attrs() create_global_symbols() eval_all() eval_default_arg() eval_extension() eval_text() get_boolean_value() get_include_files() grab_macro() grab_property() handle_dynamic_macro_call() handle_macro_call() import_xml_namespaces() init_stacks() is_valid_name() load_yaml() main() open_output() parse() parse_macro_arg() print_location() process() process_doc() process_file() process_include() remove_previous_comments() resolve_macro() safe_eval() tokenize() ``` -------------------------------- ### Get first child element of XML node Source: https://docs.ros.org/en/humble/p/xacro/xacro.xmlutils Retrieves the first child element of a given XML DOM node. This function helps in traversing the XML tree structure. ```APIDOC xacro.xmlutils.first_child_element(elt: xml.dom.Node) ``` -------------------------------- ### Get next sibling element of XML node Source: https://docs.ros.org/en/humble/p/xacro/xacro.xmlutils Retrieves the next sibling element of a given XML DOM node. This function is useful for sequential navigation through sibling nodes in the XML tree. ```APIDOC xacro.xmlutils.next_sibling_element(node: xml.dom.Node) ``` -------------------------------- ### xacro.init_stacks API Documentation Source: https://docs.ros.org/en/humble/p/xacro/xacro API documentation for the xacro.init_stacks function. ```APIDOC xacro.init_stacks(file) ``` -------------------------------- ### xacro.cli Module API Reference Source: https://docs.ros.org/en/humble/p/xacro/xacro.cli Comprehensive API documentation for classes and functions within the `xacro.cli` module, including their signatures, inheritance, parameters, return types, and descriptions where available. ```APIDOC class xacro.cli.ColoredOptionParser(usage=None, option_list=None, option_class=, version=None, conflict_handler='error', description=None, formatter=None, add_help_option=True, prog=None, epilog=None) Bases: OptionParser error(msg: string) Description: Print a usage message incorporating ‘msg’ to stderr and exit. If you override this in a subclass, it should not return – it should either exit or raise an exception. ``` ```APIDOC class xacro.cli.IndentedHelpFormatterWithNL(*args, **kwargs) Bases: IndentedHelpFormatter format_option(text) ``` ```APIDOC xacro.cli.load_mappings(argv) Description: Load name mappings encoded in command-line arguments. This will filter out any parameter assignment mappings. Parameters: argv: command-line arguments (type: [str]) Returns: name->name remappings. (type: dict {str: str}) ``` ```APIDOC xacro.cli.process_args(argv, require_input=True) ``` ```APIDOC xacro.cli.wrap_with_newlines(text, width, **kwargs) ``` -------------------------------- ### Python API Reference for xacro Package Source: https://docs.ros.org/en/humble/p/xacro/xacro.substitution_args Comprehensive listing of modules, classes, and functions available within the `xacro` Python package, detailing its structure and callable elements. This section serves as a quick reference for developers using the `xacro` library. ```APIDOC xacro package: Submodules: - xacro.cli module - xacro.color module - xacro.substitution_args module - xacro.xmlutils module Module contents: Classes: - ConstructUnits - Macro - NameSpace - QuickLexer - Table - XacroException - YamlDictWrapper - YamlListWrapper Functions: - abs_filename_spec() - check_attrs() - create_global_symbols() - eval_all() - eval_default_arg() - eval_extension() - eval_text() - get_boolean_value() - get_include_files() - grab_macro() - grab_property() - handle_dynamic_macro_call() - handle_macro_call() - import_xml_namespaces() - init_stacks() - is_valid_name() - load_yaml() - main() - open_output() - parse() - parse_macro_arg() - print_location() - process() - process_doc() - process_file() - process_include() - remove_previous_comments() - resolve_macro() - safe_eval() - tokenize() ``` -------------------------------- ### xacro.main API Documentation Source: https://docs.ros.org/en/humble/p/xacro/xacro API documentation for the xacro.main function. ```APIDOC xacro.main() ``` -------------------------------- ### xacro.open_output API Documentation Source: https://docs.ros.org/en/humble/p/xacro/xacro API documentation for the xacro.open_output function. ```APIDOC xacro.open_output(output_filename) ``` -------------------------------- ### xacro.color Module API Reference Source: https://docs.ros.org/en/humble/p/xacro/xacro.color Detailed API documentation for the `xacro.color` module, including functions for coloring messages, handling errors and warnings, displaying general messages, and checking if a stream is a TTY. ```APIDOC xacro.color module: xacro.color.colorize(msg, color, file=<_io.TextIOWrapper name='' mode='w' encoding='utf-8'>, alt_text=None) msg: The message string to colorize. color: The color to apply to the message. file: The file-like object to write the colored message to (defaults to stderr). alt_text: An alternative text string to display if coloring is not possible or desired. xacro.color.error(*args, **kwargs) args: Positional arguments to be passed to the underlying message function. kwargs: Keyword arguments to be passed to the underlying message function. xacro.color.is_tty(stream) stream: The stream object to check for TTY status. Returns: True if the given stream is a TTY (interactive terminal), otherwise False. xacro.color.message(msg, *args, **kwargs) msg: The primary message string to display. args: Additional positional arguments to include in the message. kwargs: Additional keyword arguments to include in the message. xacro.color.warning(*args, **kwargs) args: Positional arguments to be passed to the underlying message function. kwargs: Keyword arguments to be passed to the underlying message function. ``` -------------------------------- ### xacro Package API Reference Source: https://docs.ros.org/en/humble/p/xacro/xacro Detailed API documentation for the `xacro` package, including its submodules and their respective classes and functions. This section outlines the callable methods and available classes within each module. ```APIDOC xacro package Submodules: xacro.cli module: Classes: ColoredOptionParser: Methods: error() IndentedHelpFormatterWithNL: Methods: format_option() Functions: load_mappings() process_args() wrap_with_newlines() xacro.color module: Functions: colorize() error() is_tty() message() warning() xacro.substitution_args module: Exceptions: ArgException SubstitutionException Functions: convert_value() resolve_args() xacro.xmlutils module: Functions: attribute() first_child_element() fixed_writexml() next_sibling_element() opt_attrs() replace_node() reqd_attrs() ``` -------------------------------- ### xacro.process_include API Documentation Source: https://docs.ros.org/en/humble/p/xacro/xacro API documentation for the xacro.process_include function. ```APIDOC xacro.process_include(elt, macros, symbols, func) ``` -------------------------------- ### xacro Python API Reference Source: https://docs.ros.org/en/humble/p/xacro/xacro.color Detailed API documentation for the core `xacro` Python package, outlining its main classes and functions. This section provides a high-level view of the programmatic interfaces available for interacting with xacro functionalities. ```APIDOC xacro package: Submodules: xacro.cli xacro.color xacro.substitution_args xacro.xmlutils Module contents (xacro): Classes: ConstructUnits Macro NameSpace QuickLexer Table XacroException YamlDictWrapper YamlListWrapper Functions: abs_filename_spec() check_attrs() create_global_symbols() eval_all() eval_default_arg() eval_extension() eval_text() get_boolean_value() get_include_files() grab_macro() grab_property() handle_dynamic_macro_call() handle_macro_call() import_xml_namespaces() init_stacks() is_valid_name() load_yaml() main() open_output() parse() parse_macro_arg() print_location() process() process_doc() process_file() process_include() remove_previous_comments() resolve_macro() safe_eval() tokenize() ``` -------------------------------- ### xacro Module Classes and Functions API Reference Source: https://docs.ros.org/en/humble/p/xacro/xacro Comprehensive API documentation for the `xacro` module, including class definitions, their inheritance, methods, attributes, and descriptions for various utility functions. This covers functionalities from unit construction to XML attribute checking and macro evaluation. ```APIDOC class xacro.ConstructUnits(value) Bases: Enum Description: utility enumeration to construct a values with a unit from yaml Attributes: angle_degrees = ('!degrees', 0.017453292519943295) angle_radians = ('!radians', 1.0) length_foot = ('!foot', 0.3048) length_inches = ('!inches', 0.0254) length_meters = ('!meters', 1.0) length_millimeters = ('!millimeters', 0.001) Methods: constructor(loader, node) Description: utility function to construct a values with a unit from yaml class xacro.Macro Bases: object class xacro.NameSpace(parent=None) Bases: xacro.Table class xacro.QuickLexer(*args, **kwargs) Bases: object Methods: lex(str) next() peek() class xacro.Table(parent=None) Bases: dict Methods: top() exception xacro.XacroException(msg=None, suffix=None, exc=None, macro=None) Bases: Exception Description: XacroException allows to wrap another exception (exc) and to augment its error message: prefixing with msg and suffixing with suffix. str(e) finally prints: msg str(exc) suffix class xacro.YamlDictWrapper Bases: dict Description: Wrapper class providing dotted access to dict items class xacro.YamlListWrapper(iterable=(), /) Bases: list Description: Wrapper class for yaml lists to allow recursive inheritance of wrapper property Static Methods: wrap(item) Description: This static method, used by both YamlListWrapper and YamlDictWrapper, dispatches to the correct wrapper class depending on the type of yaml item function xacro.abs_filename_spec(filename_spec) Description: Prepend the dirname of the currently processed file if filename_spec is not yet absolute function xacro.check_attrs(tag, required, optional) Description: Helper routine to fetch required and optional attributes and complain about any additional attributes. Parameters: tag (xml.dom.Element): DOM element node required [str]: list of required attributes optional [str]: list of optional attributes function xacro.create_global_symbols() function xacro.eval_all(node, macros, symbols) Description: Recursively evaluate node, expanding macros, replacing properties, and evaluating expressions function xacro.eval_default_arg(forward_variable, default, symbols, macro) function xacro.eval_extension(s) function xacro.eval_text(text, symbols) function xacro.get_boolean_value(value, condition) Description: Return a boolean value that corresponds to the given Xacro condition value. Values “true”, “1” and “1.0” are supposed to be True. Values “false”, “0” and “0.0” are supposed to be False. All other values raise an exception. Parameters: value: The value to be evaluated. The value has to already be evaluated by Xacro. condition: The original condition text in the XML. Returns: The corresponding boolean value, or a Python expression that, converted to boolean, corresponds to it. Raises: ValueError: If the condition value is incorrect. function xacro.get_include_files(filename_spec, symbols) function xacro.grab_macro(elt, macros) function xacro.grab_property(elt, table) ``` -------------------------------- ### xacro.load_yaml API Documentation Source: https://docs.ros.org/en/humble/p/xacro/xacro API documentation for the xacro.load_yaml function. ```APIDOC xacro.load_yaml(filename) ``` -------------------------------- ### xacro.handle_macro_call API Documentation Source: https://docs.ros.org/en/humble/p/xacro/xacro API documentation for the xacro.handle_macro_call function. ```APIDOC xacro.handle_macro_call(node, macros, symbols) ``` -------------------------------- ### xacro.tokenize API Documentation Source: https://docs.ros.org/en/humble/p/xacro/xacro API documentation for the xacro.tokenize function. ```APIDOC xacro.tokenize(s, sep=',; ', skip_empty=True) ``` -------------------------------- ### xacro.handle_dynamic_macro_call API Documentation Source: https://docs.ros.org/en/humble/p/xacro/xacro API documentation for the xacro.handle_dynamic_macro_call function. ```APIDOC xacro.handle_dynamic_macro_call(node, macros, symbols) ``` -------------------------------- ### xacro.process_doc API Documentation Source: https://docs.ros.org/en/humble/p/xacro/xacro API documentation for the xacro.process_doc function. ```APIDOC xacro.process_doc(doc, mappings=None, **kwargs) ``` -------------------------------- ### xacro Python API Reference Source: https://docs.ros.org/en/humble/p/xacro/xacro.cli This section provides a detailed reference for the `xacro` Python package, outlining its structure, submodules, and the various classes and functions available for use in xacro processing. ```APIDOC xacro package: Submodules: - xacro.cli module - xacro.color module - xacro.substitution_args module - xacro.xmlutils module Module contents (xacro): - Classes: - ConstructUnits - Macro - NameSpace - QuickLexer - Table - XacroException - YamlDictWrapper - YamlListWrapper - Functions: - abs_filename_spec() - check_attrs() - create_global_symbols() - eval_all() - eval_default_arg() - eval_extension() - eval_text() - get_boolean_value() - get_include_files() - grab_macro() - grab_property() - handle_dynamic_macro_call() - handle_macro_call() - import_xml_namespaces() - init_stacks() - is_valid_name() - load_yaml() - main() - open_output() - parse() - parse_macro_arg() - print_location() - process() - process_doc() - process_file() - process_include() - remove_previous_comments() - resolve_macro() - safe_eval() - tokenize() ``` -------------------------------- ### xacro Python API Reference Source: https://docs.ros.org/en/humble/p/xacro/xacro.xmlutils This section outlines the Python API for the xacro package, including its submodules, core classes, and utility functions. It provides a structured overview of the programmatic interfaces available for interacting with xacro functionalities. ```Python xacro package: Submodules: - xacro.cli - xacro.color - xacro.substitution_args - xacro.xmlutils Module contents: Classes: - ConstructUnits - Macro - NameSpace - QuickLexer - Table - XacroException - YamlDictWrapper - YamlListWrapper Functions: - abs_filename_spec() - check_attrs() - create_global_symbols() - eval_all() - eval_default_arg() - eval_extension() - eval_text() - get_boolean_value() - get_include_files() - grab_macro() - grab_property() - handle_dynamic_macro_call() - handle_macro_call() - import_xml_namespaces() - init_stacks() - is_valid_name() - load_yaml() - main() - open_output() - parse() - parse_macro_arg() - print_location() - process() - process_doc() - process_file() - process_include() - remove_previous_comments() - resolve_macro() - safe_eval() - tokenize() ``` -------------------------------- ### Xacro Project API Reference Index Source: https://docs.ros.org/en/humble/p/xacro/genindex A comprehensive, alphabetically organized list of all public API elements within the `xacro` Python project, including classes, methods, modules, and exceptions. Each entry points to its detailed documentation. ```APIDOC Xacro Project API Index: Classes: xacro.NameSpace xacro.QuickLexer xacro.Table xacro.YamlDictWrapper xacro.YamlListWrapper Methods: xacro.QuickLexer.next() xacro.xmlutils.next_sibling_element() xacro.open_output() xacro.xmlutils.opt_attrs() xacro.parse() xacro.parse_macro_arg() xacro.QuickLexer.peek() xacro.print_location() xacro.process() xacro.cli.process_args() xacro.process_doc() xacro.process_file() xacro.process_include() xacro.remove_previous_comments() xacro.xmlutils.replace_node() xacro.xmlutils.reqd_attrs() xacro.substitution_args.resolve_args() xacro.resolve_macro() xacro.safe_eval() xacro.Table.top() xacro.tokenize() xacro.color.warning() xacro.YamlListWrapper.wrap() (static method) xacro.cli.wrap_with_newlines() Modules: xacro xacro.cli xacro.color xacro.substitution_args xacro.xmlutils Exceptions: xacro.SubstitutionException xacro.XacroException ``` -------------------------------- ### xacro Python API Reference Source: https://docs.ros.org/en/humble/p/xacro/__LICENSE Detailed API documentation for the 'xacro' Python package, outlining its submodules, classes, and functions. This section serves as a reference for developers interacting with the xacro library programmatically. ```APIDOC xacro package: Submodules: - xacro.cli - xacro.color - xacro.substitution_args - xacro.xmlutils Module contents: Classes: - ConstructUnits - Macro - NameSpace - QuickLexer - Table - XacroException - YamlDictWrapper - YamlListWrapper Functions: - abs_filename_spec() - check_attrs() - create_global_symbols() - eval_all() - eval_default_arg() - eval_extension() - eval_text() - get_boolean_value() - get_include_files() - grab_macro() - grab_property() - handle_dynamic_macro_call() - handle_macro_call() - import_xml_namespaces() - init_stacks() - is_valid_name() - load_yaml() - main() - open_output() - parse() - parse_macro_arg() - print_location() - process() - process_doc() - process_file() - process_include() - remove_previous_comments() - resolve_macro() - safe_eval() - tokenize() ``` -------------------------------- ### xacro Python API Reference Source: https://docs.ros.org/en/humble/p/xacro/index Detailed reference for the xacro Python package, outlining its submodules, classes, and functions available for programmatic interaction. This section provides a structured view of the core utilities for XML processing and macro handling within the xacro library. ```APIDOC xacro package: Submodules: - xacro.cli - xacro.color - xacro.substitution_args - xacro.xmlutils Module contents (xacro): Classes: - ConstructUnits - Macro - NameSpace - QuickLexer - Table - XacroException - YamlDictWrapper - YamlListWrapper Functions: - abs_filename_spec() - check_attrs() - create_global_symbols() - eval_all() - eval_default_arg() - eval_extension() - eval_text() - get_boolean_value() - get_include_files() - grab_macro() - grab_property() - handle_dynamic_macro_call() - handle_macro_call() - import_xml_namespaces() - init_stacks() - is_valid_name() - load_yaml() - main() - open_output() - parse() - parse_macro_arg() - print_location() - process() - process_doc() - process_file() - process_include() - remove_previous_comments() - resolve_macro() - safe_eval() - tokenize() ``` -------------------------------- ### xacro Python API Reference Source: https://docs.ros.org/en/humble/p/xacro/__PACKAGE This section outlines the structure of the xacro Python package API, listing its submodules, classes, and functions. It serves as a quick reference for developers interacting with the xacro library programmatically. ```APIDOC xacro package: Submodules: - xacro.cli - xacro.color - xacro.substitution_args - xacro.xmlutils Module contents: Classes: - ConstructUnits - Macro - NameSpace - QuickLexer - Table - XacroException - YamlDictWrapper - YamlListWrapper Functions: - abs_filename_spec() - check_attrs() - create_global_symbols() - eval_all() - eval_default_arg() - eval_extension() - eval_text() - get_boolean_value() - get_include_files() - grab_macro() - grab_property() - handle_dynamic_macro_call() - handle_macro_call() - import_xml_namespaces() - init_stacks() - is_valid_name() - load_yaml() - main() - open_output() - parse() - parse_macro_arg() - print_location() - process() - process_doc() - process_file() - process_include() - remove_previous_comments() - resolve_macro() - safe_eval() - tokenize() ``` -------------------------------- ### xacro Python API Reference Source: https://docs.ros.org/en/humble/p/xacro/genindex Detailed reference for the xacro Python package, listing its submodules, classes, and functions available for programmatic use. ```APIDOC xacro package Submodules: xacro.cli xacro.color xacro.substitution_args xacro.xmlutils Module contents: Classes: ConstructUnits Macro NameSpace QuickLexer Table XacroException YamlDictWrapper YamlListWrapper Functions: abs_filename_spec() check_attrs() create_global_symbols() eval_all() eval_default_arg() eval_extension() eval_text() get_boolean_value() get_include_files() grab_macro() grab_property() handle_dynamic_macro_call() handle_macro_call() import_xml_namespaces() init_stacks() is_valid_name() load_yaml() main() open_output() parse() parse_macro_arg() print_location() process() process_doc() process_file() process_include() remove_previous_comments() resolve_macro() safe_eval() tokenize() ``` -------------------------------- ### xacro Python API Reference Source: https://docs.ros.org/en/humble/p/xacro/__CHANGELOG This section provides a structured overview of the xacro Python package's API, listing its submodules, classes, and functions available for use. It serves as a quick reference for developers interacting with the xacro library programmatically. ```APIDOC xacro package Submodules: - xacro.cli - xacro.color - xacro.substitution_args - xacro.xmlutils Module contents: Classes: - ConstructUnits - Macro - NameSpace - QuickLexer - Table - XacroException - YamlDictWrapper - YamlListWrapper Functions: - abs_filename_spec() - check_attrs() - create_global_symbols() - eval_all() - eval_default_arg() - eval_extension() - eval_text() - get_boolean_value() - get_include_files() - grab_macro() - grab_property() - handle_dynamic_macro_call() - handle_macro_call() - import_xml_namespaces() - init_stacks() - is_valid_name() - load_yaml() - main() - open_output() - parse() - parse_macro_arg() - print_location() - process() - process_doc() - process_file() - process_include() - remove_previous_comments() - resolve_macro() - safe_eval() - tokenize() ``` -------------------------------- ### xacro Python API Reference Source: https://docs.ros.org/en/humble/p/xacro/xacro This section outlines the structure of the xacro Python package API, listing its submodules, classes, and functions available for programmatic interaction. It provides a high-level overview of the package's exposed components. ```APIDOC xacro package: Submodules: - xacro.cli module - xacro.color module - xacro.substitution_args module - xacro.xmlutils module Module contents: Classes: - ConstructUnits - Macro - NameSpace - QuickLexer - Table - XacroException - YamlDictWrapper - YamlListWrapper Functions: - abs_filename_spec() - check_attrs() - create_global_symbols() - eval_all() - eval_default_arg() - eval_extension() - eval_text() - get_boolean_value() - get_include_files() - grab_macro() - grab_property() - handle_dynamic_macro_call() - handle_macro_call() - import_xml_namespaces() - init_stacks() - is_valid_name() - load_yaml() - main() - open_output() - parse() - parse_macro_arg() - print_location() - process() - process_doc() - process_file() - process_include() - remove_previous_comments() - resolve_macro() - safe_eval() - tokenize() ``` -------------------------------- ### xacro Python Package API Reference Source: https://docs.ros.org/en/humble/p/xacro/modules A comprehensive reference for the xacro Python package, detailing its modules, classes, and functions for XML macro expansion in ROS. ```APIDOC xacro package: Submodules: xacro.cli module: Classes: ColoredOptionParser IndentedHelpFormatterWithNL Functions: load_mappings() process_args() wrap_with_newlines() xacro.color module: Functions: colorize() error() is_tty() message() warning() xacro.substitution_args module: Exceptions: ArgException SubstitutionException Functions: convert_value() resolve_args() xacro.xmlutils module: Functions: attribute() first_child_element() fixed_writexml() next_sibling_element() opt_attrs() replace_node() reqd_attrs() Module contents (xacro): Classes: ConstructUnits: Attributes: angle_degrees angle_radians length_foot length_inches length_meters length_millimeters Methods: constructor() Macro NameSpace QuickLexer: Methods: lex() next() peek() Table: Methods: top() XacroException YamlDictWrapper YamlListWrapper: Methods: wrap() Functions: abs_filename_spec() check_attrs() create_global_symbols() eval_all() eval_default_arg() eval_extension() eval_text() get_boolean_value() get_include_files() grab_macro() grab_property() handle_dynamic_macro_call() handle_macro_call() import_xml_namespaces() init_stacks() is_valid_name() load_yaml() main() open_output() parse() parse_macro_arg() print_location() process() process_doc() process_file() process_include() remove_previous_comments() resolve_macro() ``` -------------------------------- ### xacro Python API Reference Source: https://docs.ros.org/en/humble/p/xacro This section outlines the main modules, classes, and functions available within the `xacro` Python package, providing a high-level overview of its programmatic interface for extending ROS XML macros. ```APIDOC xacro package: Submodules: - xacro.cli module - xacro.color module - xacro.substitution_args module - xacro.xmlutils module Module contents: Classes: - ConstructUnits - Macro - NameSpace - QuickLexer - Table - XacroException - YamlDictWrapper - YamlListWrapper Functions: - abs_filename_spec() - check_attrs() - create_global_symbols() - eval_all() - eval_default_arg() - eval_extension() - eval_text() - get_boolean_value() - get_include_files() - grab_macro() - grab_property() - handle_dynamic_macro_call() - handle_macro_call() - import_xml_namespaces() - init_stacks() - is_valid_name() - load_yaml() - main() - open_output() - parse() - parse_macro_arg() - print_location() - process() - process_doc() - process_file() - process_include() - remove_previous_comments() - resolve_macro() - safe_eval() - tokenize() ``` -------------------------------- ### Xacro ROS Package Definition (package.xml) Source: https://docs.ros.org/en/humble/p/xacro/__PACKAGE This XML snippet defines the `package.xml` for the Xacro ROS package. It specifies essential metadata such as the package name, version, description, maintainers, license, and URLs. It also lists build tool dependencies (ament_cmake, ament_cmake_python), runtime dependencies (ament_index_python, python3-yaml), and test dependencies (ament_lint_auto, ament_cmake_pytest), along with the build type. ```xml xacro 2.0.13 Xacro (XML Macros) Xacro is an XML macro language. With xacro, you can construct shorter and more readable XML files by using macros that expand to larger XML expressions. Robert Haschke Morgan Quigley BSD http://ros.org/wiki/xacro https://github.com/ros/xacro https://github.com/ros/xacro/issues Stuart Glaser William Woodall Robert Haschke ament_cmake ament_cmake_python ament_index_python python3-yaml ament_lint_auto ament_cmake_pytest ament_cmake ``` -------------------------------- ### xacro.process_file API Documentation Source: https://docs.ros.org/en/humble/p/xacro/xacro Represents the main processing pipeline for xacro files. ```APIDOC xacro.process_file(input_file_name, **kwargs) main processing pipeline ``` -------------------------------- ### xacro.print_location API Documentation Source: https://docs.ros.org/en/humble/p/xacro/xacro API documentation for the xacro.print_location function. ```APIDOC xacro.print_location() ``` -------------------------------- ### xacro.resolve_macro API Documentation Source: https://docs.ros.org/en/humble/p/xacro/xacro API documentation for the xacro.resolve_macro function. ```APIDOC xacro.resolve_macro(fullname, macros, symbols) ``` -------------------------------- ### Xacro Project BSD 3-Clause License Text Source: https://docs.ros.org/en/humble/p/xacro/__LICENSE This code snippet contains the complete text of the BSD 3-Clause License, a permissive open-source license. It specifies the conditions under which the software can be redistributed and modified, emphasizing the retention of copyright notices, disclaimer of warranties, and limitation of liability. ```License Copyright Robert Haschke, Bielefeld University Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ``` -------------------------------- ### xacro.safe_eval API Documentation Source: https://docs.ros.org/en/humble/p/xacro/xacro API documentation for the xacro.safe_eval function. ```APIDOC xacro.safe_eval(expr, globals, locals=None) ``` -------------------------------- ### xacro Python API Reference Source: https://docs.ros.org/en/humble/p/xacro/__standards This section provides a comprehensive reference for the xacro Python package, detailing its submodules, classes, and functions available for programmatic interaction. It outlines the structure of the API for developers. ```APIDOC xacro package: Submodules: - xacro.cli module - xacro.color module - xacro.substitution_args module - xacro.xmlutils module Module contents: Classes: - ConstructUnits - Macro - NameSpace - QuickLexer - Table - XacroException - YamlDictWrapper - YamlListWrapper Functions: - abs_filename_spec() - check_attrs() - create_global_symbols() - eval_all() - eval_default_arg() - eval_extension() - eval_text() - get_boolean_value() - get_include_files() - grab_macro() - grab_property() - handle_dynamic_macro_call() - handle_macro_call() - import_xml_namespaces() - init_stacks() - is_valid_name() - load_yaml() - main() - open_output() - parse() - parse_macro_arg() - print_location() - process() - process_doc() - process_file() - process_include() - remove_previous_comments() - resolve_macro() - safe_eval() - tokenize() ``` -------------------------------- ### Xacro Python Module API Reference Index Source: https://docs.ros.org/en/humble/p/xacro/genindex This snippet provides a structured overview of the 'xacro' Python module's API, including its main modules, classes with their methods and attributes, and standalone functions. It's organized to reflect the hierarchical nature of the API. ```APIDOC Modules: xacro xacro.cli xacro.color xacro.substitution_args xacro.xmlutils Classes: xacro.ConstructUnits: Attributes: angle_degrees angle_radians length_foot length_inches length_meters length_millimeters Methods: constructor() xacro.cli.ColoredOptionParser: Methods: error() xacro.cli.IndentedHelpFormatterWithNL: Methods: format_option() xacro.Macro xacro.QuickLexer: Methods: lex() xacro.substitution_args.ArgException Functions: xacro.abs_filename_spec() xacro.check_attrs() xacro.create_global_symbols() xacro.eval_all() xacro.eval_default_arg() xacro.eval_extension() xacro.eval_text() xacro.get_boolean_value() xacro.get_include_files() xacro.grab_macro() xacro.grab_property() xacro.handle_dynamic_macro_call() xacro.handle_macro_call() xacro.import_xml_namespaces() xacro.init_stacks() xacro.is_valid_name() xacro.load_yaml() xacro.main() xacro.substitution_args.convert_value() xacro.xmlutils.attribute() xacro.xmlutils.first_child_element() xacro.xmlutils.fixed_writexml() xacro.color.colorize() xacro.color.error() xacro.color.is_tty() xacro.color.message() xacro.cli.load_mappings() ``` -------------------------------- ### xacro.process API Documentation Source: https://docs.ros.org/en/humble/p/xacro/xacro Processes an XML input file and returns the processed XML, designed for use within Python code. ```APIDOC xacro.process(input_file_name, just_deps=False, xacro_ns=True, verbosity=1, mappings={}) Function to be used from python code, returning the processed XML ``` -------------------------------- ### xacro Python API Reference Source: https://docs.ros.org/en/humble/p/xacro/modules Detailed reference for the xacro Python package API, including its submodules, classes, and functions. This section outlines the programmatic interfaces available for interacting with xacro functionalities. ```APIDOC xacro package: Submodules: - xacro.cli - xacro.color - xacro.substitution_args - xacro.xmlutils Module contents (xacro): Classes: - ConstructUnits - Macro - NameSpace - QuickLexer - Table - XacroException - YamlDictWrapper - YamlListWrapper Functions: - abs_filename_spec() - check_attrs() - create_global_symbols() - eval_all() - eval_default_arg() - eval_extension() - eval_text() - get_boolean_value() - get_include_files() - grab_macro() - grab_property() - handle_dynamic_macro_call() - handle_macro_call() - import_xml_namespaces() - init_stacks() - is_valid_name() - load_yaml() - main() - open_output() - parse() - parse_macro_arg() - print_location() - process() - process_doc() - process_file() - process_include() - remove_previous_comments() - resolve_macro() - safe_eval() - tokenize() ``` -------------------------------- ### xacro.parse_macro_arg API Documentation Source: https://docs.ros.org/en/humble/p/xacro/xacro Parses the first parameter specification from a macro parameter string, supporting a specific syntax for default values and forward references. ```APIDOC xacro.parse_macro_arg(s) parse the first param spec from a macro parameter string s accepting the following syntax: [:=|=][^|] Parameters: s: param spec string Returns: param, (forward, default), rest-of-string forward: will be either param or None (depending on whether ^ was specified) default: will be the default string or None If there is no default spec at all, the middle pair will be replaced by None ``` -------------------------------- ### xacro.import_xml_namespaces API Documentation Source: https://docs.ros.org/en/humble/p/xacro/xacro Imports all namespace declarations into the parent element. ```APIDOC xacro.import_xml_namespaces(parent, attributes) import all namespace declarations into parent ``` -------------------------------- ### xacro.parse API Documentation Source: https://docs.ros.org/en/humble/p/xacro/xacro Parses input or a specified filename into a DOM tree. It handles various input types including strings, file objects, or existing DOM trees. ```APIDOC xacro.parse(inp, filename=None) Parse input or filename into a DOM tree. If inp is None, open filename and load from there. Otherwise, parse inp, either as string or file object. If inp is already a DOM tree, this function is a noop. Parameters: inp: The input to parse (string, file object, or None) filename: Optional filename if inp is None Returns: xml.dom.minidom.Document Raises: xml.parsers.expat.ExpatError ``` -------------------------------- ### xacro.substitution_args.resolve_args Function Definition Source: https://docs.ros.org/en/humble/p/xacro/xacro.substitution_args Resolves zero or more substitution arguments within a given string, adhering to the ROS wiki specification. It supports an optional context dictionary for 'arg' substitutions and returns the string with all arguments resolved. If the input string is None, it returns None. This function raises a `SubstitutionException` if any error occurs during the resolution process. ```APIDOC xacro.substitution_args.resolve_args(arg_str, context=None, filename=None) Description: Resolve substitution args (see wiki spec U{}). Parameters: arg_str (str): string to resolve zero or more substitution args in. arg_str may be None, in which case resolve_args will return None context (dict, optional): dictionary for storing results of the 'arg' substitution args. If no context is provided, a new one will be created for each call. Values for the 'arg' context should be stored as a dictionary in the 'arg' key. Returns: str: arg_str with substitution args resolved Raises: SubstitutionException: if there is an error resolving substitution args ``` -------------------------------- ### xacro.substitution_args.SubstitutionException Class Definition Source: https://docs.ros.org/en/humble/p/xacro/xacro.substitution_args This is the base class for all exceptions that may occur within the `substitution_args` routines. Other specific exceptions, like `ArgException`, inherit from this class. ```APIDOC exception xacro.substitution_args.SubstitutionException Bases: Exception Description: Base class for exceptions in substitution_args routines. ``` -------------------------------- ### Write XML with fixed formatting Source: https://docs.ros.org/en/humble/p/xacro/xacro.xmlutils A method for writing XML content with specified indentation and newline characters. This is likely an overridden or custom `writexml` method designed for consistent output. ```APIDOC xacro.xmlutils.fixed_writexml(self, writer, indent='', addindent='', newl='') ``` -------------------------------- ### xacro.substitution_args.ArgException Class Definition Source: https://docs.ros.org/en/humble/p/xacro/xacro.substitution_args Defines an exception specifically for cases where expected $(arg) values are missing during substitution argument processing. It inherits from `SubstitutionException`. ```APIDOC exception xacro.substitution_args.ArgException Bases: SubstitutionException Description: Exception for missing $(arg) values. ``` -------------------------------- ### Fetch optional attributes from XML tag Source: https://docs.ros.org/en/humble/p/xacro/xacro.xmlutils Helper routine for fetching a list of optional tag attributes from an XML DOM element node. It takes the tag and a list of attribute names, returning their values if present. ```APIDOC xacro.xmlutils.opt_attrs(tag: xml.dom.Element, attrs: List[str]) tag: DOM element node attrs: list of attributes to fetch ``` -------------------------------- ### Fetch required attributes from XML tag Source: https://docs.ros.org/en/humble/p/xacro/xacro.xmlutils Helper routine for fetching a list of required tag attributes from an XML DOM element node. It takes the tag and a list of attribute names and raises a RuntimeError if any specified required attribute is missing. ```APIDOC xacro.xmlutils.reqd_attrs(tag: xml.dom.Element, attrs: List[str]) -> Dict[str, str] tag: DOM element node attrs: list of attributes to fetch raise: RuntimeError if required attribute is missing ``` -------------------------------- ### Replace an XML node Source: https://docs.ros.org/en/humble/p/xacro/xacro.xmlutils Replaces an existing XML DOM node with another node. An optional parameter allows replacing only the content of the node rather than the node itself. ```APIDOC xacro.xmlutils.replace_node(node: xml.dom.Node, by: xml.dom.Node, content_only: bool = False) ```