[ros-users] [Discourse.ros.org] [Next Generation ROS] Syncronized callbacks in ROS2
ros.discourse at gmail.com
Tue Jan 2 22:25:11 UTC 2018
[quote="joq, post:10, topic:2015"]
Are there any preliminary design notes suggesting how that could be done?
[REP 149](http://www.ros.org/reps/rep-0149.html) addresses the blocker of package manifests being able to declare separate ROS 1 and ROS 2 dependencies.
>From a technical point of view it is then possible to have a ROS package using a single branch. The CMake logic can be made conditional based on the ROS version (the ROS 1 part using `catkin`, the ROS 2 part using `ament`). And the source code needs to distinguish between the ROS versions using whatever approach preferred (based on preprocessor definitions and/or conditional includes in C++, conditional imports in Python).
Of course anything which reduces differences between the ROS versions makes this more convenient and requires less conditional logic, e.g. typedefs, API shims, etc. On the other hand if a ROS package would like to use features from ROS 2 which aren't available in ROS 1 (e.g. multiple nodes in a single executable) than the code will need to be different for that.
[Visit Topic](https://discourse.ros.org/t/syncronized-callbacks-in-ros2/2015/11) or reply to this email to respond.
More information about the ros-users