micro-ROS: Could not find ROS middleware implementation 'rmw_cyclonedds_cpp'
microROS installation received the following error message alert box
'colcon build' failed(rmw_implementation + 3)
/home/ubuntu/microros_ws/firmware/mcu_ws
I am following this 'Connect ESP32 to ROS2' below , I actually have galactic ROS2 in my Ubuntu 20.04.5 LTS host.
https://medium.com/@SameerT009/connect-esp32-to-ros2-foxy-5f06e0cc64df
After Step 5. Build firmware
Nothing to add. Just Copy and Paste. It takes a white to complete.
$ ros2 run micro_ros_setup build_firmware.sh
I get the error alert message **'colcon build' failed(rmw_implementation + 3)
/home/ubuntu/microros_ws/firmware/mcu_ws**
and the below details in the terminal:: Please Help. Thank you. I have done source
source /opt/ros/galactic/setup.bash
$ `cmake --version`
cmake version 3.16.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
snippet of error in terminal after above Step 5
error
CMake Error at /home/ubuntu/microros_ws/firmware/mcu_ws/install/share/rmw_implementation_cmake/cmake/get_default_rmw_implementation.cmake:60 (message):
Could not find ROS middleware implementation 'rmw_cyclonedds_cpp'. Choose
one of the following: rmw_microxrcedds
Call Stack (most recent call first):
CMakeLists.txt:22 (get_default_rmw_implementation)
---to fix above error
cd /home/ubuntu/microros_ws/firmware/mcu_ws/install/share/rmw_implementation_cmake
sudo nano package.xml
add
<build_depend>rmw</build_depend>
<depend>rmw_cyclonedds_cpp</depend>
Finished <<< rmw_microxrcedds [1.69s]
Starting >>> rmw_implementation
--- stderr: action_msgs
CMake Warning at /home/ubuntu/microros_ws/firmware/mcu_ws/install/share/rcutils/cmake/ament_cmake_export_libraries-extras.cmake:116 (message):
Package 'rcutils' exports library 'dl' which couldn't be found
Call Stack (most recent call first):
/home/ubuntu/microros_ws/firmware/mcu_ws/install/share/rcutils/cmake/rcutilsConfig.cmake:41 (include)
/home/ubuntu/microros_ws/firmware/mcu_ws/install/share/rosidl_runtime_c/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
/home/ubuntu/microros_ws/firmware/mcu_ws/install/share/rosidl_runtime_c/cmake/rosidl_runtime_cConfig.cmake:41 (include)
/home/ubuntu/microros_ws/firmware/mcu_ws/install/share/builtin_interfaces/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
/home/ubuntu/microros_ws/firmware/mcu_ws/install/share/builtin_interfaces/cmake/builtin_interfacesConfig.cmake:41 (include)
CMakeLists.txt:14 (find_package)
---
Finished <<< action_msgs [2.24s]
Starting >>> test_msgs
--- stderr: rmw_implementation
CMake Error at /home/ubuntu/microros_ws/firmware/mcu_ws/install/share/rmw_implementation_cmake/cmake/get_default_rmw_implementation.cmake:60 (message):
Could not find ROS middleware implementation 'rmw_cyclonedds_cpp'. Choose
one of the following: rmw_microxrcedds
Call Stack (most recent call first):
CMakeLists.txt:22 (get_default_rmw_implementation)
Asked by Achyut on 2023-02-13 02:24:05 UTC
Answers
As mentioned in #q412461 by @Pablogs, micro-ROS does not support Cyclone.
Seeing as you write you are using Galactic -- which uses rmw_cyclonedds_cpp
by default -- the error is "expected".
The CMake logic in rmw_implementation
is trying to see which RMW to build for, sees the RMW_IMPLEMENTATION
environment variable set to rmw_cyclonedds_cpp
(default for Galactic) and then tries to make that the standard for micro-ROS as well.
As that's not supported, the error message is printed.
The article you link documents/uses Foxy, which uses Fast-RTPS. micro-ROS does support Fast-RTPS, hence why it works there.
If you really want/need to keep using Galactic (note: it is end-of-life since December 2022), you could try installing ros-galactic-rmw-fastrtps-cpp
, export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
in the terminal you'll use to build everything, stopping the ROS 2 daemon (for good measure: ros2 daemon stop
), clearing out your micro-ROS workspace and then attempt the build again.
Note: to use micro-ROS, you will have to repeat the export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
for all terminals you will be starting ROS 2 / micro-ROS nodes in. You might want to add it to your .bashrc
or similar file.
Asked by gvdhoorn on 2023-02-14 02:26:03 UTC
Comments
Thank you @Pablogs and @gvdhoorn . I am Still getting the error after installing using/export rmw_fastrtps_cpp
---
Finished <<< action_msgs [2.04s]
Starting >>> test_msgs
--- stderr: rmw_implementation
CMake Error at /home/achyut/microros_ws/firmware/mcu_ws/install/share/rmw_implementation_cmake/cmake/get_default_rmw_implementation.cmake:60 (message):
Could not find ROS middleware implementation 'rmw_fastrtps_cpp'. Choose
one of the following: rmw_microxrcedds
Call Stack (most recent call first):
CMakeLists.txt:22 (get_default_rmw_implementation)
Asked by Achyut on 2023-02-14 13:59:09 UTC
Apologies. Where I wrote rmw_fastrtps_cpp
that should've been rmw_microxrcedds
, but what I don't really understand is why you have to set that manually. I don't recall to have done that.
Asked by gvdhoorn on 2023-02-16 10:56:59 UTC
export RMW_IMPLEMENTATION=rmw_microxrcedds
# Thank you @Pablogs and @gvdhoorn
# Then starting from the beginning of $colcon build, help me resolve this
# Steps: https://medium.com/@achyutros/ros-2-micro-ros-esp32-cam-camera-publisher-bc2faa7167f8
Asked by Achyut on 2023-02-20 10:28:56 UTC
Comments