From 3573966ee57756a807f60010555705c62f07df82 Mon Sep 17 00:00:00 2001 From: Gonzalo de Pedro Date: Mon, 29 Jan 2024 14:49:20 -0300 Subject: [PATCH] Moved mermaid graphics to a new file Signed-off-by: Gonzalo de Pedro --- .../Advanced/About-Internal-Interfaces.rst | 44 +++---------------- source/Concepts/images/code_generator.mmd | 0 source/Concepts/images/generator_client.mmd | 24 ++++++++++ 3 files changed, 31 insertions(+), 37 deletions(-) create mode 100644 source/Concepts/images/code_generator.mmd create mode 100644 source/Concepts/images/generator_client.mmd diff --git a/source/Concepts/Advanced/About-Internal-Interfaces.rst b/source/Concepts/Advanced/About-Internal-Interfaces.rst index 405981525c1..9ecfe82e037 100644 --- a/source/Concepts/Advanced/About-Internal-Interfaces.rst +++ b/source/Concepts/Advanced/About-Internal-Interfaces.rst @@ -215,47 +215,17 @@ On workspace build, the *generator* packages, registers portions of CMake code a Hook registration on CodeGenerator project build -```mermaid -sequenceDiagram - participant CodeGenerator_cmake - participant ament_package - participant ament_register_extension - CodeGenerator_cmake->>ament_package: CONFIG_EXTRAS - ament_package->>ament_register_extension: rosidl_create_type_descriptions_extensions, cmake_code_hook - ament_package->>ament_register_extension: rosidl_write_generator_arguments_extensions, cmake_code_hook - ament_package->>ament_register_extension: rosidl_generate_idl_interfaces, cmake_code_hook - Note right of ament_package: Execute a cmake.in template with variables and a cmake code hook. -``` +.. figure:: ../images/code_generator.svg + :alt: code generator sequence diagram + + Figure: sequence diagram of "code generator" interaction with CMake extensions. When the *client* package, during its build process, calls the 'rosidl_generate_interfaces' macro, the extensions that were registered for each of the *generator* packages, get called. On 'rosidl_write_generator_arguments_extensions' arguments files are generated with all parameters required to call the templates engine. After collecting all the arguments files, the extension calls the template engine for all the arguments files at once. Once code is generated, the 'rosidl_generate_idl_interfaces' extensiones are called to get code added to an artifact (a library) and export dependiences. -```mermaid -sequenceDiagram - participant project_with_rosidl_files - participant rosidl_generate_interfaces - participant rosidl_create_type_descriptions_extensions_HOOK - participant rosidl_generate_idl_interfaces_HOOK - participant rosidl_write_generator_arguments_extensions_HOOK - participant generate_arguments_file - participant rosidl_generator - project_with_rosidl_files->>rosidl_generate_interfaces: path_to_idl_files - loop ForEach rosidl_create_type_descriptions_extensions Hook - rosidl_generate_interfaces->>rosidl_create_type_descriptions_extensions_HOOK: path_to_idl_files, parameters - end - loop ForEach rosidl_write_generator_arguments_extensions Hook - rosidl_generate_interfaces->>rosidl_write_generator_arguments_extensions_HOOK: path_to_idl_files, parameters - activate generate_arguments_file - rosidl_write_generator_arguments_extensions_HOOK->>generate_arguments_file: path_to_idl_files, parameters - generate_arguments_file->>rosidl_write_generator_arguments_extensions_HOOK: arguments_file - deactivate generate_arguments_file - rosidl_write_generator_arguments_extensions_HOOK->>rosidl_generate_interfaces: arguments_file - end - rosidl_generate_interfaces>>rosidl_generator: [arguments_files] - loop ForEach rosidl_generate_idl_interfaces Hook - rosidl_generate_interfaces->>rosidl_generate_idl_interfaces_HOOK: generated_files - end -``` +.. figure:: ../images/generator_client.svg + :alt: generator client sequence diagram + Figure: sequence diagram of "generator client" interaction with CMake extensions. diff --git a/source/Concepts/images/code_generator.mmd b/source/Concepts/images/code_generator.mmd new file mode 100644 index 00000000000..e69de29bb2d diff --git a/source/Concepts/images/generator_client.mmd b/source/Concepts/images/generator_client.mmd new file mode 100644 index 00000000000..eb1142c5df6 --- /dev/null +++ b/source/Concepts/images/generator_client.mmd @@ -0,0 +1,24 @@ +sequenceDiagram + participant project_with_rosidl_files + participant rosidl_generate_interfaces + participant rosidl_create_type_descriptions_extensions_HOOK + participant rosidl_generate_idl_interfaces_HOOK + participant rosidl_write_generator_arguments_extensions_HOOK + participant generate_arguments_file + participant rosidl_generator + project_with_rosidl_files->>rosidl_generate_interfaces: path_to_idl_files + loop ForEach rosidl_create_type_descriptions_extensions Hook + rosidl_generate_interfaces->>rosidl_create_type_descriptions_extensions_HOOK: path_to_idl_files, parameters + end + loop ForEach rosidl_write_generator_arguments_extensions Hook + rosidl_generate_interfaces->>rosidl_write_generator_arguments_extensions_HOOK: path_to_idl_files, parameters + activate generate_arguments_file + rosidl_write_generator_arguments_extensions_HOOK->>generate_arguments_file: path_to_idl_files, parameters + generate_arguments_file->>rosidl_write_generator_arguments_extensions_HOOK: arguments_file + deactivate generate_arguments_file + rosidl_write_generator_arguments_extensions_HOOK->>rosidl_generate_interfaces: arguments_file + end + rosidl_generate_interfaces>>rosidl_generator: [arguments_files] + loop ForEach rosidl_generate_idl_interfaces Hook + rosidl_generate_interfaces->>rosidl_generate_idl_interfaces_HOOK: generated_files + end \ No newline at end of file