Hi ROS community!
I am Dani, a member of the Conan C/C++ Package Manager team, and we would like to introduce conan-io/ros-conan: a collection of Conan recipes for installing and consuming ROS Kilted on Linux, macOS, and Windows.
We have recently been working to offer an alternative workflow for C++ developers: install ROS with Conan, declare it in a conanfile, and consume its libraries like any other C++ package.
Here is a quick demo of how it works:
This example demonstrates how to install ROS Kilted along with OpenCV and TensorFlow to create a ROS node application that tracks the human pose from an image input.
Let’s try it!
Here is a small guide on how to start using ROS with Conan:
Prepare Conan and the ROS recipes
ROS 2 Kilted targets Python 3.12. Create a virtual environment and install Conan.
On Linux or macOS:
python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install conan
conan profile detect --force
On Windows PowerShell:
py -3.12 -m venv .venv
.venv\Scripts\activate
python -m pip install conan
conan profile detect --force
Next, clone the recipes and add the repository as a local recipe index:
git clone https://github.com/conan-io/ros-conan.git
conan remote add ros-conan ./ros-conan --type=local-recipes-index
The recipe provides core, base, and desktop variants, allowing a project to select the part of the ROS distribution it needs.
Start with a ROS node in plain CMake
The clearest way to show the proposed workflow is a minimal C++ ROS node.
cd ros-conan/examples/consumer_cmake
The complete dependency declaration is in the conanfile.txt:
[requires]
ros-kilted/2026.06.17
[generators]
CMakeToolchain
CMakeDeps
[layout]
cmake_layout
The CMake side uses the standard package config and imported target provided by rclcpp:
cmake_minimum_required(VERSION 3.22)
project(conan_ros2_kilted_consumer CXX)
find_package(rclcpp REQUIRED)
add_executable(consumer_node src/main.cpp)
target_link_libraries(consumer_node PRIVATE rclcpp::rclcpp)
From the example directory, install the dependencies:
conan install --profile=../../profiles/ros --build=missing
This command builds ROS and any missing dependencies from source if the binaries are not already cached. The first run can take a while, but the resulting packages are cached for reuse.
Now build the application with the same commands used by any other CMake project:
# macOS and Linux
cmake --preset conan-release
cmake --build --preset conan-release
# Windows
cmake --preset conan-default
cmake --build --preset conan-release
Activate the environment:
# macOS and Linux
/build/generators/conanrun.sh
# Windows
.\build\generators\conanrun.bat
And run the node:
# macOS and Linux
./build/Release/consumer_node
# Windows
.\build\Release\consumer_node.exe
[INFO] [...] [conan_test_package_node]: Conan consumer_node: rclcpp linked and node started.
There is no ROS-specific project layout, package.xml, ament_cmake integration, or colcon workspace in this example.
An existing CMake application can add ROS without adopting a separate development flow, while Conan manages ROS and the application’s other C++ dependencies together.
As an alternative, for projects using a colcon workspace, the colcon example shows the same Conan-provided ROS installation being consumed by ordinary ament_cmake packages. Teams can choose the development model that fits each project.
Run a familiar ROS tutorial
The packaged ROS installation also supports the usual ROS commands. Let’s use the desktop variant to run the turtlesim tutorial.
cd ros-conan/examples/consumer_cmake
First of, update the conanfile.txt to indicate the desktop variant for this case (as this is the one that includes the turtlesim package):
[requires]
ros-kilted/2026.06.17
[options]
ros-kilted/*:variant=desktop
Use the install command to install and build the packages as we did previously (this will take some time as the desktop variant includes many more packages of ROS):
conan install --profile=../../profiles/ros --build=missing
Activate the generated run environment and launch turtlesim as described in the ROS tutorials:
# Linux and macOS
source conanrun.sh
ros2 run turtlesim turtlesim_node
REM Windows
conanrun.bat
ros2 run turtlesim turtlesim_node
In a second terminal, launch the keyboard controller. You can use conan run command to launch the command inside the enviroment directly:
conan run "ros2 run turtlesim turtle_teleop_key" --profile=ros-conan/profiles/ros
The ROS commands and behavior are unchanged, Conan supplies the installation and runtime environment.
Why consume ROS with Conan?
Bringing ROS into the Conan dependency graph offers several advantages:
-
A native C++ workflow: plain CMake projects can use
find_package(rclcpp REQUIRED)and link torclcpp::rclcpp. They do not need acolconworkspace orament_cmake. -
The same workflow as any other C/C++ package: declare ROS in a
conanfileand use the same install command, profiles, options, lockfiles, and local cache across Linux, macOS, and Windows. -
One dependency graph for the whole application: Conan detects version conflicts and lets ROS compose directly with libraries from ConanCenter (the Conan central repository for open-source libraries), such as OpenCV, Eigen, or TensorFlow Lite.
-
Per-project ROS dependency: Different ROS versions and distributions could coexist in the Conan cache on the same machine. Each project would select and activate its own ROS dependency without colliding with a system-wide installation.
We would like your feedback
ROS 2 Kilted is the first distribution covered by these recipes. The core and desktop variants are exercised in CI by building from source for Linux (gcc 13, X86_64/ARM64), macOS (clang 17, x86_64/ARM64), and Windows (MSVC 19.40).
We would particularly like to hear:
-
How does the proposed native C/C++ workflow compare with the traditional ROS development workflow for your projects?
-
Would per-project ROS dependencies help you develop and test packages against multiple ROS versions or distributions?
-
Which third-party C or C++ packages would you want to combine with ROS through the same
conanfile? -
Which ROS distributions, package variants, and platforms should we prioritize next?
Please try the quick start and examples and share your experience in this thread. Bugs and contributions are also welcome in the repository’s issues and pull requests.
We will be at ROSCon Global 2026 in Toronto, so if you are attending, we would be very happy to discuss this workflow and your feedback in person.
Thanks for taking a look. We are looking forward to hearing what you think!