We are in the process of converting several package to support both ros and ros2. In some of the repositories a large portion of the code can easly be made to build for ros and ros2, example shown here. For other packages that leverage action, services, topics it becomes messy with a lot of #ifdef. We have been discussing internally possible options described below and we are interested to get feedback and if there is alternative solution that have not been listed.
Option 1
Create three repositories.
One for the core packages that can be easily built with ros and ros2.
One containing ros packages
One containing ros2 packages, which should be the same package in ros just upgraded to ros2.
Option 2
Create two repositories
One for the core packages that can be easily built with ros and ros2.
One for both ros and ros2 packages. In this repository there would be a branch for ros(master) and a branch for ros2(master). Then label the release branches something along the lines of ros-kinetic and ros2-crystal.
We are in the process of converting several package to support both ros and ros2. In some of the repositories a large portion of the code can easly be made to build for ros and ros2, example shown here. For other packages that leverage action, services, topics it becomes messy with a lot of #ifdef. We have been discussing internally possible options described below and we are interested to get feedback and if there is alternative solution that have not been listed.