Skip to content

Conversation

@iory
Copy link
Contributor

@iory iory commented Oct 27, 2025

This PR adds support for a new marker file CATKIN_IGNORE_ROS2 to enable better coexistence of ROS1 and ROS2 packages in the same workspace.

Problem

Currently, when using CATKIN_IGNORE in a mixed ROS1/ROS2 workspace:

  • Both catkin_tools and colcon recognize and ignore packages with CATKIN_IGNORE
  • This makes it impossible to have catkin_tools ignore ROS2 packages while allowing colcon to build them

Solution

Introduce a new marker file CATKIN_IGNORE_ROS2 that:

  • Is recognized only by catkin_tools (colcon does not recognize it)
  • Allows catkin_tools to skip ROS2 packages without affecting colcon's behavior
  • Maintains backward compatibility with existing CATKIN_IGNORE functionality

Changes

  • Added CATKIN_IGNORE_ROS2 to the ignore_markers set in find_packages()
  • Updated help message in catkin clean command to mention the new marker

Usage

For ROS2 packages that should be ignored by catkin_tools but built by colcon:

touch ros2_package/CATKIN_IGNORE_ROS2

This enables truly mixed ROS1/ROS2 workspaces where each build tool can operate independently.

This allows catkin_tools to ignore ROS2 packages without affecting colcon,
enabling better coexistence of ROS1 and ROS2 packages in the same workspace.

- Add CATKIN_IGNORE_ROS2 to ignore_markers in find_packages()
- Update help message in catkin clean command
@mikepurvis
Copy link
Member

I've been handling this scenario with colcon build --packages-up-to my_robot_ros2/1 though that does require having one or more top-level packages that aggregate.

@iory
Copy link
Contributor Author

iory commented Oct 28, 2025

Thank you for the suggestion! That's indeed a valid approach for scenarios where you only want to build a specific subset of ROS2 packages using colcon.

However, the goal of this PR (CATKIN_IGNORE_ROS2) is slightly different and aims to simplify the coexistence of both build systems in a shared workspace, especially for users who actively switch between ROS1 and ROS2 development.

The --packages-up-to approach requires:

  1. Maintaining a top-level meta-package that aggregates all target ROS2 packages.
  2. Users to remember and type the specific option (--packages-up-to [meta-package]) every time they build with colcon.

This PR allows for a more "declarative" approach. By simply adding a CATKIN_IGNORE_ROS2 file, catkin_tools explicitly ignores ROS2 packages.

The primary benefit is simplicity for the end-user:

  • To build ROS1 packages: run $ catkin build
  • To build ROS2 packages: run $ colcon build

No extra options or meta-packages are needed. This is particularly valuable in educational settings (like universities or labs) where students are learning both ROS1 and ROS2, often in the same environment. It lowers the barrier to entry and reduces confusion, allowing them to focus on the robotics concepts rather than complex build tool configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants