I have ROS2 Foxy built from source on Windows 10 and I'm having trouble building the ros2_intel_realsense package. I built librealsense2 from source (since I previously had compatibility issues with the binary version on Python 3.8), using instructions from here and here. The python libraries are now working:
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyrealsense2 as rs
>>>
However, I am not able to build the ros2 package, instead I am getting a CMake error:
C:\sample_ws>colcon build --merge-install
Starting >>> cv_bridge
Starting >>> message_filters
Starting >>> camera_calibration_parsers
Starting >>> image_geometry
Finished <<< image_geometry [7.77s]
Starting >>> realsense_camera_msgs
Finished <<< camera_calibration_parsers [9.42s]
Starting >>> camera_info_manager
Finished <<< cv_bridge [15.2s]
Starting >>> opencv_tests
Finished <<< camera_info_manager [5.88s]
Starting >>> vision_opencv
Finished <<< opencv_tests [3.95s]
Finished <<< vision_opencv [4.49s]
Finished <<< message_filters [20.2s]
Starting >>> image_transport
Finished <<< realsense_camera_msgs [13.9s]
Finished <<< image_transport [7.33s]
Starting >>> image_common
Starting >>> realsense_ros2_camera
Finished <<< image_common [1.91s]
--- stderr: realsense_ros2_camera
CMake Error at CMakeLists.txt:65 (find_package):
By not providing "Findlibrealsense2.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"librealsense2", but CMake did not find one.
Could not find a package configuration file provided by "librealsense2"
with any of the following names:
librealsense2Config.cmake
librealsense2-config.cmake
Add the installation prefix of "librealsense2" to CMAKE_PREFIX_PATH or set
"librealsense2_DIR" to a directory containing one of the above files. If
"librealsense2" provides a separate development package or SDK, be sure it
has been installed.
---
Failed <<< realsense_ros2_camera [2.17s, exited with code 1]
Summary: 10 packages finished [30.2s]
1 package failed: realsense_ros2_camera
1 package had stderr output: realsense_ros2_camera
It seems that CMake is unable to locate my build of librealsense2. I am unable to locate librealsense2Config.cmake or librealsense2-config.cmake anywhere in my build directory. I have rebuilt several times with ALL_BUILD and it's always the same error. I have tried setting librealsense2_DIR to the root directory but it seems to fail. Any ideas?
Hello,
I have ROS2 Foxy built from source on Windows 10 and I'm having trouble building the ros2_intel_realsense package. I built librealsense2 from source (since I previously had compatibility issues with the binary version on Python 3.8), using instructions from here and here. The python libraries are now working:
However, I am not able to build the ros2 package, instead I am getting a CMake error:
It seems that CMake is unable to locate my build of librealsense2. I am unable to locate
librealsense2Config.cmake
orlibrealsense2-config.cmake
anywhere in my build directory. I have rebuilt several times with ALL_BUILD and it's always the same error. I have tried settinglibrealsense2_DIR
to the root directory but it seems to fail. Any ideas?