[ros-users] [Discourse.ros.org] [Next Generation ROS] Software reuse in ROS1 and ROS2

Dirk Thomas ros.discourse at gmail.com
Fri Jul 21 19:46:30 UTC 2017

[quote="dcconner, post:6, topic:2262"]
It seems that ROS2 uses the ROS1-style message generators, but the output headers are placed in different locations making it difficult to have common source files that can be built for either ROS1 or ROS2.

The rational why the include path of the generated C++ message code is different is to allow writing dual homed applications. E.g. the `ros1_bridge` needs to access the C++ message definitions for ROS 1 as well as ROS 2 in the same source file. If the generated files would have the same include path that would not be possible.

[quote="dcconner, post:6, topic:2262"]
Is it possible to have a common header generation scheme so either ROS1 or ROS2 puts the headers and Python class files into a common location relative to the include paths based on package setups?

It would be possible to generate additional headers which could then be added optionally to the `INCLUDE_DIR`. Those headers could than be used to access the message types using the same include path. But we haven't spend any time towards that.

[Visit Topic](https://discourse.ros.org/t/software-reuse-in-ros1-and-ros2/2262/8) or reply to this email to respond.

More information about the ros-users mailing list