IntelRealSense / realsense-ros

ROS Wrapper for Intel(R) RealSense(TM) Cameras
http://wiki.ros.org/RealSense
Apache License 2.0
2.6k stars 1.76k forks source link

Cannot detect D455 by using RK3588S under ubuntu 24.04 and ros2 jazzy #3230

Closed YujieSuCWE closed 2 weeks ago

YujieSuCWE commented 1 month ago

I met the problem same as #3183 of being not able to find my device. My system is ubuntu 24.04, my librealsense version is v2.56.2, my ros distro is jazzy, and my realsense-ros version is 4.56.1. What is different is that I can open realsense-viewer, but still cannot find the device on both rs_launch.py and the viewer. I am pretty sure I used RSUSB backend method when compiling librealsense.

Originally posted by @YujieSuCWE in https://github.com/IntelRealSense/realsense-ros/issues/3183#issuecomment-2425291390

By the way, I also tried libuvc backend, and it also didn't work.

YujieSuCWE commented 1 month ago

I changed the librealsense version to v2.56.1, right now the realsense-ros failed to compile.

--- stderr: realsense2_camera
/home/geist/ros2_ws/src/realsense-ros-4.56.1/realsense2_camera/src/rs_node_setup.cpp: In member function ‘void realsense2_camera::BaseRealSenseNode::CalibConfigReadService(realsense2_camera_msgs::srv::CalibConfigReadRequest<std::allocator >::SharedPtr, realsense2_camera_msgs::srv::CalibConfigReadResponse<std::allocator >::SharedPtr)’: /home/geist/ros2_ws/src/realsense-ros-4.56.1/realsense2_camera/src/rs_node_setup.cpp:563:68: error: ‘class rs2::auto_calibrated_device’ has no member named ‘get_calibration_config’; did you mean ‘get_calibration_table’? 563 | res->calib_config = _dev.as().get_calibration_config(); | ^~~~~~

This is really weird, since I've checked and there is a get_calibration_config() in rs_device.hpp in my usr/local/include. Is it because of the compatibility of librealsense and realsense-ros versions?

MartyG-RealSense commented 1 month ago

Hi @YujieSuCWE librealsense 2.56.1 and ROS2 wrapper 4.56.1 are the correct version match, so there should not be an issue of compatibility between them. I note that you installed librealsense 2.56.2 before 2.56.1 though.

Each time that the librealsense version is changed, the ROS wrapper must be built again. Can you confirm whether you rebuilt the 4.56.1 wrapper after changing to librealsense 2.56.1 please?

Can you also confirm if your camera has firmware driver version 5.16.0.1 installed?

YujieSuCWE commented 1 month ago

Hello @MartyG-RealSense the error of not having get_calibration_config() is during the rebuilding of the 4.56.1 wrapper. I've checked the versions, and my camera firmware driver version was 5.13.x and I updated it. But right now I don't know if this will work since I cannot successfully build the wrapper.

MartyG-RealSense commented 1 month ago

Are you building from the ros2-master branch of the ROS wrapper or ros2-development please? You should be building from ros2-master.

YujieSuCWE commented 1 month ago

I built from the latest release by just downloading its zip.

MartyG-RealSense commented 1 month ago

The default kernel version of Ubuntu 24.04 is kernel 6.8. Support for patching kernel 6.8 was added in the current latest librealsense version 2.56.2.

So if libuvc or RSUSB are not working with Ubuntu 24 (there have been past reported cases of problems with this) then an alternative approach may be to build librealsense from source code without using libuvc or RSUSB, and apply the kernel patch script patch-realsense-ubuntu-lts-hwe.sh to the 6.8 kernel. In librealsense 2.56.2, patch-realsense-ubuntu-lts-hwe.sh was updated to support patching kernel 6.8.

YujieSuCWE commented 4 weeks ago

I think my linux kernel version is 6.10. Does this also need to add the patch?

MartyG-RealSense commented 4 weeks ago

Usually, if support is stated for specific major kernel versions ('6.5', '6.8', etc) then it means that only those versions are supported by patching and not newer ones yet. In that situation, the choice is either (a) to use libuvc / RSUSB or (b) not to use them and instead install librealsense from source code without applying a kernel patch.

YujieSuCWE commented 2 weeks ago

I re-installed ubuntu and redid all the processes. Now it successfully works and is able to detect the device. Thank you for your help!

MartyG-RealSense commented 2 weeks ago

You are very welcome. It's great to hear that you succeeded - thanks very much for the update! As you have achieved a solution, I will close this case. Thanks again!