Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake couldn't find realsense2 #2724

Closed
mericgeren opened this issue May 4, 2023 · 14 comments
Closed

CMake couldn't find realsense2 #2724

mericgeren opened this issue May 4, 2023 · 14 comments
Labels

Comments

@mericgeren
Copy link

mericgeren commented May 4, 2023

I am using Windows 10 and currently have ROS noetic, Intel Realsense SDK 2.0 v2.50.0 (with Intel.RealSense.SDK-WIN10-2.50.0.3785.exe) installed. But, when i follow Step 2 of installation instructions for realsense-ros (with tag 2.3.2) at the step where i enter the command: catkin_make clean i get the error message shown below:

-- +++ processing catkin package: 'realsense2_camera'
-- ==> add_subdirectory(realsense-ros/realsense2_camera)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Error at realsense-ros/realsense2_camera/CMakeLists.txt:42 (find_package):
Could not find a package configuration file provided by "realsense2" with
any of the following names:

realsense2Config.cmake
realsense2-config.cmake

Add the installation prefix of "realsense2" to CMAKE_PREFIX_PATH or set
"realsense2_DIR" to a directory containing one of the above files. If
"realsense2" provides a separate development package or SDK, be sure it has
been installed.

-- Configuring incomplete, errors occurred!
See also "C:/my_catkin_wp/build/CMakeFiles/CMakeOutput.log".
See also "C:/my_catkin_wp/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

could you help me on this issue please?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented May 4, 2023

Hi @mericgeren I would recommend against installing the ROS wrapper on Windows if it is possible to use Linux instead. It is possible to install the wrapper on Windows but the majority of attempts to do so are unsuccessful.

Using the direct version number of the wrapper (2.3.2) instead of a tag is the correct action on Windows.

When following the wrapper's Windows installation instructions, be careful to input each of the cd .. directory change commands so that you are in the correct directory when inputting the catkin_make clean command. I believe that after the two cd .. commands are used, you should be in the c:\catkin_ws\ directory (not \src) when inputting the catkin_make clean command.

The Intel RealSense team member who created the RealSense ROS1 wrapper has stated in the past that despite the advice in the error message to set a path for realsense2_DIR, you should not need to do this.

@mericgeren
Copy link
Author

mericgeren commented May 4, 2023

Hi, thank you for your advices. Unfortunatelly, i have to use Windows. I did the catkin_make clean in directly root of my workspace c:\my_catkin_wp (not in \src). Do you mean inputting git checkout 2.3.2 when you mention using the direct version of the wrapper instead of tag?

@MartyG-RealSense
Copy link
Collaborator

Yes, I mean inputting git checkout 2.3.2

@mericgeren
Copy link
Author

mericgeren commented May 4, 2023

I just tried your suggestion. But, the error seems to persist.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented May 4, 2023

Does the same occur if you put a V in front of the version number: git checkout v2.3.2

@mericgeren
Copy link
Author

mericgeren commented May 4, 2023

When i put a V in front of the version number i see this error:

error: pathspec 'v2.3.2' did not match any file(s) known to git

When i did this: C:\my_catkin_wp\src\realsense-ros>git checkout 2.3.2 i got the following message:

HEAD is now at f400d68 2.3.2

@MartyG-RealSense
Copy link
Collaborator

Thank you. Backtracking in the instructions a little, can you confirm that you:

  1. Cloned ddynamic_reconfigure into catkin_ws/src/

  2. Did catkin_init_workspace whilst in catkin_ws/src/

@mericgeren
Copy link
Author

mericgeren commented May 4, 2023

  1. Yes. I have cloned ddynamic_reconfigure into \src in my catkin workspace and i built it when i input catkin_make clear without any issue:

-- +++ processing catkin package: 'ddynamic_reconfigure'
-- ==> add_subdirectory(ddynamic_reconfigure)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy

  1. Yes. I did whilst in \src of my catkin workspace:

