ament_cmake config, how to register macros

asked 2023-07-23 23:45:27 -0500

gentijo gravatar image

Hi, in my project adding Micropython to MicroROS, I am taking a new tack to use the MP build system vs the MicroROS build system. I think this will help with supporting the different platforms that MP Supports.

Part of this process was to take the the script that checks out all the MicroROS modules and use the git submodule mechanism to track the versions and be able to lock into a specific release.

The problem I am having is that CMake on any of the MicroROS modules complains about missing ament macros or missing the ament_cmake_config file. I am sure this is just a path configuration thing but wanted to ask to see if someone could help me out.

The project is here https://github.com/gentijo/ROSBerryPy

Note: The Error Output is at the bottom of this message

To reproduce the problem

Check out the repo In the repo dir type:

 git submodule init
 git submodule update --recursive

This requires that Docker is installed, and it may not work on windows docker because it does not understand the /dev filesystem When that completes, in the repo directory execute "sh 00_build_container.sh" This will finish leaving you with a command prompt running inside the container.

At the prompt type:

cd /opt/esp-id
. ./export.sh

cd /opt/rosberrypy/microros/embeddedRTPS
idf.py build 
or type colcon build
or mkdir build && cd build && cmake ..

All will complain about missing macros or config files.

Error Output:

CMake Error at CMakeLists.txt:5 (find_package):
  By not providing "Findament_cmake_ros.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "ament_cmake_ros", but CMake did not find one.

  Could not find a package configuration file provided by "ament_cmake_ros"
  with any of the following names:

    ament_cmake_rosConfig.cmake
    ament_cmake_ros-config.cmake

  Add the installation prefix of "ament_cmake_ros" to CMAKE_PREFIX_PATH or
  set "ament_cmake_ros_DIR" to a directory containing one of the above files.
  If "ament_cmake_ros" provides a separate development package or SDK, be
  sure it has been installed.
edit retag flag offensive close merge delete