ROSEnv

The ROSEnv generator is an environment generator that, in conjuction with CMakeDeps and CMakeToolchain, allows to consume Conan packages from a ROS package.

conanfile.txt

  1. [requires]
  2. fmt/11.0.2
  3. [generators]
  4. CMakeDeps
  5. CMakeToolchain
  6. ROSEnv

This generator will create a conanrosenv.sh script with the required environment variables that allow CMake and Colcon to locate the pacckages installed by Conan.

This script needs to be sourced before the colcon build command:

  1. $ cd workspace
  2. $ conan install ...
  3. $ source conanrosenv.sh
  4. $ colcon build

Reference

class ROSEnv(conanfile)

Generator to serve as integration for Robot Operating System 2 development workspaces.

IMPORTANT: This generator should be used together with CMakeDeps and CMakeToolchain generators.

  • Parameters:

    conanfile< ConanFile object > The current recipe object. Always use self.

  • generate()

    Creates a conanrosenv.sh with the environment variables that are needed to build and execute ROS packages with Conan dependencies.