C:\my_catkin_wp\src>catkin_init_workspace
Creating symlink "C:\my_catkin_wp\src\CMakeLists.txt" pointing to "c:\opt\ros\noetic\x64\share\catkin\cmake\toplevel.cmake"

@MartyG-RealSense
Copy link
Collaborator

It appears that you have followed the entire procedure correctly and it still does not work. There is nothing else that can be done, unfortunately. As mentioned, installing the ROS wrapper on Windows usually does not succeed.

@mericgeren
Copy link
Author

mericgeren commented May 4, 2023

Thank you for your help. Doesn't editing CMakeLists.txt or package.xml in a way which enables cmake to create config.cmake files for realsense can solve this issue?

Or do i need to create config.make files for realsense ground up? If so how can i do this?

P.S. I am still interested in what does cause this problem and possible solutions to the problem.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented May 4, 2023

I could not find any references that indicate that editing CMakeLists.txt will solve the problem or how to perform such edits.

A RealSense ROS user at #2280 (comment) had the same problem on Windows with catkin_make clean and decided in the end not to use Windows. I appreciate that this is not an option in your case.

A RealSense user commented at #2280 (comment) that they were successful if they used the version number 2.2.22. So you could try the previous version number 2.3.1 instead of 2.3.2 to see if it makes a difference.

It is not known why this issue with Windows occurs and there are no other solutions for the ROS1 wrapper if it occurs. The ROS1 wrapper is also no longer updated and has been renamed ros1-legacy, with the ROS2 wrapper now being the one that is actively updated by the RealSense ROS development team.

A couple of ROS2 wrapper users got the RealSense ROS2 wrapper working with Windows at #2587 and #2660 after applying numerous step by step fixes, which illustrates the difficulty of achieving a successful wrapper installation on Windows.

@mericgeren
Copy link
Author

mericgeren commented May 4, 2023

Thank you so much for your time and your kind help. Currently trying 2.2.22 with Realsense SDK v2.42.0 i will update on a success or a failiure.

@mericgeren
Copy link
Author

mericgeren commented May 4, 2023

Hi, just tried all the steps from very beginning using ROS wrapper version 2.2.22 and Realsense SDK2.0 v2.42.0 exactly following steps without any mistake and unfortunatelly, i got the same error. But, i was able to input the command: C:\my_catkin_wp>roslaunch realsense2_camera rs_camera.launch

and i got the following messages afterwards:

... logging to C:\Users\User.ros\log\e1a068fe-ea60-11ed-b60c-8ca982e040b0\roslaunch-DESKTOP-2KBLDP7-9396.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://127.0.0.1:52491/

SUMMARY

PARAMETERS

  • /camera/realsense2_camera/accel_fps: -1
  • /camera/realsense2_camera/accel_frame_id: camera_accel_frame
  • /camera/realsense2_camera/accel_optical_frame_id: camera_accel_opti...
  • /camera/realsense2_camera/align_depth: False
  • /camera/realsense2_camera/aligned_depth_to_color_frame_id: camera_aligned_de...
  • /camera/realsense2_camera/aligned_depth_to_fisheye1_frame_id: camera_aligned_de...
  • /camera/realsense2_camera/aligned_depth_to_fisheye2_frame_id: camera_aligned_de...
  • /camera/realsense2_camera/aligned_depth_to_fisheye_frame_id: camera_aligned_de...
  • /camera/realsense2_camera/aligned_depth_to_infra1_frame_id: camera_aligned_de...
  • /camera/realsense2_camera/aligned_depth_to_infra2_frame_id: camera_aligned_de...
  • /camera/realsense2_camera/allow_no_texture_points: False
  • /camera/realsense2_camera/base_frame_id: camera_link
  • /camera/realsense2_camera/calib_odom_file:
  • /camera/realsense2_camera/clip_distance: -2.0
  • /camera/realsense2_camera/color_fps: -1
  • /camera/realsense2_camera/color_frame_id: camera_color_frame
  • /camera/realsense2_camera/color_height: -1
  • /camera/realsense2_camera/color_optical_frame_id: camera_color_opti...
  • /camera/realsense2_camera/color_width: -1
  • /camera/realsense2_camera/confidence_fps: -1
  • /camera/realsense2_camera/confidence_height: -1
  • /camera/realsense2_camera/confidence_width: -1
  • /camera/realsense2_camera/depth_fps: -1
  • /camera/realsense2_camera/depth_frame_id: camera_depth_frame
  • /camera/realsense2_camera/depth_height: -1
  • /camera/realsense2_camera/depth_optical_frame_id: camera_depth_opti...
  • /camera/realsense2_camera/depth_width: -1
  • /camera/realsense2_camera/device_type:
  • /camera/realsense2_camera/enable_accel: False
  • /camera/realsense2_camera/enable_color: True
  • /camera/realsense2_camera/enable_confidence: True
  • /camera/realsense2_camera/enable_depth: True
  • /camera/realsense2_camera/enable_fisheye1: False
  • /camera/realsense2_camera/enable_fisheye2: False
  • /camera/realsense2_camera/enable_fisheye: False
  • /camera/realsense2_camera/enable_gyro: False
  • /camera/realsense2_camera/enable_infra1: False
  • /camera/realsense2_camera/enable_infra2: False
  • /camera/realsense2_camera/enable_infra: False
  • /camera/realsense2_camera/enable_pointcloud: False
  • /camera/realsense2_camera/enable_pose: False
  • /camera/realsense2_camera/enable_sync: False
  • /camera/realsense2_camera/filters:
  • /camera/realsense2_camera/fisheye1_frame_id: camera_fisheye1_f...
  • /camera/realsense2_camera/fisheye1_optical_frame_id: camera_fisheye1_o...
  • /camera/realsense2_camera/fisheye2_frame_id: camera_fisheye2_f...
  • /camera/realsense2_camera/fisheye2_optical_frame_id: camera_fisheye2_o...
  • /camera/realsense2_camera/fisheye_fps: -1
  • /camera/realsense2_camera/fisheye_frame_id: camera_fisheye_frame
  • /camera/realsense2_camera/fisheye_height: -1
  • /camera/realsense2_camera/fisheye_optical_frame_id: camera_fisheye_op...
  • /camera/realsense2_camera/fisheye_width: -1
  • /camera/realsense2_camera/gyro_fps: -1
  • /camera/realsense2_camera/gyro_frame_id: camera_gyro_frame
  • /camera/realsense2_camera/gyro_optical_frame_id: camera_gyro_optic...
  • /camera/realsense2_camera/imu_optical_frame_id: camera_imu_optica...
  • /camera/realsense2_camera/infra1_frame_id: camera_infra1_frame
  • /camera/realsense2_camera/infra1_optical_frame_id: camera_infra1_opt...
  • /camera/realsense2_camera/infra2_frame_id: camera_infra2_frame
  • /camera/realsense2_camera/infra2_optical_frame_id: camera_infra2_opt...
  • /camera/realsense2_camera/infra_fps: -1
  • /camera/realsense2_camera/infra_height: -1
  • /camera/realsense2_camera/infra_rgb: False
  • /camera/realsense2_camera/infra_width: -1
  • /camera/realsense2_camera/initial_reset: False
  • /camera/realsense2_camera/json_file_path:
  • /camera/realsense2_camera/linear_accel_cov: 0.01
  • /camera/realsense2_camera/odom_frame_id: camera_odom_frame
  • /camera/realsense2_camera/ordered_pc: False
  • /camera/realsense2_camera/pointcloud_texture_index: 0
  • /camera/realsense2_camera/pointcloud_texture_stream: RS2_STREAM_COLOR
  • /camera/realsense2_camera/pose_frame_id: camera_pose_frame
  • /camera/realsense2_camera/pose_optical_frame_id: camera_pose_optic...
  • /camera/realsense2_camera/publish_odom_tf: True
  • /camera/realsense2_camera/publish_tf: True
  • /camera/realsense2_camera/rosbag_filename:
  • /camera/realsense2_camera/serial_no:
  • /camera/realsense2_camera/tf_publish_rate: 0.0
  • /camera/realsense2_camera/topic_odom_in: odom_in
  • /camera/realsense2_camera/unite_imu_method:
  • /camera/realsense2_camera/usb_port_id:
  • /rosdistro: noetic
  • /rosversion: 1.15.9

NODES
/camera/
realsense2_camera (nodelet/nodelet)
realsense2_camera_manager (nodelet/nodelet)

auto-starting new master
process[master]: started with pid [25632]
ROS_MASTER_URI=http://127.0.0.1:11311
setting /run_id to e1a068fe-ea60-11ed-b60c-8ca982e040b0
process[rosout-1]: started with pid [34352]
started core service [/rosout]
process[camera/realsense2_camera_manager-2]: started with pid [32776]
process[camera/realsense2_camera-3]: started with pid [1424]
[ERROR] [1683193739.130972600]: Skipped loading plugin with error: XML Document 'c:\opt\ros\noetic\x64\share\test_nodelet_topic_tools/test/test_nodelets.xml' has no Root Element. This likely means the XML is malformed or missing..
[ERROR] [1683193739.131334700]: Skipped loading plugin with error: XML Document 'test_nodelet/test_nodelet.xml' has no Root Element. This likely means the XML is malformed or missing..
[ INFO] [1683193739.156376700]: Initializing nodelet with 8 worker threads.
[ERROR] [1683193740.033440300]: Skipped loading plugin with error: XML Document 'c:\opt\ros\noetic\x64\share\test_nodelet_topic_tools/test/test_nodelets.xml' has no Root Element. This likely means the XML is malformed or missing..
[ERROR] [1683193740.033787300]: Skipped loading plugin with error: XML Document 'test_nodelet/test_nodelet.xml' has no Root Element. This likely means the XML is malformed or missing..
[ERROR] [1683193740.036096600]: Failed to load nodelet [/camera/realsense2_camera] of type [realsense2_camera/RealSenseNodeFactory] even after refreshing the cache: Could not find library corresponding to plugin realsense2_camera/RealSenseNodeFactory. Make sure the plugin description XML file has the correct name of the library and that the library actually exists.
[ERROR] [1683193740.036348900]: The error before refreshing the cache was: Could not find library corresponding to plugin realsense2_camera/RealSenseNodeFactory. Make sure the plugin description XML file has the correct name of the library and that the library actually exists.
[FATAL] [1683193740.037245400]: Failed to load nodelet '/camera/realsense2_cameraof typerealsense2_camera/RealSenseNodeFactoryto managerrealsense2_camera_manager'
←[31m[camera/realsense2_camera-3] process has died [pid 1424, exit code 4294967295, cmd c:\opt\ros\noetic\x64\lib\nodelet\nodelet.exe load realsense2_camera/RealSenseNodeFactory realsense2_camera_manager __name:=realsense2_camera __log:=C:\Users\User.ros\log\e1a068fe-ea60-11ed-b60c-8ca982e040b0\camera-realsense2_camera-3.log].
log file: C:\Users\User.ros\log\e1a068fe-ea60-11ed-b60c-8ca982e040b0\camera-realsense2_camera-3*.log←[0m

And there is the error i see in roslaunch.log:

[roslaunch][ERROR] 2023-05-04 13:07:09,405: [camera/realsense2_camera-3] process has died [pid 26052, exit code 4294967295, cmd c:\opt\ros\noetic\x64\lib\nodelet\nodelet.exe load realsense2_camera/RealSenseNodeFactory realsense2_camera_manager __name:=realsense2_camera __log:=C:\Users\User.ros\log\6acc16e5-ea63-11ed-a70a-8ca982e040b0\camera-realsense2_camera-3.log].
log file: C:\Users\User.ros\log\6acc16e5-ea63-11ed-a70a-8ca982e040b0\camera-realsense2_camera-3*.log

And there is what i see in rosout.log:

1683194827.514536100 Node Startup
1683194828.430147300 INFO /camera/realsense2_camera [D:\ws\src\ros_comm\clients\roscpp\src\libros\service.cpp:123(service::waitForService)] [topics: /rosout] waitForService: Service [/camera/realsense2_camera_manager/load_nodelet] is now available.
1683194829.162288000 ERROR /camera/realsense2_camera_manager [C:\opt\ros\noetic\x64\include\pluginlib./class_loader_imp.hpp:265(map<class std::basic_string<char,struct std::char_traits,class std::allocator >,class pluginlib::ClassDesc,struct std::less<class std::basic_string<char,struct std::char_traits,class std::allocator > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits,class std::allocator > const ,class pluginlib::ClassDesc> > > __cdecl pluginlib::ClassLoader::determineAvailableClasses)] [topics: /rosout] Skipped loading plugin with error: XML Document 'c:\opt\ros\noetic\x64\share\test_nodelet_topic_tools/test/test_nodelets.xml' has no Root Element. This likely means the XML is malformed or missing..
1683194829.164267000 ERROR /camera/realsense2_camera_manager [C:\opt\ros\noetic\x64\include\pluginlib./class_loader_imp.hpp:265(map<class std::basic_string<char,struct std::char_traits,class std::allocator >,class pluginlib::ClassDesc,struct std::less<class std::basic_string<char,struct std::char_traits,class std::allocator > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits,class std::allocator > const ,class pluginlib::ClassDesc> > > __cdecl pluginlib::ClassLoader::determineAvailableClasses)] [topics: /rosout] Skipped loading plugin with error: XML Document 'c:\opt\ros\noetic\x64\share\test_nodelet/test_nodelet.xml' has no Root Element. This likely means the XML is malformed or missing..
1683194829.168066500 ERROR /camera/realsense2_camera_manager [D:\ws\src\nodelet_core\nodelet\src\loader.cpp:300(Loader::load)] [topics: /rosout] Failed to load nodelet [/camera/realsense2_camera] of type [realsense2_camera/RealSenseNodeFactory] even after refreshing the cache: Could not find library corresponding to plugin realsense2_camera/RealSenseNodeFactory. Make sure the plugin description XML file has the correct name of the library and that the library actually exists.
1683194829.168580200 ERROR /camera/realsense2_camera_manager [D:\ws\src\nodelet_core\nodelet\src\loader.cpp:301(Loader::load)] [topics: /rosout] The error before refreshing the cache was: Could not find library corresponding to plugin realsense2_camera/RealSenseNodeFactory. Make sure the plugin description XML file has the correct name of the library and that the library actually exists.
1683194829.169295900 FATAL /camera/realsense2_camera [D:\ws\src\nodelet_core\nodelet\src\nodelet.cpp:243(loadNodelet)] [topics: /rosout] Failed to load nodelet '/camera/realsense2_cameraof typerealsense2_camera/RealSenseNodeFactoryto managerrealsense2_camera_manager'

This is from camera-realsense2_camera-3-stdout.log:

[ INFO] [1683194827.611246800]: Loading nodelet /camera/realsense2_camera of type realsense2_camera/RealSenseNodeFactory to manager realsense2_camera_manager with the following remappings:
[ INFO] [1683194827.631428000]: waitForService: Service [/camera/realsense2_camera_manager/load_nodelet] has not been advertised, waiting...
[ INFO] [1683194828.430132200]: waitForService: Service [/camera/realsense2_camera_manager/load_nodelet] is now available.

Thank you sincerely for all the help you offer.

@MartyG-RealSense
Copy link
Collaborator

The roslaunch log does not get to the point where the wrapper version and RealSense SDK version are detected before the first errors occur, which suggests to me that realsense2_camera (the wrapper) has not been built and so it cannot be loaded.

@mericgeren mericgeren closed this as not planned Won't fix, can't repro, duplicate, stale May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants