ros2 / rmw_implementation

CMake infrastructure and dependencies for rmw implementations
Apache License 2.0
21 stars 48 forks source link

Could not find ROS middleware implementation 'NOTFOUND' #220

Closed tdallapiazza closed 1 year ago

tdallapiazza commented 1 year ago

Hi, I'm trying to build rmw_implementation but I constantly get the following error:

CMake Error at some/path/install/rmw_implementation_cmake/share/rmw_implementation_cmake/cmake/get_default_rmw_implementation.cmake:60 (message):
  Could not find ROS middleware implementation 'NOTFOUND'.  Choose one of the
  following:
Call Stack (most recent call first):
  CMakeLists.txt:22 (get_default_rmw_implementation)

I did install fastrtps through the ubuntu repo.

sudo apt install libfastrtps-dev

Even if it sounds not really consistent, I can find .cmake files under /usr/local/share/etc... but the get_default_rmw_implementation macro still doesn't find it (even if it is the default one).

Bug report

Required Info:

Steps to reproduce issue

In a clean directory, clone all the following repo:

git clone -b humble https://github.com/ros2/ament_cmake_ros.git
git clone -b humble https://github.com/ros2/rosidl_defaults.git
git clone -b humble https://github.com/ros2/rosidl_dds.git
git clone -b humble https://github.com/osrf/osrf_testing_tools_cpp.git
git clone -b humble https://github.com/ros2/performance_test_fixture.git
git clone -b humble https://github.com/ros2/python_cmake_module.git
git clone -b humble https://github.com/ros2/launch.git
git clone -b humble https://github.com/ros2/mimick_vendor.git
git clone -b humble https://github.com/ros2/rcutils.git
git clone -b humble https://github.com/ros2/test_interface_files.git
git clone -b humble https://github.com/ros2/rcpputils.git
git clone -b humble https://github.com/ros2/unique_identifier_msgs.git
git clone -b humble https://github.com/ros2/rosidl.git
git clone -b humble https://github.com/ros2/rosidl_typesupport.git
colcon build
source ./intsall/setup.bash
git clone -b humble https://github.com/ament/ament_index.git
git clone -b humble https://github.com/ros2/libyaml_vendor.git
git clone -b humble https://github.com/ros2/spdlog_vendor.git
git clone -b humble https://github.com/ros2/rcl_logging.git
git clone -b humble https://github.com/ros2/rmw.git
git clone -b humble https://github.com/ros2/rmw_implementation.git
colcon build

Expected behavior

Build successful

Actual behavior

CMake Error as ROS middleware implementation is NOTFOUND

clalancette commented 1 year ago

As it stands, this configuration is probably not going to work. At least, it is not one that we test. If you'd like to compile rclcpp, you should follow the directions in http://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html .

tdallapiazza commented 1 year ago

Hi, So how do I decide to build only a minimal portion of ROS2? I have a node that only depends on rclcpp geometry_msgs packages. (I'm targetting headless embedded systems like Raspberry Pi)

clalancette commented 1 year ago

So how do I decide to build only a minimal portion of ROS2? I have a node that only depends on rclcpp geometry_msgs packages.

You can do colcon build --packages-up-to rclcpp geometry_msgs, which will only build that much of it.

tdallapiazza commented 1 year ago

This is exactly what I was missing! Many thanks!