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

Can't execute "ros2 run realsense2_camera realsense2_camera_node" #3158

Closed
drinkBr opened this issue Jul 10, 2024 · 67 comments
Closed

Can't execute "ros2 run realsense2_camera realsense2_camera_node" #3158

drinkBr opened this issue Jul 10, 2024 · 67 comments
Labels

Comments

@drinkBr
Copy link

drinkBr commented Jul 10, 2024

Required Info
Camera Model D435
Firmware Version 5.13.0.55
Operating System & Version Ubuntu22.04
Platform Raspberry Pi4 model B
Librealsense SDK Version 2.55.1 (realsense-viewer Version)
Segment Robot
ROS Distro Humble

Issue Description

I encountered the following error when executing ros2 run realsense2_camera realsense2_camera_node.

[INFO] [1720575182.089151480] [camera.camera]: Device FW version: 5.13.0.55
[INFO] [1720575182.089356979] [camera.camera]: Device Product ID: 0x0B07
[INFO] [1720575182.089552885] [camera.camera]: Sync Mode: Off
[WARN] [1720575182.304168366] [camera.camera]: Could not set param: rgb_camera.power_line_frequency with 3 Range: [0, 2]: parameter 'rgb_camera.power_line_frequency' could not be set: Parameter {rgb_camera.power_line_frequency} doesn't comply with integer range.
[INFO] [1720575182.380895995] [camera.camera]: Stopping Sensor: Depth Module
[INFO] [1720575182.382941983] [camera.camera]: Stopping Sensor: RGB Camera
[INFO] [1720575182.460460718] [camera.camera]: Starting Sensor: Depth Module
[INFO] [1720575182.503783789] [camera.camera]: Open profile: stream_type: Infra(1), Format: Y8, Width: 848, Height: 480, FPS: 30
[INFO] [1720575182.504291397] [camera.camera]: Open profile: stream_type: Infra(2), Format: Y8, Width: 848, Height: 480, FPS: 30
[INFO] [1720575182.504599488] [camera.camera]: Open profile: stream_type: Depth(0), Format: Z16, Width: 848, Height: 480, FPS: 30
[WARN] [1720575182.611571490] [camera.camera]: frame's time domain is HARDWARE_CLOCK. Timestamps may reset periodically.
 10/07 10:33:07,728 ERROR [281473139402976] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
 10/07 10:33:07,729 ERROR [281473139402976] (global_timestamp_reader.cpp:239) Error during time_diff_keeper polling: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
 10/07 10:33:12,848 ERROR [281473114040544] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
 10/07 10:33:12,848 ERROR [281473114040544] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
 10/07 10:33:17,972 ERROR [281473147857120] (librealsense-exception.h:52) set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
 10/07 10:33:17,973 ERROR [281473147857120] (rs.cpp:237) [rs2_get_video_stream_intrinsics( from:0xffff8805c040, intr:[ -1471343544x65535  p[-1.60068e-27 9.18341e-41]  f[-1.60092e-27 9.18341e-41]  UNKNOWN [9.18341e-41 -1.60094e-27 9.18341e-41 -4.06313e-34 9.18341e-41] ] ) Backend] set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[WARN] [1720575197.973901736] [camera.camera]: No intrinsics available for this stream profile. Using zeroed intrinsics as default.
[ERROR] [1720575208.213363266] [camera.camera]: /home/agri/ros2_ws/src/realsense-ros/realsense2_camera/src/rs_node_setup.cpp:487:An exception has been thrown: std::exception
[ERROR] [1720575208.213606135] [camera.camera]: /home/agri/ros2_ws/src/realsense-ros/realsense2_camera/src/rs_node_setup.cpp:369:An exception has been thrown: std::exception
[ERROR] [1720575208.213811041] [camera.camera]: Error starting device: std::exception

I believe that it is necessary to set the value of rgb_camera.power_line_frequency, but I would like to hear your opinion.
Also, after this error was displayed, I executed realsense-viewer, and when I turned on the Stereo Module, the following error appeared. I confirmed that the same error message appeared when executing ros2 run realsense2_camera realsense2_camera_node, so I believe they are related. I would like to hear your opinion.

Backend in rs2_open_multiple(sensor:0xffffa0016110, profiles:0xffffa0162bc0,
count:1):
set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
@MartyG-RealSense
Copy link
Collaborator

Hi @drinkBr That rgb_camera.power_line_frequency message can usually be ignored. The power_line_frequency parameter is usually configured in situations where you have fluorescent lights on the ceiling that are interfering with the image (because they flicker at frequencies that are hard to see with the human eye) and you need to change its value to reduce the interference.

Do you experience the same problems if you launch with ros2 launch instead of ros2 run, please?

ros2 launch realsense2_camera rs_launch.py

@drinkBr
Copy link
Author

drinkBr commented Jul 11, 2024

I executed ros2 launch realsense2_camera rs_launch.py, but the error message seems to be almost the same.

[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [realsense2_camera_node-1]: process started with pid [3190]
[realsense2_camera_node-1] [INFO] [1720658832.661672185] [camera.camera]: RealSense ROS v4.55.1
[realsense2_camera_node-1] [INFO] [1720658832.662606472] [camera.camera]: Built with LibRealSense v2.55.1
[realsense2_camera_node-1] [INFO] [1720658832.662826526] [camera.camera]: Running with LibRealSense v2.55.1
[realsense2_camera_node-1] [INFO] [1720658833.851126486] [camera.camera]: Device with serial number 233722073556 was found.
[realsense2_camera_node-1] 
[realsense2_camera_node-1] [INFO] [1720658833.851366671] [camera.camera]: Device with physical ID /sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1:1.0/video4linux/video0 was found.
[realsense2_camera_node-1] [INFO] [1720658833.851426412] [camera.camera]: Device with name Intel RealSense D435 was found.
[realsense2_camera_node-1] [INFO] [1720658833.852328411] [camera.camera]: Device with port number 2-1 was found.
[realsense2_camera_node-1] [INFO] [1720658833.852465231] [camera.camera]: Device USB type: 3.2
[realsense2_camera_node-1] [INFO] [1720658833.857055291] [camera.camera]: getParameters...
[realsense2_camera_node-1] [INFO] [1720658833.858706799] [camera.camera]: JSON file is not provided
[realsense2_camera_node-1] [INFO] [1720658833.858821204] [camera.camera]: Device Name: Intel RealSense D435
[realsense2_camera_node-1] [INFO] [1720658833.858873887] [camera.camera]: Device Serial No: 233722073556
[realsense2_camera_node-1] [INFO] [1720658833.858917938] [camera.camera]: Device physical port: /sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1:1.0/video4linux/video0
[realsense2_camera_node-1] [INFO] [1720658833.858960636] [camera.camera]: Device FW version: 5.13.0.55
[realsense2_camera_node-1] [INFO] [1720658833.859039605] [camera.camera]: Device Product ID: 0x0B07
[realsense2_camera_node-1] [INFO] [1720658833.859079932] [camera.camera]: Sync Mode: Off
[realsense2_camera_node-1] [INFO] [1720658834.039412815] [camera.camera]: Set ROS param depth_module.depth_profile to default: 848x480x30
[realsense2_camera_node-1] [INFO] [1720658834.043560495] [camera.camera]: Set ROS param depth_module.infra_profile to default: 848x480x30
[realsense2_camera_node-1] [WARN] [1720658834.072802032] [camera.camera]: Could not set param: rgb_camera.power_line_frequency with 3 Range: [0, 2]: parameter 'rgb_camera.power_line_frequency' could not be set: Parameter {rgb_camera.power_line_frequency} doesn't comply with integer range.
[realsense2_camera_node-1] [INFO] [1720658834.123101613] [camera.camera]: Set ROS param rgb_camera.color_profile to default: 640x480x30
[realsense2_camera_node-1] [INFO] [1720658834.150955287] [camera.camera]: Stopping Sensor: Depth Module
[realsense2_camera_node-1] [INFO] [1720658834.153095442] [camera.camera]: Stopping Sensor: RGB Camera
[realsense2_camera_node-1] [INFO] [1720658834.229499599] [camera.camera]: Starting Sensor: Depth Module
[realsense2_camera_node-1] [INFO] [1720658834.244307153] [camera.camera]: Open profile: stream_type: Depth(0), Format: Z16, Width: 848, Height: 480, FPS: 30
[realsense2_camera_node-1] [WARN] [1720658834.370593160] [camera.camera]: frame's time domain is HARDWARE_CLOCK. Timestamps may reset periodically.
[realsense2_camera_node-1]  11/07 09:47:19,455 ERROR [281472583854304] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[realsense2_camera_node-1]  11/07 09:47:19,470 ERROR [281472583854304] (global_timestamp_reader.cpp:239) Error during time_diff_keeper polling: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[realsense2_camera_node-1]  11/07 09:47:24,575 ERROR [281472351004896] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
[realsense2_camera_node-1]  11/07 09:47:24,576 ERROR [281472351004896] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
[realsense2_camera_node-1]  11/07 09:47:29,695 ERROR [281472592308448] (librealsense-exception.h:52) set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[realsense2_camera_node-1]  11/07 09:47:29,697 ERROR [281472592308448] (rs.cpp:237) [rs2_get_video_stream_intrinsics( from:0xffff6805a290, intr:[ -2094066616x65535  p[2.22471e+30 9.18341e-41]  f[2.22508e+30 9.18341e-41]  UNKNOWN [9.18341e-41 2.22512e+30 9.18341e-41 2.50071e+24 9.18341e-41] ] ) Backend] set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[realsense2_camera_node-1] [WARN] [1720658849.697870255] [camera.camera]: No intrinsics available for this stream profile. Using zeroed intrinsics as default.
[realsense2_camera_node-1]  11/07 09:47:34,816 ERROR [281472351004896] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
[realsense2_camera_node-1]  11/07 09:47:34,816 ERROR [281472351004896] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
[realsense2_camera_node-1]  11/07 09:47:39,936 ERROR [281472592308448] (librealsense-exception.h:52) set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[realsense2_camera_node-1]  11/07 09:47:39,937 ERROR [281472592308448] (rs.cpp:237) [rs2_get_extrinsics( from:0xffff68030e60, to:0xffff6805a290, extrin:[ r[1,0,0,0,1,0,0,0,1]  t[0,0,0] ] ) Backend] set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[realsense2_camera_node-1] [ERROR] [1720658859.938178317] [camera.camera]: /~/ros2_ws/src/realsense-ros/realsense2_camera/src/rs_node_setup.cpp:487:An exception has been thrown: std::exception
[realsense2_camera_node-1] [ERROR] [1720658859.938947998] [camera.camera]: /~/ros2_ws/src/realsense-ros/realsense2_camera/src/rs_node_setup.cpp:369:An exception has been thrown: std::exception
[realsense2_camera_node-1] [INFO] [1720658859.941639681] [camera.camera]: Stopping Sensor: RGB Camera
[realsense2_camera_node-1] [ERROR] [1720658859.946478616] [camera.camera]: Error starting device: std::exception

@MartyG-RealSense
Copy link
Collaborator

xioctl(UVCIOC_CTRL_QUERY) errors are typically related to a conflict between librealsense and the Linux kernel. Such conflicts may be avoided if librealsense is built from source code with CMake with the flag -DFORCE_RSUSB_BACKEND=TRUE included in the CMake build instruction.

Which method did you use to install librealsense on your Pi, please?

@drinkBr
Copy link
Author

drinkBr commented Jul 12, 2024

Such conflicts may be avoided if librealsense is built from source code with CMake with the flag -DFORCE_RSUSB_BACKEND=TRUE included in the CMake build instruction.

I understand how to avoid the error, but I don't know exactly what actions to take. Since I am a beginner with Ubuntu, I would appreciate a simplified explanation.

Which method did you use to install librealsense on your Pi, please?

The specific steps are as follows. I have also included the URL I referenced.
-install dependencies-

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
sudo apt-get install libssl-dev libusb-1.0-0-dev libudev-dev pkg-config libgtk-3-dev
sudo apt-get install git wget cmake build-essential
sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev at

-install librealsense2-

git clone https://github.com/IntelRealSense/librealsense.git
cd librealsense
mkdir build && cd build
cmake ../ -DBUILD_EXAMPLES=true
sudo make uninstall && make clean && make && sudo make && sudo make install
cd ..
./scripts/setup_ubev_rules.sh

-LibUVC-backend installation-

wget https://github.com/IntelRealSense/librealsense/raw/master/scripts/libuvc_installation.sh
chmod +x ./libuvc_installation.sh
./libuvc_installation.sh

Reference
https://github.com/IntelRealSense/librealsense/blob/master/doc/installation.md#building-librealsense2-sdk
https://github.com/IntelRealSense/librealsense/blob/master/doc/libuvc_installation.md
https://www.youtube.com/watch?v=zbTtNsWz6Ec

Thanks.

@MartyG-RealSense
Copy link
Collaborator

To build librealsense from source code in RSUSB = true mode, you need additional flags included in your CMake build command. At the moment you are using this:

cmake ../ -DBUILD_EXAMPLES=true

This command will not build librealsense in RSUSB mode though. To do so, please try the build command below.

cmake ../ -DFORCE_RSUSB_BACKEND=true -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=true

This command comes from my RSUSB installation guide at IntelRealSense/librealsense#9931 (comment)

I note that after performing the CMake build, you then used the libuvc backend script. But the CMake build process will have already installed librealsense, so doing a libuvc backend build afterwards means that you could have two separate installations of librealsense on the same computer that could potentially conflict with each other.

@drinkBr
Copy link
Author

drinkBr commented Jul 13, 2024

To build librealsense from source code in RSUSB = true mode, you need additional flags included in your CMake build command. At the moment you are using this:

cmake ../ -DBUILD_EXAMPLES=true

This command will not build librealsense in RSUSB mode though. To do so, please try the build command below.

cmake ../ -DFORCE_RSUSB_BACKEND=true -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=true

This command comes from my RSUSB installation guide at IntelRealSense/librealsense#9931 (comment)

I note that after performing the CMake build, you then used the libuvc backend script. But the CMake build process will have already installed librealsense, so doing a libuvc backend build afterwards means that you could have two separate installations of librealsense on the same computer that could potentially conflict with each other.

I am currently working on this, so I will report back once it's finished.

I have a separate question. I want to obtain RGB and depth images from Realsense based on key inputs. However, I read on another page that images are obtained from the topic, which made me wonder. Since it is not possible to perform key input and image subscription at the same time, I think this might be difficult. Is there any solution to this? I would like to hear your opinion.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Jul 13, 2024

Some RealSense Python users write a script that subscribes to ROS topics and has the script use those as the camera data. The link below has an example of doing so.

https://stackoverflow.com/questions/62938146/getting-realsense-depth-frame-in-ros

The RealSense ROS wrapper also provides some example ROS2 'node scripts' in Python language.

https://github.com/IntelRealSense/realsense-ros/tree/ros2-master/realsense2_camera/scripts

@drinkBr
Copy link
Author

drinkBr commented Jul 14, 2024

To build librealsense from source code in RSUSB = true mode, you need additional flags included in your CMake build command. At the moment you are using this:

cmake ../ -DBUILD_EXAMPLES=true

This command will not build librealsense in RSUSB mode though. To do so, please try the build command below.

cmake ../ -DFORCE_RSUSB_BACKEND=true -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=true

This command comes from my RSUSB installation guide at IntelRealSense/librealsense#9931 (comment)

I note that after performing the CMake build, you then used the libuvc backend script. But the CMake build process will have already installed librealsense, so doing a libuvc backend build afterwards means that you could have two separate installations of librealsense on the same computer that could potentially conflict with each other.

I tested two methods for this.
First,

cd librealsense/build
cmake ../ -DFORCE_RSUSB_BACKEND=true -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=true

After executing this, I immediately ran realsense-viewer and was able to confirm both RGB and Depth images. Then, when I ran ros2 run realsense2_camera realsense2_camera_node, it seemed to be successful. However, after a while, the same error as before occurred.

[INFO] [1720575182.089151480] [camera.camera]: Device FW version: 5.13.0.55
[INFO] [1720575182.089356979] [camera.camera]: Device Product ID: 0x0B07
[INFO] [1720575182.089552885] [camera.camera]: Sync Mode: Off
[WARN] [1720575182.304168366] [camera.camera]: Could not set param: rgb_camera.power_line_frequency with 3 Range: [0, 2]: parameter 'rgb_camera.power_line_frequency' could not be set: Parameter {rgb_camera.power_line_frequency} doesn't comply with integer range.
[INFO] [1720575182.380895995] [camera.camera]: Stopping Sensor: Depth Module
[INFO] [1720575182.382941983] [camera.camera]: Stopping Sensor: RGB Camera
[INFO] [1720575182.460460718] [camera.camera]: Starting Sensor: Depth Module
[INFO] [1720575182.503783789] [camera.camera]: Open profile: stream_type: Infra(1), Format: Y8, Width: 848, Height: 480, FPS: 30
[INFO] [1720575182.504291397] [camera.camera]: Open profile: stream_type: Infra(2), Format: Y8, Width: 848, Height: 480, FPS: 30
[INFO] [1720575182.504599488] [camera.camera]: Open profile: stream_type: Depth(0), Format: Z16, Width: 848, Height: 480, FPS: 30
[WARN] [1720575182.611571490] [camera.camera]: frame's time domain is HARDWARE_CLOCK. Timestamps may reset periodically.
 10/07 10:33:07,728 ERROR [281473139402976] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
 10/07 10:33:07,729 ERROR [281473139402976] (global_timestamp_reader.cpp:239) Error during time_diff_keeper polling: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
 10/07 10:33:12,848 ERROR [281473114040544] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
 10/07 10:33:12,848 ERROR [281473114040544] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
 10/07 10:33:17,972 ERROR [281473147857120] (librealsense-exception.h:52) set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
 10/07 10:33:17,973 ERROR [281473147857120] (rs.cpp:237) [rs2_get_video_stream_intrinsics( from:0xffff8805c040, intr:[ -1471343544x65535  p[-1.60068e-27 9.18341e-41]  f[-1.60092e-27 9.18341e-41]  UNKNOWN [9.18341e-41 -1.60094e-27 9.18341e-41 -4.06313e-34 9.18341e-41] ] ) Backend] set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[WARN] [1720575197.973901736] [camera.camera]: No intrinsics available for this stream profile. Using zeroed intrinsics as default.

When I checked realsense-viewer, I could no longer get the Depth image, and the following error occurred.

Backend in rs2_open_multiple(sensor:0xffffa0016110, profiles:0xffffa0162bc0,
count:1):
set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out

Second,

cd librealsense/build
cmake ../ -DFORCE_RSUSB_BACKEND=true -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=true
sudo make uninstall && make clean && make && sudo make install

As before, when I ran realsense-viewer, I was able to confirm both RGB and Depth images. However, when I tried executing ros2 run realsense2_camera realsense2_camera_node, the same error appeared without success. After that, I checked realsense-viewer again, and I could no longer get the Depth image, and the same error as before was displayed.

Are the commands I entered correct? I would like to hear your opinion.
Thanks.

@MartyG-RealSense
Copy link
Collaborator

The commands that you entered are correct.

If your librealsense version is 2.55.1 though then the firmware version installed in your camera should be the current latest 5.16.0.1 version instead of the 5.13.0.55 currently installed.

@MartyG-RealSense
Copy link
Collaborator

Hi @drinkBr Do you require further assistance with this case, please? Thanks!

@drinkBr
Copy link
Author

drinkBr commented Jul 22, 2024

Sorry for the late reply.

If your librealsense version is 2.55.1 though then the firmware version installed in your camera should be the current latest 5.16.0.1 version instead of the 5.13.0.55 currently installed.

I don't have a Raspberry Pi at hand right now, so I can't verify this. I will send another message later this week.
Thanks.

@MartyG-RealSense
Copy link
Collaborator

You're very welcome. I look forward to your next update. Good luck!

@drinkBr
Copy link
Author

drinkBr commented Jul 23, 2024

If your librealsense version is 2.55.1 though then the firmware version installed in your camera should be the current latest 5.16.0.1 version instead of the 5.13.0.55 currently installed.

I have verified this, and when I checked with realsense-viewer, the same error appeared as before. When updating the firmware, I used rs-fw-update. I confirmed that the firmware update was performed using rs-fw-update -l.

Backend in rs2_open_multiple(sensor:0xffffa0016110, profiles:0xffffa0162bc0,
count:1):
set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out

Thanks.

@MartyG-RealSense
Copy link
Collaborator

Do you have access to any other computers other than your Pi that you could attempt a firmware update on?

@drinkBr
Copy link
Author

drinkBr commented Jul 24, 2024

Yes, I have a Windows PC.

@MartyG-RealSense
Copy link
Collaborator

The firmware driver is stored inside the camera hardware and not on the computer. So if you are able to install the RealSense Viewer tool on your Windows computer and update the firmware in it then the updated firmware will be carried back to the Pi inside the camera.

You can download and run the Viewer on its own on Windows using the Intel.RealSense.Viewer.exe file in the Assets file list at the link below.

https://github.com/IntelRealSense/librealsense/releases/tag/v2.55.1

image

@drinkBr
Copy link
Author

drinkBr commented Jul 25, 2024

I installed RealSense Viewer on my Windows computer and verified it. As a result, I was able to confirm both RGB and Depth images. It seems that the firmware is installed correctly. There was a warning message that concerns me, so I would like to hear your opinion on this.
image

@MartyG-RealSense
Copy link
Collaborator

There is no harm at all in clicking the Enable button to enable frame metadata and I would recommend that you do so.

What this message means is that when frame metadata is disabled, some types of camera metadata information will not be available, and the metadata that is provided will be 'software metadata' that has timing based on the computer's clock instead of the camera's firmware (which provides 'hardware metadata').

RGB and depth streaming can still work normally without frame metadata support being enabled. But when it is so easy to enable on Windows in the RealSense Viewer, there is no reason not to enable it.

@drinkBr
Copy link
Author

drinkBr commented Jul 25, 2024

While using realsense-viewer on the Raspberry Pi, after an error occurred with the Stereo Module, I turned on the RGB Camera and the following error was observed.

Backend in rs2_open_multiple(sensor:0xffff98012130, profiles:0xffff9829be40,
count:1):
xioctl(VIDIOC_S_FMT) failed, errno=5 Last Error: Input/output error

When using realsense-viewer on the Raspberry Pi, the performance is very slow. Could this be one of the causes of the error?

When I started realsense-viewer and first activated the Stereo Module, I was able to see the depth information. However, I couldn't see the RGB information. In addition to the slow performance, the fact that there is only 6GB of free storage might also be affecting it.

@MartyG-RealSense
Copy link
Collaborator

RealSense cameras commonly have performance issues on Raspberry Pi boards.

The same errno=5 Last Error: Input/output error occurred in a Pi case at #2991

xioctl(VIDIOC_S_FMT) errors are typically related to a conflict between librealsense and the kernel. The libuvc backend SDK installation method that you used earlier works best with Pi, as it enables librealsense to bypass the kernel.

@drinkBr
Copy link
Author

drinkBr commented Jul 25, 2024

xioctl(VIDIOC_S_FMT) errors are typically related to a conflict between librealsense and the kernel. The libuvc backend SDK installation method that you used earlier works best with Pi, as it enables librealsense to bypass the kernel.

I am using the libuvc backend SDK installation method, but I am encountering an xioctl(VIDIOC_S_FMT) error. What should I do? Should I check for a conflict between librealsense and the kernel?

@drinkBr
Copy link
Author

drinkBr commented Jul 25, 2024

I have one more question. Currently, I am using a 32GB microSD on the Raspberry Pi, but should I consider using a larger capacity microSD for Ubuntu?

@MartyG-RealSense
Copy link
Collaborator

There is not a way to tell if there is a possible kernel conflict with librealsense other than when xioctl(VIDIOC_S_FMT) errors occur.

I would think that the access speed of the microSD card will be more important to performance than the capacity if the Ubuntu OS is being run off the card. An SSD drive would give faster drive access.

https://thepihut.com/collections/raspberry-pi-ssd-storage

Another limiting factor on performance would be the real memory capacity of your Pi. Once its real memory is used up, it will start using the virtual memory of a swapfile, which converts free storage space on the drive into virtual memory that is slower than the real memory on the Pi board.

https://pimylifeup.com/raspberry-pi-swap-file/

@drinkBr
Copy link
Author

drinkBr commented Jul 30, 2024

Sorry for the late reply. I am currently trying to set up a ROS2 environment on a USB-connected SSD that I have. I will send another message later this week.

@MartyG-RealSense
Copy link
Collaborator

It's no problem at all. I look forward to your next report. Thanks very much for the update!

@drinkBr
Copy link
Author

drinkBr commented Aug 5, 2024

Hello, it's been a while. Sorry for the delay in getting back to you. I have installed Ubuntu 22.04 on an SSD and set up the ROS2 environment. Before I proceed with the installation for RealSense, I would like to confirm the installation steps. Are the following steps correct?

-install dependencies-

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
sudo apt-get install libssl-dev libusb-1.0-0-dev libudev-dev pkg-config libgtk-3-dev
sudo apt-get install git wget cmake build-essential
sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev at

-install librealsense2-

git clone https://github.com/IntelRealSense/librealsense.git
cd librealsense
mkdir build && cd build
cmake ../ -DFORCE_RSUSB_BACKEND=true -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=true
sudo make uninstall && make clean && make && sudo make && sudo make install
cd ..
./scripts/setup_ubev_rules.sh

-LibUVC-backend installation-

wget https://github.com/IntelRealSense/librealsense/raw/master/scripts/libuvc_installation.sh
chmod +x ./libuvc_installation.sh
./libuvc_installation.sh

Thanks.

@MartyG-RealSense
Copy link
Collaborator

The above instructions are correct for the most part. However, if you install dependencies and then install librealsense2 with git clone then you do not have to use the libuvc backend installation instructions.

The libuvc backend is a different, much simpler method of installing librealsense with a build script. You do not need to follow the prerequisites instructions with that method, as the libuvc method takes care of installing the prerequisites by using the internet connection instead.

However, you will need to edit line 46 of the libuvc_installation.sh script to add flags to the CMake build instruction.

https://github.com/IntelRealSense/librealsense/blob/master/scripts/libuvc_installation.sh#L46

Change this:

cmake ../ -DFORCE_LIBUVC=true -DCMAKE_BUILD_TYPE=release

To this:

cmake ../ -DFORCE_LIBUVC=true -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=true

@drinkBr
Copy link
Author

drinkBr commented Aug 6, 2024

xioctl(VIDIOC_S_FMT) errors are typically related to a conflict between librealsense and the kernel. The libuvc backend SDK installation method that you used earlier works best with Pi, as it enables librealsense to bypass the kernel.

Since you previously mentioned that using the libuvc backend SDK installation method would be good, I would like to proceed with that. Could you provide the necessary commands for using the libuvc backend SDK installation method in the same format as my previous comment?

When using that method, is there any difference compared to installing dependencies and then using git clone to install librealsense2?

If I install dependencies first and then use git clone to install librealsense2, is it correct to assume that the steps I outlined in my previous comment for "-install dependencies-" and "-install librealsense2-" are sufficient?

I apologize for the many questions, and I appreciate your assistance.

@MartyG-RealSense
Copy link
Collaborator

When using the libuvc method, make sure that you have an active internet connection and then unplug the camera, open a terminal and input the short list of instructions below.

wget https://github.com/IntelRealSense/librealsense/raw/master/scripts/libuvc_installation.sh
$ chmod +x ./libuvc_installation.sh
$ ./libuvc_installation.sh

When the message Librealsense script completed is displayed, plug the RealSense camera in and run rs-enumerate-devices to test the librealsense installation.


When using the libuvc backend method instead of installing dependencies and using git clone, the key differences with libuvc are:

  • You do not need to install the dependencies yourself as the libuvc process takes care of that.
  • You do not need to apply a kernel patch script to the kernel as a libuvc build of librealsense bypasses the kernel.

Your instructions for installing dependencies and then git cloning are fine, though when the flag -DFORCE_RSUSB_BACKEND=TRUE is included in the CMake build instruction then the ./scripts/setup_ubev_rules.sh command is not used.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Aug 11, 2024

Hi @MiTomMi Does performance in the RealSense ROS wrapper on your Pi 4 improve if you launch with 640x480 and 15 FPS for both streams?

ros2 launch realsense2_camera rs_launch.py depth_module.depth_profile:=640x480x15 rgb_camera.color_profile:=640x480x15

@MiTomMi
Copy link

MiTomMi commented Aug 11, 2024

Hi @MartyG-RealSense, thank you for your reply. I have tried the command: ros2 launch realsense2_camera rs_launch.py depth_module.depth_profile:=640x480x15 rgb_camera.color_profile:=640x480x15 on my PC and Raspberry Pi 4. The camera ran perfectly on the PC as in the picture shown below.

Screenshot from 2024-08-11 14-56-41

However, the same error occurred on the Pi 4:

[realsense2_camera_node-1] [ERROR] [1723363115.466008305] [camera.camera]: ./src/rs_node_setup.cpp:487:An exception has been thrown: std::exception
[realsense2_camera_node-1] [ERROR] [1723363115.466257829] [camera.camera]: ./src/rs_node_setup.cpp:369:An exception has been thrown: std::exception
[realsense2_camera_node-1] [ERROR] [1723363115.466445375] [camera.camera]: Error starting device: std::exception

The error has been driving me crazy for several days. At first I thought the problem came from the Raspberry Pi 3B which does not have USB 3.0 ports, but when I upgraded to Pi 4 the problem still happens.

I am looking forward to your advice. I appreciate your help a lot!
Thank you!

@MiTomMi
Copy link

MiTomMi commented Aug 11, 2024

UPDATE:
Hi @MartyG-RealSense, somehow I unplugged the camera then plugged it in again and it worked pretty fine on Pi 4.

pi@raspberrypi4:~$ ros2 launch realsense2_camera rs_launch.py depth_module.depth_profile:=640x480x15 rgb_camera.color_profile:=640x480x15
[INFO] [launch]: All log files can be found below /home/pi/.ros/log/2024-08-11-15-13-46-710047-raspberrypi3-4061
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [realsense2_camera_node-1]: process started with pid [4063]
[realsense2_camera_node-1] [INFO] [1723364027.702030173] [camera.camera]: RealSense ROS v4.55.1
[realsense2_camera_node-1] [INFO] [1723364027.702317850] [camera.camera]: Built with LibRealSense v2.55.1
[realsense2_camera_node-1] [INFO] [1723364027.702386959] [camera.camera]: Running with LibRealSense v2.55.1
[realsense2_camera_node-1] [INFO] [1723364028.504624460] [camera.camera]: Device with serial number 819312072177 was found.
[realsense2_camera_node-1]
[realsense2_camera_node-1] [INFO] [1723364028.504824103] [camera.camera]: Device with physical ID /sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1:1.0/video4linux/video0 was found.
[realsense2_camera_node-1] [INFO] [1723364028.504881694] [camera.camera]: Device with name Intel RealSense D435 was found.
[realsense2_camera_node-1] [INFO] [1723364028.505618451] [camera.camera]: Device with port number 2-1 was found.
[realsense2_camera_node-1] [INFO] [1723364028.505752799] [camera.camera]: Device USB type: 3.2
[realsense2_camera_node-1] [INFO] [1723364028.505995941] [camera.camera]: getParameters...
[realsense2_camera_node-1] [INFO] [1723364028.507143946] [camera.camera]: JSON file is not provided
[realsense2_camera_node-1] [INFO] [1723364028.507284868] [camera.camera]: Device Name: Intel RealSense D435
[realsense2_camera_node-1] [INFO] [1723364028.507344163] [camera.camera]: Device Serial No: 819312072177
[realsense2_camera_node-1] [INFO] [1723364028.507392309] [camera.camera]: Device physical port: /sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1:1.0/video4linux/video0
[realsense2_camera_node-1] [INFO] [1723364028.507442215] [camera.camera]: Device FW version: 5.16.0.1
[realsense2_camera_node-1] [INFO] [1723364028.507485547] [camera.camera]: Device Product ID: 0x0B07
[realsense2_camera_node-1] [INFO] [1723364028.507526954] [camera.camera]: Sync Mode: Off
[realsense2_camera_node-1] [WARN] [1723364028.632808948] [camera.camera]: re-enable the stream for the change to take effect.
[realsense2_camera_node-1] [INFO] [1723364028.634437884] [camera.camera]: Set ROS param depth_module.infra_profile to default: 848x480x30
[realsense2_camera_node-1] [WARN] [1723364028.645457318] [camera.camera]: Could not set param: rgb_camera.power_line_frequency with 3 Range: [0, 2]: parameter 'rgb_camera.power_line_frequency' could not be set: Parameter {rgb_camera.power_line_frequency} doesn't comply with integer range.
[realsense2_camera_node-1] [WARN] [1723364028.663526649] [camera.camera]: re-enable the stream for the change to take effect.
[realsense2_camera_node-1] [INFO] [1723364028.671633053] [camera.camera]: Stopping Sensor: Depth Module
[realsense2_camera_node-1] [INFO] [1723364028.672280516] [camera.camera]: Stopping Sensor: RGB Camera
[realsense2_camera_node-1] [INFO] [1723364028.686621284] [camera.camera]: Starting Sensor: Depth Module
[realsense2_camera_node-1] [INFO] [1723364028.693726549] [camera.camera]: Open profile: stream_type: Depth(0), Format: Z16, Width: 640, Height: 480, FPS: 15
[realsense2_camera_node-1] [INFO] [1723364028.718951273] [camera.camera]: Starting Sensor: RGB Camera
[realsense2_camera_node-1] [INFO] [1723364028.727177525] [camera.camera]: Open profile: stream_type: Color(0), Format: RGB8, Width: 640, Height: 480, FPS: 15
[realsense2_camera_node-1] [INFO] [1723364028.734255124] [camera.camera]: RealSense Node Is Up!

Screenshot from 2024-08-11 15-16-47

However, the same error showed up when I started over the command again.

[realsense2_camera_node-1] [ERROR] [1723363115.466008305] [camera.camera]: ./src/rs_node_setup.cpp:487:An exception has been thrown: std::exception
[realsense2_camera_node-1] [ERROR] [1723363115.466257829] [camera.camera]: ./src/rs_node_setup.cpp:369:An exception has been thrown: std::exception
[realsense2_camera_node-1] [ERROR] [1723363115.466445375] [camera.camera]: Error starting device: std::exception

Maybe there are some Intel Realsense's firmware conflicts. Here is the firmware of the camera.

pi@raspberrypi3:~/robot_intel$ rs-fw-update -l

Connected devices:

  1. [USB] Intel RealSense D435 s/n 819312072177, update serial number: 818413021385, firmware version: 5.16.0.1

Thank you!

@drinkBr
Copy link
Author

drinkBr commented Aug 11, 2024

Hi, @MartyG-RealSense

When using RealSense cameras with Raspberry Pi boards, streaming depth and color, with no other processing burdens such as pointcloud generation or post-processing filters, is the most that can be achieved before problems with streaming occur.

Is there a specific method to achieve this?

Thanks!

@MartyG-RealSense
Copy link
Collaborator

Hi @drinkBr Do you mean how to avoid having pointclouds, alignment and post-processing active so that processing burden can be reduced? If so then all of these are disabled by default so you do not have to do anything to turn them off.

@MartyG-RealSense
Copy link
Collaborator

@MiTomMi If you are using firmware 5.16.0.1 then librealsense 2.55.1 and ROS2 wrapper 4.55.1 should be used with it. Are those the versions that you are using, please?

@MiTomMi
Copy link

MiTomMi commented Aug 11, 2024

Hi @MartyG-RealSense, I am using ROS2 Wrapper 4.55.1.

pi@raspberrypi4:~$ ros2 pkg xml realsense2_camera | grep ''
4.55.1

@MartyG-RealSense
Copy link
Collaborator

@MiTomMi Does the problem after camera restart still occur if you add initial_reset:=true to your launch instruction to reset the camera at launch?

@drinkBr
Copy link
Author

drinkBr commented Aug 11, 2024

Hi, @MartyG-RealSense
OK. Is there anything else I can test or verify?

@MiTomMi
Copy link

MiTomMi commented Aug 11, 2024

@MartyG-RealSense, the problem still occured. Here is the full log:

pi@raspberrypi4:~$ ros2 launch realsense2_camera rs_launch.py depth_module.depth_profile:=640x480x15 rgb_camera.color_profile:=640x480x15 initial_reset:=true
[INFO] [launch]: All log files can be found below /home/pi/.ros/log/2024-08-11-16-23-46-025104-raspberrypi3-6688
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [realsense2_camera_node-1]: process started with pid [6689]
[realsense2_camera_node-1] [INFO] [1723368226.678293178] [camera.camera]: RealSense ROS v4.55.1
[realsense2_camera_node-1] [INFO] [1723368226.678570027] [camera.camera]: Built with LibRealSense v2.55.1
[realsense2_camera_node-1] [INFO] [1723368226.678631508] [camera.camera]: Running with LibRealSense v2.55.1
[realsense2_camera_node-1] [INFO] [1723368227.483921207] [camera.camera]: Device with serial number 819312072177 was found.
[realsense2_camera_node-1]
[realsense2_camera_node-1] [INFO] [1723368227.484110502] [camera.camera]: Device with physical ID /sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1:1.0/video4linux/video0 was found.
[realsense2_camera_node-1] [INFO] [1723368227.484166149] [camera.camera]: Device with name Intel RealSense D435 was found.
[realsense2_camera_node-1] [INFO] [1723368227.484962382] [camera.camera]: Device with port number 2-1 was found.
[realsense2_camera_node-1] [INFO] [1723368227.485091363] [camera.camera]: Device USB type: 3.2
[realsense2_camera_node-1] [INFO] [1723368227.485142307] [camera.camera]: Resetting device...
[realsense2_camera_node-1] [INFO] [1723368234.296970757] [camera.camera]: Device with serial number 819312072177 was found.
[realsense2_camera_node-1]
[realsense2_camera_node-1] [INFO] [1723368234.297138367] [camera.camera]: Device with physical ID /sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1:1.0/video4linux/video0 was found.
[realsense2_camera_node-1] [INFO] [1723368234.297191829] [camera.camera]: Device with name Intel RealSense D435 was found.
[realsense2_camera_node-1] [INFO] [1723368234.297840841] [camera.camera]: Device with port number 2-1 was found.
[realsense2_camera_node-1] [INFO] [1723368234.297940637] [camera.camera]: Device USB type: 3.2
[realsense2_camera_node-1] [INFO] [1723368234.298154098] [camera.camera]: getParameters...
[realsense2_camera_node-1] [INFO] [1723368234.299071811] [camera.camera]: JSON file is not provided
[realsense2_camera_node-1] [INFO] [1723368234.299196050] [camera.camera]: Device Name: Intel RealSense D435
[realsense2_camera_node-1] [INFO] [1723368234.299249679] [camera.camera]: Device Serial No: 819312072177
[realsense2_camera_node-1] [INFO] [1723368234.299296883] [camera.camera]: Device physical port: /sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1:1.0/video4linux/video0
[realsense2_camera_node-1] [INFO] [1723368234.299341049] [camera.camera]: Device FW version: 5.16.0.1
[realsense2_camera_node-1] [INFO] [1723368234.299380937] [camera.camera]: Device Product ID: 0x0B07
[realsense2_camera_node-1] [INFO] [1723368234.299423363] [camera.camera]: Sync Mode: Off
[realsense2_camera_node-1] [WARN] [1723368234.425169549] [camera.camera]: re-enable the stream for the change to take effect.
[realsense2_camera_node-1] [INFO] [1723368234.426805014] [camera.camera]: Set ROS param depth_module.infra_profile to default: 848x480x30
[realsense2_camera_node-1] [WARN] [1723368234.439084875] [camera.camera]: Could not set param: rgb_camera.power_line_frequency with 3 Range: [0, 2]: parameter 'rgb_camera.power_line_frequency' could not be set: Parameter {rgb_camera.power_line_frequency} doesn't comply with integer range.
[realsense2_camera_node-1] [WARN] [1723368234.457600470] [camera.camera]: re-enable the stream for the change to take effect.
[realsense2_camera_node-1] [INFO] [1723368234.465949147] [camera.camera]: Stopping Sensor: Depth Module
[realsense2_camera_node-1] [INFO] [1723368234.466597159] [camera.camera]: Stopping Sensor: RGB Camera
[realsense2_camera_node-1] [INFO] [1723368234.482211024] [camera.camera]: Starting Sensor: Depth Module
[realsense2_camera_node-1] [INFO] [1723368234.489250750] [camera.camera]: Open profile: stream_type: Depth(0), Format: Z16, Width: 640, Height: 480, FPS: 15
[realsense2_camera_node-1] [WARN] [1723368234.679122767] [camera.camera]: frame's time domain is HARDWARE_CLOCK. Timestamps may reset periodically.
[realsense2_camera_node-1] 11/08 16:23:59,553 ERROR [281472308734176] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[realsense2_camera_node-1] 11/08 16:23:59,553 ERROR [281472308734176] (global_timestamp_reader.cpp:239) Error during time_diff_keeper polling: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[realsense2_camera_node-1] 11/08 16:24:04,681 ERROR [281472342550752] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
[realsense2_camera_node-1] 11/08 16:24:04,681 ERROR [281472342550752] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
[realsense2_camera_node-1] 11/08 16:24:09,801 ERROR [281472359459040] (librealsense-exception.h:52) set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[realsense2_camera_node-1] 11/08 16:24:09,802 ERROR [281472359459040] (rs.cpp:237) [rs2_get_video_stream_intrinsics( from:0xffff58056940, intr:[ 1677697856x65535 p[9.43138e+21 9.18341e-41] f[9.43144e+21 9.18341e-41] UNKNOWN [9.18341e-41 9.43216e+21 9.18341e-41 9.43138e+21 9.18341e-41] ] ) Backend] set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[realsense2_camera_node-1] [WARN] [1723368249.802563956] [camera.camera]: No intrinsics available for this stream profile. Using zeroed intrinsics as default.
[realsense2_camera_node-1] 11/08 16:24:14,921 ERROR [281472342550752] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
[realsense2_camera_node-1] 11/08 16:24:14,921 ERROR [281472342550752] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
[realsense2_camera_node-1] 11/08 16:24:20,041 ERROR [281472308734176] (librealsense-exception.h:52) set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[realsense2_camera_node-1] 11/08 16:24:20,041 ERROR [281472308734176] (global_timestamp_reader.cpp:239) Error during time_diff_keeper polling: set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[realsense2_camera_node-1] 11/08 16:24:25,160 ERROR [281472342550752] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
[realsense2_camera_node-1] 11/08 16:24:25,161 ERROR [281472342550752] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
[realsense2_camera_node-1] 11/08 16:24:30,282 ERROR [281472359459040] (librealsense-exception.h:52) set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[realsense2_camera_node-1] 11/08 16:24:30,283 ERROR [281472359459040] (rs.cpp:237) [rs2_get_extrinsics( from:0xffff58032260, to:0xffff58056940, extrin:[ r[1,0,0,0,1,0,0,0,1] t[0,0,0] ] ) Backend] set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[realsense2_camera_node-1] [ERROR] [1723368270.283332416] [camera.camera]: ./src/rs_node_setup.cpp:487:An exception has been thrown: std::exception
[realsense2_camera_node-1] [ERROR] [1723368270.283689764] [camera.camera]: ./src/rs_node_setup.cpp:369:An exception has been thrown: std::exception
[realsense2_camera_node-1] [ERROR] [1723368270.284010576] [camera.camera]: Error starting device: std::exception
[realsense2_camera_node-1] [INFO] [1723368270.285600264] [camera.camera]: Stopping Sensor: RGB Camera
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[realsense2_camera_node-1] [INFO] [1723368274.258454851] [rclcpp]: signal_handler(signum=2)
[realsense2_camera_node-1] 11/08 16:24:35,401 ERROR [281472342550752] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
[realsense2_camera_node-1] 11/08 16:24:35,401 ERROR [281472342550752] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
[ERROR] [realsense2_camera_node-1]: process[realsense2_camera_node-1] failed to terminate '5' seconds after receiving 'SIGINT', escalating to 'SIGTERM'
[INFO] [realsense2_camera_node-1]: sending signal 'SIGTERM' to process[realsense2_camera_node-1]
[realsense2_camera_node-1] [INFO] [1723368279.275712202] [rclcpp]: signal_handler(signum=15)
[realsense2_camera_node-1] 11/08 16:24:40,521 ERROR [281472308734176] (librealsense-exception.h:52) set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[realsense2_camera_node-1] 11/08 16:24:40,521 ERROR [281472308734176] (global_timestamp_reader.cpp:239) Error during time_diff_keeper polling: set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[ERROR] [realsense2_camera_node-1]: process[realsense2_camera_node-1] failed to terminate '10.0' seconds after receiving 'SIGTERM', escalating to 'SIGKILL'
[INFO] [realsense2_camera_node-1]: sending signal 'SIGKILL' to process[realsense2_camera_node-1]
[ERROR] [realsense2_camera_node-1]: process has died [pid 6689, exit code -9, cmd '/opt/ros/humble/lib/realsense2_camera/realsense2_camera_node --ros-args --log-level info --ros-args -r __node:=camera -r __ns:=/camera --params-file /tmp/launch_params_0a0t6p6s --params-file /tmp/launch_params_kb4_u3td'].

I'm sorry drinkBr for causing inconveniences with long comments.

@MartyG-RealSense
Copy link
Collaborator

@drinkBr @MiTomMi As both of your issues are related to timing, let's try disabling Global Time and enabling Sync of the depth and color streams by adding the parameters below to your launch.

global_time_enabled:=false enable_sync:=true

@drinkBr
Copy link
Author

drinkBr commented Aug 11, 2024

@MartyG-RealSense, I don't have a Raspberry Pi at hand right now, so I can't verify this. I will test it tomorrow and send you a message.

@MartyG-RealSense
Copy link
Collaborator

Thanks very much, @drinkBr

@MiTomMi
Copy link

MiTomMi commented Aug 12, 2024

Hi @MartyG-RealSense, I tried 2 methods:

Method 1: ros2 launch realsense2_camera rs_launch.py depth_module.depth_profile:=640x480x15 rgb_camera.color_profile:=640x480x15 global_time_enabled:=false enable_sync:=true

Method 2: ros2 launch realsense2_camera rs_launch.py inital_reset:=true global_time_enabled:=false enable_sync:=true

Both methods result in these 4 major errors as in this issue:

[realsense2_camera_node-1] 12/08 14:55:27,553 ERROR [281472736749792] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
[realsense2_camera_node-1] 12/08 14:55:27,554 ERROR [281472736749792] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
[realsense2_camera_node-1] [ERROR] [1723449342.915113340] [camera.camera]: ./src/rs_node_setup.cpp:487:An exception has been thrown: std::exception
[realsense2_camera_node-1] [ERROR] [1723449342.915517448] [camera.camera]: ./src/rs_node_setup.cpp:369:An exception has been thrown: std::exception
[realsense2_camera_node-1] [ERROR] [1723449342.916101758] [camera.camera]: Error starting device: std::exception

Could you explain what are those errors and what cause them? I have tried to debug them with many methods from github but I still get the same error.

I'm looking forward to your reply. Thanks a lot!

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Aug 12, 2024

@MiTomMi It looks as though the error get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory nearly always occurs on Raspberry Pi boards. None of the four Pi cases linked to below that experience the errors offer a solution, unfortunately. There is not a defined meaning available for these errors.

#2991
#3089
https://forums.raspberrypi.com/viewtopic.php?t=370620
https://www.reddit.com/r/ROS/comments/1cp30d4/problem_getting_rgb_frames_via_intelrealsense/

There were a couple of non-Pi cases of the error where updating the camera firmware driver resolved it.

@drinkBr
Copy link
Author

drinkBr commented Aug 13, 2024

Hi, @MartyG-RealSense
Sorry for the late reply. I forgot that I haven't installed realsense-ros on the Ubuntu system on the SSD yet, so I haven't been able to verify it. Since I'm at it, I would like to confirm the installation steps for realsense-ros.

When I previously installed realsense-ros, I followed the instructions on the following page. Is that correct? Are there any necessary changes to consider if I installed realsense-related components using the LibUVC-backend installation method?

Installation on Ubuntu Step3 Option2 : https://github.com/IntelRealSense/realsense-ros

@MartyG-RealSense
Copy link
Collaborator

If you install librealsense from source code using the libuvc backend method then you can then afterwards build the ROS2 wrapper from source code with colcon build. In other words, use Step 3 Option 2 as you said.

You are using a Raspberry Pi 4 though, so there might be complications. Please give a colcon build a try and see what happens. You can always remove the wrapper build easily afterwards without affecting your librealsense installation if the wrapper does not work correctly.

@drinkBr
Copy link
Author

drinkBr commented Aug 13, 2024

Hi, @MartyG-RealSense

You are using a Raspberry Pi 4 though, so there might be complications. Please give a colcon build a try and see what happens.

Is it correct that I should verify the colcon build before installing realsense-ros?

@MartyG-RealSense
Copy link
Collaborator

The recommended install order in the instructions is:

  1. ROS (e.g ROS2 Humble)
  2. librealsense
  3. ROS wrapper

Skip step 1 if Humble is already installed.

I am not certain what you mean regarding verifying colcon build before installing realsense-ros, as colcon build is what does install realsense-ros.

@drinkBr
Copy link
Author

drinkBr commented Aug 13, 2024

I misunderstood. So, I just need to execute Step 3 Option 2 in the Terminal, right?

@MartyG-RealSense
Copy link
Collaborator

Yes, that's correct.

@drinkBr
Copy link
Author

drinkBr commented Aug 13, 2024

OK! I will test it tomorrow and send you a message.

@haidaumitom
Copy link

haidaumitom commented Aug 15, 2024

Hi @MartyG-RealSense, I am MiTomMi.
I have tried to re-install Ubuntu desktop 22.04 LTS and ROS2 Humble on Raspberry Pi 4. I followed libuvc_installation.md. After finished installing it, I ran the command: realsense-viewer and it was only successful whenever I re-plug in the cable. The results are shown below:

Screenshot from 2024-08-15 18-33-27
Screenshot from 2024-08-15 18-38-00

I don't know why the frames are fractured like this. Could you figure it out?

Thanks a lot!!!

@haidaumitom
Copy link

UPDATE:
Hi @MartyG-RealSense. I ran rs-capture and the result are really clear with no problem.

Screenshot from 2024-08-15 18-52-24

Do you know what's the problem in realsense-viewer in my case?

Thank you!!!

@MartyG-RealSense
Copy link
Collaborator

The rs-capture image is a 2D depth image like the one in the RealSense Viewer when you select the '2D' option in the top corner of the Viewer window. The broken images that you provided above are from the '3D' pointcloud mode of the Viewer.

Do you get a better depth image in the Viewer if you click on '2D' to switch to 2D depth mode?

I note that in your Viewer's 3D mode with the broken images, the 'Measure' option at the top of the window is greyed out and unselectable. This suggests that the GLSL graphics options in your Viewer are disabled. You can use instructions at IntelRealSense/librealsense#8110 (comment) to check the status of the GLSL options and see whether they are currently enabled or disabled.

If the boxes beside the Processing and Rendering settings are black (off) then try clicking on them to turn the boxes blue (on) and click the Apply button, then test the depth pointcloud in 3D mode again.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Aug 23, 2024

Hi @drinkBr and @haidaumitom Do either of you require further assistance with this case, please? Thanks!

@haidaumitom
Copy link

Hi @MartyG-RealSense, I do not require any addition assistance.

Thanks for your really supporting help! I really appreciate that!

Best regards.

@MartyG-RealSense
Copy link
Collaborator

@haidaumitom Thanks very much. You are very welcome. I'm pleased that I could help!

@drinkBr Is your problem resolved, please?

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

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

4 participants