-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
xioctl (VIDIOC_S_FMT) Error while running "ros2 run realsense2_camera realsense2_camera_node" #13108
Comments
Hi @mosi3707 Your second image lists your librealsense SDK and ROS2 wrapper versions as 2.55.1 and 4.55.1, which is a correct match. However, the camera firmware driver version is listed as 5.12.14.50. This firmware is designed for use with librealsense SDK 2.48.0. The required firmware for librealsense 2.55.1 is 5.16.0.1 |
Ok, how would I upgrade to that exact version of firmware? |
If you are not able to use graphical tools such as realsense-viewer on your Pi then you can download the firmware .bin file for firmware 5.16.0.1 from the link below. https://dev.intelrealsense.com/docs/firmware-releases-d400#d400-series-firmware-downloads You can then use a text-based tool called rs-fw-update to perform the firmware update. https://github.com/IntelRealSense/librealsense/tree/master/tools/fw-update Then initiate the firmware update using the downloaded .bin file with a command like the one below.
Change the serial number after -s to the serial number of your particular camera. If you do have access to the realsense-viewer tool then once you have downloaded the 5.16.0.1 .bin file, you can go to the 'More' option near the top of the Viewer's options side-panel, select 'Update Firmware' from its drop down menu and navigate to the .bin file's location on your computer. Then select the file to automatically initiate the firmware update. |
Yes, I would recommend trying to run rs-fw-update in sudo admin permissions mode by putting sudo on the front of the command? For example:
|
I have attempted several solutions to get the command to run as sudo. First, adding sudo to the rs-fw-update command will give a "Command not found" error. I discovered that this is because the sudo $PATH is not the same as default user's $PATH. To solve this, I added the path (/opt/ros/humble/bin) to the rs-fw-update command to the visudo file. I also added the path (/opt/ros/humble/lib/aarch64-linux-gnu) to .... the visudo file. Adding these paths to the visudo file allows the command to be run, but it will get the error "error while loading shared libraries: librealsense2.so.2.55: cannot open shared object file: No such file or directory" I originally tried to solve this by adding the path to those libraries to the visudo file, but that did not fix it. I found that others had a similar issue when several versions of librealsense2 were installed. I attempted to move the librealsense2.so.2.55.1 file to a different directory to "hide" it so the command does not get confused on versions, but that had no change. |
As you are using a Raspberry Pi, the sudo-apt method I would recommend first focusing on getting librealsense working correctly on your Pi and look at the problem of installing the ROS wrapper afterwards. A reliable way of installing librealsense on Pi is the libuvc backend method. A build script for installing librealsense this way can be found at the link below. https://github.com/IntelRealSense/librealsense/blob/master/doc/libuvc_installation.md Before running the build script, I also recommend uninstalling all packages on your computer with 'realsense' in their name using this command:
|
It appears we are almost there to successfully running "ros2 run realsense2_camera realsense2_camera_node". Currently that command gives the following error Here are the steps that I have taken and the current state of the Pi.
All above steps except the final one worked without errors. I suspect there is no realsense2_camera package installed since I skipped the two following steps sudo apt install ros-humble-librealsense2* Is there a way to 1. check if I have the realsense2_camera package installed and I simply do not have it on my PATH, and 2. If it is not installed, a way to install it without causing conflict with the libuvc workaround? |
You can list all installed packages in the Ubuntu terminal with the command To list only packages with 'realsense' in their name, try this:
Regarding libuvc, that method builds librealsense from source code. You should be able to install the ROS wrapper from packages with |
It appears to have worked once. I ran "sudo apt install ros-humble-realsense2-*", then ran the ros2 run command. This created the exact same error messages as the start of this thread. Then I tried running ros2 launch, and that seemed to work. Then, on a linux PC I ran "ros2 launch turtlebot3_bringup rviz2.launch.py" to try to see any output. I could get the image, but some of the features did not seem to be working. I checked back on the terminal connected to the pi, and I saw the same xioctl(VIDIOC_S_FMT) error as the ros2 run command. I am not sure what this error message is relating to, since I am able to get an image in rviz that was successfully updating. Listing all topics on my linux PC gives Furthermore, after trying ros2 run or ros2 launch a second time, I am met with the same error, and I cannot get it to run again. A full power cycle of the Pi does not resolve the issue. Below is a full copy of the error message for the ros2 launch command after a power cycle
|
Does it make a difference if you add the initial_reset:=true parameter to your launches to reset the camera at launch? ros2 run ros2 launch |
No difference that I can see
|
And the same problem if you add global_time_enabled:=false to your ros2 launch instruction to disable Global Time? |
After a couple tries with different iterations of ros2 run and ros2 launch with the flags global_time_enabled:=false and initial_reset:=true, I had it function once, but I have not been able to reproduce it. Here is the output from the temporarily successful run
Most of the other iterations have some form of the following errors
|
it is encouraging that you were able to launch the ROS wrapper successfully at least once. THe problem may be with the Raspberry Pi board itself rather than the camera or the SDK / wrapper software. It is difficult to get librealsense working on Pi boards, and getting the ROS wrapper working on Pi afterwards can be even more complicated. In these situations, I recommend focusing on getting librealsense working first and then looking at the wrapper installation once you have s stable librealsense build. On Pi though the best that can be expected is streaming basic depth and RGB streams. The RealSense IMU is usually not accessible on Pi. |
Perfect, I don't really need IMU data. Do we suspect that the access to IMU is causing these issues? Is there a way to run the node to only access RGB? Once that is working, is there a way to only attempt to access RBG + Depth information, since that would be the extent of what I would like working for my project? Possibly even a solution to do a ros2 launch command to start an RGB camera topic, then open another terminal and do a ros2 launch command to start a depth topic? |
You can control which streams are enabled and which are left disabled by including configuration statements in your ROS2 launch instruction. You do not need to disable the IMU and infrared streams as they are already disabled in the launch file by default. RGB only RGB and Depth |
I can have repeatable success, with some strange side effects. After playing around with only enabling one sensor at a time, I saw that I could get any single sensor running (RBG, Depth, even infra, even though my rviz would not show it). If I enabled any two, it would fail. I then found #5628 and decided to try to change the timeouts. I'm not sure if I'm using the correct settings here, but I changed wait_for_device_timeout and reconnect_timeout and managed to get depth and RBG running together. I'm not sure how many I can stream at the same time, but for this project I only need those two. Here is the command I used to successfully run the node.
And here is the successful output
It is possible to sometimes get this warning message
and when this warning message appears, then this error can follow, and it the pi/camera will get into a bad state where I cannot get RGB+Depth to run again.
This can be solved by power cycling the pi/camera. I also discovered there is a very strange method that is repeatable that I need to do to get RGB+Depth to run together. I need to first run only RGB, then turn that off, then run only depth, turn that off, then finally run RGB+Depth with the timeout values set, and it will run successfully. If I attempt to run RGB+Depth immediately after a power cycle without running individually first it will fail every time. Overall, I can make this work for my project, I will just have to power cycle and run a weird setup procedure . Is there any settings you would recommend playing with to make this more robust? I would prefer to see if there is a more robust and straight forward method than the one I created before I close this issue. |
Thanks so much for sharing the details of the adjustments that enabled you to achieve two streams on your Raspberry Pi. There is an alternative method to an external power source for powering a Pi called a Power Over Ethernet (PoE) Hat, as described at #8274 (comment) |
Since the method I described has been stable these last few days, I think this issue is resolved and can be closed. |
That's great to hear that your system has been stable. Thanks very much for the update! |
When running the command "ros2 run realsense2_camera realsense2_camera_node", the following error screen appears.
I am trying to get a turtlebot3 system running the D435i camera, using a Raspberry Pi, and ROS2 humble. ROS2 humble has been setup following the steps on the official guide (https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html).
The realsense libraries where installed with the following steps.
None of the above commands gave warnings. Then, on the terminal with no other ROS2 script running, using either "ros2 run realsense2_camera realsense2_camera_node" or "ros2 launch realsense2_camera rs_launch.py" both produce the same output.
The Line above the Error says "Connection timed out", but I am not sure why this would be happening. I have a USB - USB C 3.2 connection to the Pi's USB 3.0 port, so there shouldn't be any speed issues there. There are no other ROS2 nodes running, so from what I can tell, there are no other processes taking up processing power.
The text was updated successfully, but these errors were encountered: