Skip to content

Commit

Permalink
Moved mermaid graphics to a new file
Browse files Browse the repository at this point in the history
Signed-off-by: Gonzalo de Pedro <[email protected]>
  • Loading branch information
gonzodepedro committed Jan 29, 2024
1 parent 52344ab commit 3573966
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 37 deletions.
44 changes: 7 additions & 37 deletions source/Concepts/Advanced/About-Internal-Interfaces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Empty file.
24 changes: 24 additions & 0 deletions source/Concepts/images/generator_client.mmd
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3573966

Please sign in to comment.