examples2 icon indicating copy to clipboard operation
examples2 copied to clipboard

rosenv example conanfile.py representation

Open sschleic opened this issue 9 months ago • 0 comments

Hi There,

I was trying to use a conanfile.py instead of the provided conanfile.txt for the ROS navigation example. I followed https://blog.conan.io/2024/11/28/Enhancing-ros-builds-with-Conan.html and I used this conanfile.py: `from conan import ConanFile

class NavigaritonROS(ConanFile): name = "Navigation ROS" # You can change this to your project name version = "1.0" # You can change this to your project version

# No settings are necessary for this simple case
settings = "os", "compiler", "build_type", "arch"

# Define the required dependencies
requires = [
    "yaml-cpp/0.8.0"
]

# Define the generators
generators = [
    "CMakeDeps",
    "CMakeToolchain",
    "ROSEnv"
]`

The generator did its job and created navigation_ws/install/conan/conanrosenv.sh as expected but colcon build command failed by not finding the rclcpp/rclcpp.hpp file:

Image

Using the provided conanfile.txt is working fine.

Could you please give me some hints what is wrong using the conanfile.py?

sschleic avatar Feb 13 '26 11:02 sschleic