IntelRealSense / librealsense

Intel® RealSense™ SDK
https://www.intelrealsense.com/
Apache License 2.0
7.45k stars 4.81k forks source link

Compatible librealsense package with realsense-ros for ros2-hkr? #11945

Closed kenloumixx closed 1 year ago

kenloumixx commented 1 year ago

Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):

* Consider checking out SDK [examples](https://github.com/IntelRealSense/librealsense/tree/master/examples#sample-code-for-intel-realsense-cameras).
* Have you looked in our [documentations](https://github.com/IntelRealSense/librealsense/tree/master/doc#useful-links)?
* Is you question a [frequently asked one](https://github.com/IntelRealSense/librealsense/wiki/Troubleshooting-Q%26A)?
* Try [searching our GitHub Issues](https://github.com/IntelRealSense/librealsense/issues?utf8=%E2%9C%93&q=is%3Aissue) (open and closed) for a similar issue.

Required Info
Camera Model { D400 }
Firmware Version (Open RealSense Viewer --> Click info)
Operating System & Version {Linux (Ubuntu 18) }
Kernel Version (Linux Only) 4.9.14
Platform NVIDIA Jetson TX2
SDK Version 2.54.1
Language {C/C#/labview/nodejs/opencv/pcl/python/unity }
Segment {Robot/Smartphone/VR/AR/others }

Issue Description

Hello everyone, I work in docker container setting with ROS2 galactic build from source in ubuntu 18.04. I am trying to build realsense-ros2 of version ros2-hkr with librealsense 2.54.1 installed. When colcon build, realsense2_camera package fails to be built with the error Intel RealSense SDK 2.0 is missing, please install it from https://github.com/IntelRealSense/librealsense/releases I'd like to figure out how to find the matched version of librealsense. TIA

MartyG-RealSense commented 1 year ago

Hi @kenloumixx As that ros2-hkr branch's realsense2_camera is dated at 2 weeks old at the time of writing this, it is likely intended for use with librealsense 2.51.1 rather than 2.54.1, as the latest ROS wrapper 4.54.1 was only released yesterday. The current naming convention for ROS wrappers is that the numbers after '4' reflect the number of the matching librealsense version (e.g 4.54.1 wrapper, 2.54.1 librealsense).

https://github.com/IntelRealSense/realsense-ros

kenloumixx commented 1 year ago

Thank you for the answer! If I understand correctly, you mean that I should use librealsense 2.51.1 and Ros wrapper 4.54.1?? I installed the librealsense following the manual in this link, but librealsense 2.54.1 is installed. How can I specify the version of librealsense?

MartyG-RealSense commented 1 year ago

The matching ROS wrapper for 2.51.1 is wrapper 4.51.1.

Usually the librealsense version to match to is listed in the 'Supported RealSense SDK' section of the release notes for a particular wrapper version. The notes for wrapper 4.51.1 can be found at the link below.

https://github.com/IntelRealSense/realsense-ros/releases/tag/4.51.1

image

Information about specifying a particular librealsense version to install instead of the latest one can be found at https://github.com/IntelRealSense/librealsense/issues/10526

kenloumixx commented 1 year ago

Thank you for the response :) Well I run the command ros2 launch realsense2_camera rs_launch.py align_depth.enable:=true pointcloud.ordered_pc:=true pointcloud.enable:=true initial_reset:=true with the right versions of librealsense and realsense-ros wrapper, but it shows the warning

[realsense2_camera_node-1] [WARN] [1688128656.710690918] [camera.camera]: 
[realsense2_camera_node-1] [WARN] [1688128656.890759458] [camera.camera]: No stream match for pointcloud chosen texture Process - Color
[realsense2_camera_node-1] [WARN] [1688128657.629850832] [camera.camera]: No stream match for pointcloud chosen texture Process - Color
[realsense2_camera_node-1] [WARN] [1688128658.100398240] [camera.camera]: No stream match for pointcloud chosen texture Process - Color
[realsense2_camera_node-1] [WARN] [1688128659.462177329] [camera.camera]: No stream match for pointcloud chosen texture Process - Color
[realsense2_camera_node-1] [WARN] [1688128659.979261125] [camera.camera]: No stream match for pointcloud chosen texture Process - Color
[realsense2_camera_node-1] [WARN] [1688128662.467378269] [camera.camera]: No stream match for pointcloud chosen texture Process - Color
[realsense2_camera_node-1] [WARN] [1688128663.858762725] [camera.camera]: No stream match for pointcloud chosen texture Process - Color

with no messages on the topic /camera/depth/color/points..

MartyG-RealSense commented 1 year ago

The warning No stream match for pointcloud chosen texture Process - Color indicates that color frames cannot be found.

Which RealSense camera model are you using, please?

kenloumixx commented 1 year ago

I am using Depth Camera 435. May I ask if color frames are RGB frames??

MartyG-RealSense commented 1 year ago

Thanks for the model confirmation. So color frames should be available on D435 as it has an RGB sensor.

Yes, color frames are RGB frames.

Does theno stream match warning still occur if a low color and depth resolution of 648x480 for both is defined?

ros2 launch realsense2_camera rs_launch.py align_depth.enable:=true pointcloud.ordered_pc:=true pointcloud.enable:=true initial_reset:=true depth_module.profile:=640x480x30 rgb_camera.profile:=640x480x30

kenloumixx commented 1 year ago

No stream match for pointcloud chosen texture Process - Color has gone but other messages including resolution related error appear as below:

[INFO] [realsense2_camera_node-1]: process started with pid [12056]
[realsense2_camera_node-1] [INFO] [1688191117.827538616] [camera.camera]: RealSense ROS v4.51.1
[realsense2_camera_node-1] [INFO] [1688191117.828183104] [camera.camera]: Built with LibRealSense v2.51.1
[realsense2_camera_node-1] [INFO] [1688191117.828385347] [camera.camera]: Running with LibRealSense v2.51.1
[realsense2_camera_node-1] [INFO] [1688191117.883182560] [camera.camera]: Device with serial number 117322074667 was found.
[realsense2_camera_node-1] 
[realsense2_camera_node-1] [INFO] [1688191117.883575237] [camera.camera]: Device with physical ID /sys/devices/3610000.xhci/usb2/2-3/2-3.3/2-3.3:1.0/video4linux/video0 was found.
[realsense2_camera_node-1] [INFO] [1688191117.883986890] [camera.camera]: Device with name Intel RealSense D435I was found.
[realsense2_camera_node-1] [INFO] [1688191117.886486570] [camera.camera]: Device with port number 2-3.3 was found.
[realsense2_camera_node-1] [INFO] [1688191117.886721485] [camera.camera]: Device USB type: 3.2
[realsense2_camera_node-1] [INFO] [1688191117.886929584] [camera.camera]: Resetting device...
[realsense2_camera_node-1] [INFO] [1688191124.009958754] [camera.camera]: Device with serial number 117322074667 was found.
[realsense2_camera_node-1] 
[realsense2_camera_node-1] [INFO] [1688191124.010340582] [camera.camera]: Device with physical ID /sys/devices/3610000.xhci/usb2/2-3/2-3.3/2-3.3:1.0/video4linux/video0 was found.
[realsense2_camera_node-1] [INFO] [1688191124.010588458] [camera.camera]: Device with name Intel RealSense D435I was found.
[realsense2_camera_node-1] [INFO] [1688191124.014058294] [camera.camera]: Device with port number 2-3.3 was found.
[realsense2_camera_node-1] [INFO] [1688191124.015452168] [camera.camera]: Device USB type: 3.2
[realsense2_camera_node-1] [INFO] [1688191124.025830828] [camera.camera]: getParameters...
[realsense2_camera_node-1] [INFO] [1688191124.029713437] [camera.camera]: JSON file is not provided
[realsense2_camera_node-1] [INFO] [1688191124.029924896] [camera.camera]: Device Name: Intel RealSense D435I
[realsense2_camera_node-1] [INFO] [1688191124.030074114] [camera.camera]: Device Serial No: 117322074667
[realsense2_camera_node-1] [INFO] [1688191124.030207748] [camera.camera]: Device physical port: /sys/devices/3610000.xhci/usb2/2-3/2-3.3/2-3.3:1.0/video4linux/video0
[realsense2_camera_node-1] [INFO] [1688191124.030377510] [camera.camera]: Device FW version: 05.12.14.50
[realsense2_camera_node-1] [INFO] [1688191124.030554152] [camera.camera]: Device Product ID: 0x0B3A
[realsense2_camera_node-1] [INFO] [1688191124.031216721] [camera.camera]: Sync Mode: Off
[realsense2_camera_node-1] [WARN] [1688191124.154634006] [camera.camera]: re-enable the stream for the change to take effect.
[realsense2_camera_node-1] [ERROR] [1688191124.219673907] [camera.camera]: Given value, 640x480x3 is invalid. Set ROS param back to: 1280x720x30
[realsense2_camera_node-1] [INFO] [1688191124.227626808] [camera.camera]: Set ROS param gyro_fps to default: 200
[realsense2_camera_node-1] [INFO] [1688191124.228174047] [camera.camera]: Set ROS param accel_fps to default: 100
[realsense2_camera_node-1] [INFO] [1688191124.293211676] [camera.camera]: Stopping Sensor: Stereo Module
[realsense2_camera_node-1] [INFO] [1688191124.334644556] [camera.camera]: Starting Sensor: Stereo Module
[realsense2_camera_node-1] [INFO] [1688191124.399793162] [camera.camera]: Open profile: stream_type: Depth(0), Format: Z16, Width: 640, Height: 480, FPS: 30
[realsense2_camera_node-1] [INFO] [1688191124.402681359] [camera.camera]: Stopping Sensor: RGB Camera
[realsense2_camera_node-1] [INFO] [1688191124.418344247] [camera.camera]: Starting Sensor: RGB Camera
[realsense2_camera_node-1] [INFO] [1688191124.432041253] [camera.camera]: Open profile: stream_type: Color(0), Format: RGB8, Width: 1280, Height: 720, FPS: 30
[realsense2_camera_node-1] [INFO] [1688191124.434251041] [camera.camera]: RealSense Node Is Up!
[realsense2_camera_node-1] [WARN] [1688191124.468748473] [camera.camera]: 
[realsense2_camera_node-1] [WARN] [1688191145.804841561] [camera.camera]: No stream match for pointcloud chosen texture Process - Color
[realsense2_camera_node-1] [WARN] [1688191147.355997006] [camera.camera]: No stream match for pointcloud chosen texture Process - Color
[realsense2_camera_node-1] [WARN] [1688191149.979564552] [camera.camera]: No stream match for pointcloud chosen texture Process - Color

I run this command with ROS2 galactic in docker container. Outside the container I use ROS1 melodic and the realsense related packages works without any error in the setting. So may be is it related to the certain environment inside docker which is set outside the container but not inside? At least I mounted the volumes of certain directories required in the process for building librealsense (patch kernel, build librealsense) which are

-v /dev:/dev \
-v /usr/src:/usr/src \
-v /etc/nv_tegra_release:/etc/nv_tegra_release \
-v /etc/udev/rules.d:/etc/udev/rules.d \
-v /lib/modules/4.9.140-tegra:/lib/modules/4.9.140-tegra \
MartyG-RealSense commented 1 year ago

A RealSense ROS user created a RealSense Docker for the RealSense ROS2 wrapper ros2-development at the link below that is only 4 months old at the time of writing this, so it may be a helpful reference.

https://github.com/2b-t/realsense-ros2-docker

kenloumixx commented 1 year ago

@MartyG-RealSense Thank you for response :) I'll take a good look the link you shared and communicate with the author! Thank you :)

MartyG-RealSense commented 1 year ago

You are very welcome. Thanks very much for the update!