You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/Concepts/Advanced/About-Internal-Interfaces.rst
+55Lines changed: 55 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -191,3 +191,58 @@ These are mainly used for error handling, commandline argument parsing, and logg
191
191
The ``rcutils`` |API| and implementation are located in the `ros2/rcutils <https://github.com/ros2/rcutils>`_ repository on |GitHub|_ which contains the interface as C headers.
192
192
193
193
For a complete definition of the ``rcutils`` |API|, see `the rcutils docs <https://docs.ros.org/en/{DISTRO}/p/rcutils/>`_.
194
+
195
+
Automatic code generation using template files
196
+
==============================================
197
+
198
+
As mentioned above, in order to deal with different DDS implementations, code has to be generated. Code generation is handled by a clever usage
199
+
of CMake and Ament. To simplify the explanation of this mechanism let's separate ROS2 projects that generate or need code to be generated in two types.
200
+
201
+
- ``Generator`` projects, which are the ones that have the templates and logic to generate code.
202
+
- ``Client`` projects, which are the ones that need code to be generated, they have the parameters to generate code.
203
+
204
+
For instance, typesupport packages that generate code for a particular dds implementation are *Generator* packages, same case that rosidl which
205
+
generates code from ros idl (.msg, .action, etc) files.
206
+
207
+
*Client* projects are typically projects that define messages, actions and services. Which have .msg files with rosidl defined on them which are
208
+
used by *Generator* projects to create code. A package that calls rosidl_generate_interfaces CMake macro is a *Client* project.
209
+
210
+
Code generation workflow
211
+
------------------------
212
+
213
+
On workspace build, the *generator* packages, registers a portion of CMake code as an ament_extension under 'rosidl_generate_idl_interfaces' key.
0 commit comments