Technically colcon
doesn't mind from which ROS version a package is. From its point of view it only sees packages with a name and named dependencies and builds them in the order they need to be processed.
Practically this kind of mixing is more difficult. All packages in such mixed workspace share the same namespace. So if you have a ROS 1 and ROS 2 package with the same name the problem is that you can commonly only refer to one of them. E.g. if you want to import the C++ or Python code of a message the same package will likely exist in both ROS version and which ever is in the front of the search path will be found / used.
The ros1_bridge
e.g. uses CMake to find ROS 2 packages as well as pkg-config
to find ROS 1 packages to get around some of the limitation. But it is only possible to write a C++ program which talks to ROS 1 and ROS 2 at the same time because roscpp
and rclcpp
have different names / namespaces and no common dependencies.
Therefore I would suggest to limit the workspace mixing both ROS versions to a minimum and keep everything else you can in separate homogeneous workspaces, one for ROS 1, one for ROS 2, and the smallest possible for a mixture of packages which really need to access both ROS systems.
You can simply use ROS1 packages together with ROS2 packages using the ros1_bridge. Make sure to source the ros1 environment first and then the ros2 environment to prevent issues from mixing environments. W.r.t. launchfiles, I think you can write your ROS2 launchfile in python in such a way that it calls your ROS1 launchfile.
The easiest way to get this working however is from 3 terminals.
Terminal 1: Source ROS1 environment roslaunch whatever you want
Terminal 2: Source ROS1 environment Source ROS2 environment run ros1_bridge
Terminal 3: Source ROS2 environment ros2 launch whatever you want
Once you have your system working like this you can start looking into some fancy python or bash magic or use systemd to get everything to start automatically.
I'm not sure if there are proper guidelines on how you should start a ROS1 + ROS2 hybrid system.
Alternatively, Port the ROS1 packages to ROS2 and make a full ROS2 system (might be easier depending on the amount of ROS1 packages you're dealing with).