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

Not able to run Realsense D455 with ROS2 connected with Raspberry Pi 4B #3246

Open
mxmmbd1 opened this issue Nov 7, 2024 · 2 comments
Open
Labels

Comments

@mxmmbd1
Copy link

mxmmbd1 commented Nov 7, 2024

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

  • All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)


Required Info
Camera Model { D455 }
Firmware Version (Open RealSense Viewer --> Click info)
Operating System & Version { Linux (Ubuntu 22) }
Kernel Version (Linux Only) 5.15.0-1064-raspi
Platform Raspberry Pi
Librealsense SDK Version { 2.55.1 }
Language {C/C#/labview/opencv/pcl/python/unity }
Segment {Robot}
ROS Distro {Humble }
RealSense ROS Wrapper Version {4.56.1}

Issue Description

similar to issue #3158
@MartyG-RealSense @haidaumitom I am currently trying to connect the Realsense D455 with the Raspberry Pi 4 B over ROS 2. I used humble on the Ubuntu 22.04. I followed this guide https://github.com/IntelRealSense/realsense-ros?tab=readme-ov-file#installation-on-ubuntu. I followed the steps for the installation on Ubuntu and did Step 1. the guide of Humble. Step 2 I did option 2. Step 3 I did option 2.
The camera is plugged into the USB 3.0
When trying to do
ros2 launch realsense2_camera rs_launch.py
ros2 launch realsense2_camera rs_launch.py depth_module.depth_profile:=1280x720x30 pointcloud.enable:=true
or
ros2 run realsense2_camera realsense2_camera_node
ros2 run realsense2_camera realsense2_camera_node --ros-args -p enable_color:=false -p spatial_filter.enable:=true -p temporal_filter.enable:=true

I get this response usually

ubuntu@ubuntu:~$ ros2 run realsense2_camera realsense2_camera_node
[INFO] [1730965261.762033036] [camera.camera]: RealSense ROS v4.55.1
[INFO] [1730965261.762469221] [camera.camera]: Built with LibRealSense v2.55.1
[INFO] [1730965261.762566832] [camera.camera]: Running with LibRealSense v2.55.1
[INFO] [1730965262.656205988] [camera.camera]: Device with serial number 239222300719 was found.

[INFO] [1730965262.656402118] [camera.camera]: Device with physical ID /sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2:1.0/video4linux/video0 was found.
[INFO] [1730965262.656456747] [camera.camera]: Device with name Intel RealSense D455 was found.
[INFO] [1730965262.657174043] [camera.camera]: Device with port number 2-2 was found.
[INFO] [1730965262.657278394] [camera.camera]: Device USB type: 3.2
[INFO] [1730965262.660164317] [camera.camera]: getParameters...
[INFO] [1730965262.664702702] [camera.camera]: JSON file is not provided
[INFO] [1730965262.664834887] [camera.camera]: Device Name: Intel RealSense D455
[INFO] [1730965262.664899831] [camera.camera]: Device Serial No: 239222300719
[INFO] [1730965262.664961350] [camera.camera]: Device physical port: /sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2:1.0/video4linux/video0
[INFO] [1730965262.665021146] [camera.camera]: Device FW version: 5.13.0.55
[INFO] [1730965262.665077849] [camera.camera]: Device Product ID: 0x0B5C
[INFO] [1730965262.665132146] [camera.camera]: Sync Mode: Off
[WARN] [1730965262.820846782] [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] [1730965262.850490900] [camera.camera]: Stopping Sensor: Depth Module
[INFO] [1730965262.850802678] [camera.camera]: Stopping Sensor: RGB Camera
[INFO] [1730965262.850898844] [camera.camera]: Stopping Sensor: Motion Module
[INFO] [1730965262.910490802] [camera.camera]: Starting Sensor: Depth Module
[INFO] [1730965262.928259561] [camera.camera]: Open profile: stream_type: Infra(1), Format: Y8, Width: 848, Height: 480, FPS: 30
[INFO] [1730965262.928471931] [camera.camera]: Open profile: stream_type: Infra(2), Format: Y8, Width: 848, Height: 480, FPS: 30
[INFO] [1730965262.928582987] [camera.camera]: Open profile: stream_type: Depth(0), Format: Z16, Width: 848, Height: 480, FPS: 30
[WARN] [1730965263.142029565] [camera.camera]: frame's time domain is HARDWARE_CLOCK. Timestamps may reset periodically.
 07/11 07:41:07,957 ERROR [281472992733408] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
 07/11 07:41:07,982 ERROR [281472992733408] (global_timestamp_reader.cpp:239) Error during time_diff_keeper polling: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
 07/11 07:41:13,085 ERROR [281472762112224] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
 07/11 07:41:13,086 ERROR [281472762112224] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
 07/11 07:41:18,206 ERROR [281472753658080] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
 07/11 07:41:18,207 ERROR [281472753658080] (d400-thermal-monitor.cpp:97) Error during thermal compensation handling: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
 07/11 07:41:23,326 ERROR [281473001187552] (librealsense-exception.h:52) set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
 07/11 07:41:23,326 ERROR [281473001187552] (rs.cpp:237) [rs2_get_video_stream_intrinsics( from:0xffff8006daa0, intr:[ -1975540928x65535  p[-9.22703e-33 9.18341e-41]  f[-9.22711e-33 9.18341e-41]  UNKNOWN [9.18341e-41 -9.22806e-33 9.18341e-41 -9.22703e-33 9.18341e-41] ] ) Backend] set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
[WARN] [1730965283.327016359] [camera.camera]: No intrinsics available for this stream profile. Using zeroed intrinsics as default.
 07/11 07:41:28,445 ERROR [281472762112224] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
 07/11 07:41:28,445 ERROR [281472762112224] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
 07/11 07:41:33,565 ERROR [281472753658080] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
 07/11 07:41:33,566 ERROR [281472753658080] (d400-thermal-monitor.cpp:97) Error during thermal compensation handling: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
 07/11 07:41:38,686 ERROR [281472992733408] (librealsense-exception.h:52) set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
 07/11 07:41:38,686 ERROR [281472992733408] (global_timestamp_reader.cpp:239) Error during time_diff_keeper polling: set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
 07/11 07:41:43,805 ERROR [281472762112224] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
 07/11 07:41:43,806 ERROR [281472762112224] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
 07/11 07:41:48,925 ERROR [281472753658080] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
 07/11 07:41:48,925 ERROR [281472753658080] (d400-thermal-monitor.cpp:97) Error during thermal compensation handling: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
 07/11 07:41:54,046 ERROR [281473001187552] (librealsense-exception.h:52) set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Connection timed out
 07/11 07:41:54,047 ERROR [281473001187552] (rs.cpp:237) [rs2_get_extrinsics( from:0xffff800412b0, to:0xffff8006daa0, 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
[ERROR] [1730965314.047458440] [camera.camera]: ./src/rs_node_setup.cpp:487:An exception has been thrown: std::exception
[ERROR] [1730965314.047864754] [camera.camera]: ./src/rs_node_setup.cpp:369:An exception has been thrown: std::exception
[ERROR] [1730965314.048224493] [camera.camera]: Error starting device: std::exception
 07/11 07:41:59,165 ERROR [281472762112224] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
 07/11 07:41:59,165 ERROR [281472762112224] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: No such file or directory
@mxmmbd1
Copy link
Author

mxmmbd1 commented Nov 7, 2024

little update, I was able to make it run after these changes, but very slowly and doesn't work every time, as well extremely slow when doing rviz2 on my computer and going on topic /camera/camera/color/image_raw

documented here the steps since my first message:

Hardware:
Intel RealSense D455 Camera
Raspberry Pi 4
High-quality, short USB 3.2 cable connected to a high-power port

Software:
Ubuntu 22.04
ROS2 Humble
RealSense SDK 2.55.1
RealSense ROS2 Wrapper 4.55.1

  1. Install Dependencies

First, ensure your system is updated and install dependencies required for RealSense SDK:

sudo apt update && sudo apt upgrade
sudo apt install git cmake libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev
  1. Install the RealSense SDK (librealsense)

We are using RealSense SDK v2.55.1, which you can download and install manually. Ensure you are in the home directory for these steps.

# Clone the RealSense SDK repository
git clone https://github.com/IntelRealSense/librealsense.git
cd librealsense
git checkout v2.55.1

# Build and install the SDK
mkdir build && cd build
cmake ../ -DCMAKE_BUILD_TYPE=Release
make -j4
sudo make install
  1. Update Camera Firmware

It's important to use firmware version 5.16.0.1 for compatibility. Use the RealSense Viewer to check and update firmware:

realsense-viewer
In the viewer, navigate to the settings and update the firmware if necessary.

  1. Install the RealSense ROS2 Wrapper

The RealSense ROS2 wrapper version 4.55.1 is used here. This wrapper integrates the RealSense SDK with ROS2, allowing you to access camera data in ROS2.

4.1. Create a ROS2 Workspace:

mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src

4.2. Clone the Wrapper Repository:
git clone https://github.com/IntelRealSense/realsense-ros.git -b ros2-4.55.1
4.3. Install ROS Dependencies:

cd ~/ros2_ws
sudo apt install python3-rosdep
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src -r -y

4.4. Build the ROS2 Wrapper:

cd ~/ros2_ws
colcon build --merge-install

4.5. Source the ROS2 Environment:

source /opt/ros/humble/setup.bash
source ~/ros2_ws/install/local_setup.bash

  1. Run the RealSense ROS2 Node

Now that everything is installed, run the RealSense ROS2 node to start capturing data from the D455 camera.

ros2 run realsense2_camera realsense2_camera_node

@MartyG-RealSense
Copy link
Collaborator

Thanks so much @mxmmbd1 for sharing in detail the procedure that enabled you to get it working with your Raspberry Pi.

I note that you are experiencing extreme slowness, however. This is characteristic of using RealSense cameras with Raspberry Pi boards. Typically, the best that can be achieved is basic depth and color streaming.

Please test whether performance improves if you set depth and color to 640x480 resolution at 15 FPS.

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

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