一、问题描述在树莓派 4B Ubuntu22.04/ROS2 Humble上运行深度相机出现报错[INFO] [launch]: All log files can be found below /home/wcr/.ros/log/2026-04-13-10-59-50-489352-wcr-desktop-3257 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [launch.user]: Launching as Normal ROS Node [INFO] [realsense2_camera_node-1]: process started with pid [3262] [realsense2_camera_node-1] [INFO] [1776049192.610841074] [camera.camera]: RealSense ROS v4.57.7 [realsense2_camera_node-1] [INFO] [1776049192.611350819] [camera.camera]: Built with LibRealSense v2.57.7 [realsense2_camera_node-1] [INFO] [1776049192.611465852] [camera.camera]: Running with LibRealSense v2.57.7 [realsense2_camera_node-1] [INFO] [1776049192.831867002] [camera.camera]: Device with serial number 819612071351 was found. [realsense2_camera_node-1] [realsense2_camera_node-1] [INFO] [1776049192.832075014] [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] [1776049192.832134420] [camera.camera]: Device with name Intel RealSense D435 was found. [realsense2_camera_node-1] [INFO] [1776049192.833733356] [camera.camera]: Device with port number 2-1 was found. [realsense2_camera_node-1] [INFO] [1776049192.833898481] [camera.camera]: Device USB type: 3.2 [realsense2_camera_node-1] [INFO] [1776049192.843323101] [camera.camera]: getParameters... [realsense2_camera_node-1] [INFO] [1776049192.851404945] [camera.camera]: JSON file is not provided [realsense2_camera_node-1] [INFO] [1776049192.851663105] [camera.camera]: Device Name: Intel RealSense D435 [realsense2_camera_node-1] [INFO] [1776049192.851798490] [camera.camera]: Device Serial No: 819612071351 [realsense2_camera_node-1] [INFO] [1776049192.851871858] [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] [1776049192.851947430] [camera.camera]: Device FW version: 5.17.0.10 [realsense2_camera_node-1] [INFO] [1776049192.852016428] [camera.camera]: Device Product ID: 0x0B07 [realsense2_camera_node-1] [INFO] [1776049192.852082593] [camera.camera]: Sync Mode: Off [realsense2_camera_node-1] [WARN] [1776049192.964510539] [camera.camera]: re-enable the stream for the change to take effect. [realsense2_camera_node-1] [INFO] [1776049192.966316043] [camera.camera]: Set ROS param depth_module.infra_profile to default: 848x480x30 [realsense2_camera_node-1] [WARN] [1776049192.981626052] [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} doesnt comply with integer range. [realsense2_camera_node-1] [WARN] [1776049192.998282318] [camera.camera]: re-enable the stream for the change to take effect. [realsense2_camera_node-1] [INFO] [1776049193.023357015] [camera.camera]: Stopping Sensor: Depth Module [realsense2_camera_node-1] [INFO] [1776049193.024115567] [camera.camera]: Stopping Sensor: RGB Camera [realsense2_camera_node-1] [INFO] [1776049193.114362680] [camera.camera]: Starting Sensor: Depth Module [realsense2_camera_node-1] [INFO] [1776049193.129921202] [camera.camera]: Open profile: stream_type: Depth(0), Format: Z16, Width: 640, Height: 480, FPS: 15 [realsense2_camera_node-1] [WARN] [1776049193.388628343] [camera.camera]: frames time domain is HARDWARE_CLOCK. Timestamps may reset periodically. [realsense2_camera_node-1] 13/04 10:59:58,165 ERROR [281473398950112] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 1 Last Error: Connection timed out [realsense2_camera_node-1] 13/04 10:59:58,198 ERROR [281473398950112] (global_timestamp_reader.cpp:253) Error during time_diff_keeper polling: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 1 Last Error: Connection timed out [realsense2_camera_node-1] 13/04 11:00:03,285 ERROR [281473231874272] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 7 Last Error: No such file or directory [realsense2_camera_node-1] 13/04 11:00:03,285 ERROR [281473231874272] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 7 Last Error: No such file or directory [realsense2_camera_node-1] 13/04 11:00:08,405 ERROR [281473424746720] (librealsense-exception.h:52) set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 1 Last Error: Connection timed out [realsense2_camera_node-1] 13/04 11:00:08,423 ERROR [281473424746720] (rs.cpp:280) [rs2_get_video_stream_intrinsics( profile:[ C RGB8 0 640x480 15 ], intr:(out) ) Backend] set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 1 Last Error: Connection timed out [realsense2_camera_node-1] [WARN] [1776049208.423960202] [camera.camera]: No intrinsics available for this stream profile. Using zeroed intrinsics as default. [realsense2_camera_node-1] 13/04 11:00:13,525 ERROR [281473231874272] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 7 Last Error: No such file or directory [realsense2_camera_node-1] 13/04 11:00:13,525 ERROR [281473231874272] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 7 Last Error: No such file or directory [realsense2_camera_node-1] 13/04 11:00:18,645 ERROR [281473398950112] (librealsense-exception.h:52) set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 1 Last Error: Connection timed out [realsense2_camera_node-1] 13/04 11:00:18,646 ERROR [281473398950112] (global_timestamp_reader.cpp:253) Error during time_diff_keeper polling: set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 1 Last Error: Connection timed out [realsense2_camera_node-1] 13/04 11:00:23,765 ERROR [281473231874272] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 7 Last Error: No such file or directory [realsense2_camera_node-1] 13/04 11:00:23,765 ERROR [281473231874272] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 7 Last Error: No such file or directory [realsense2_camera_node-1] 13/04 11:00:28,885 ERROR [281473424746720] (librealsense-exception.h:52) set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 1 Last Error: Connection timed out [realsense2_camera_node-1] 13/04 11:00:28,885 ERROR [281473424746720] (rs.cpp:280) [rs2_get_extrinsics( from:[ D Z16 0 1280x720 30 ], to:[ C RGB8 0 640x480 15 ], extrin:[ r[1,0,0,0,1,0,0,0,1] t[0,0,0] ] ) Backend] set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 1 Last Error: Connection timed out [realsense2_camera_node-1] [ERROR] [1776049228.894861304] [camera.camera]: ./src/rs_node_setup.cpp:550:An exception has been thrown: std::exception [realsense2_camera_node-1] [ERROR] [1776049228.895232152] [camera.camera]: ./src/rs_node_setup.cpp:432:An exception has been thrown: std::exception [realsense2_camera_node-1] [ERROR] [1776049228.895424837] [camera.camera]: Error starting device: std::exception [realsense2_camera_node-1] [INFO] [1776049228.896602852] [camera.camera]: Stopping Sensor: RGB Camera [realsense2_camera_node-1] 13/04 11:00:34,005 ERROR [281473231874272] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 7 Last Error: No such file or directory [realsense2_camera_node-1] 13/04 11:00:34,005 ERROR [281473231874272] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 7 Last Error: No such file or directory [realsense2_camera_node-1] 13/04 11:00:39,125 ERROR [281473398950112] (librealsense-exception.h:52) set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 1 Last Error: Connection timed out [realsense2_camera_node-1] 13/04 11:00:39,125 ERROR [281473398950112] (global_timestamp_reader.cpp:253) Error during time_diff_keeper polling: set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 1 Last Error: Connection timed out [realsense2_camera_node-1] 13/04 11:00:44,249 ERROR [281473231874272] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 7 Last Error: No such file or directory [realsense2_camera_node-1] 13/04 11:00:44,249 ERROR [281473231874272] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 7 Last Error: No such file or directory [realsense2_camera_node-1] 13/04 11:00:49,365 ERROR [281473206511840] (librealsense-exception.h:52) set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 1 Last Error: Connection timed out [realsense2_camera_node-1] 13/04 11:00:49,365 ERROR [281473206511840] (rs.cpp:280) [rs2_get_video_stream_intrinsics( profile:[ C RGB8 0 640x480 15 ], intr:(out) ) Backend] set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 1 Last Error: Connection timed out [realsense2_camera_node-1] [WARN] [1776049249.366107790] [camera.camera]: No intrinsics available for this stream profile. Using zeroed intrinsics as default. [realsense2_camera_node-1] 13/04 11:00:54,485 ERROR [281473231874272] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 7 Last Error: No such file or directory [realsense2_camera_node-1] 13/04 11:00:54,485 ERROR [281473231874272] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 7 Last Error: No such file or directory [realsense2_camera_node-1] 13/04 11:00:59,605 ERROR [281473398950112] (librealsense-exception.h:52) set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 1 Last Error: Connection timed out [realsense2_camera_node-1] 13/04 11:00:59,605 ERROR [281473398950112] (global_timestamp_reader.cpp:253) Error during time_diff_keeper polling: set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 1 Last Error: Connection timed out [realsense2_camera_node-1] 13/04 11:01:04,725 ERROR [281473231874272] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 7 Last Error: No such file or directory [realsense2_camera_node-1] 13/04 11:01:04,726 ERROR [281473231874272] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 7 Last Error: No such file or directory [realsense2_camera_node-1] 13/04 11:01:09,845 ERROR [281473206511840] (librealsense-exception.h:52) set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 1 Last Error: Connection timed out [realsense2_camera_node-1] 13/04 11:01:09,845 ERROR [281473206511840] (rs.cpp:280) [rs2_get_extrinsics( from:[ D Z16 0 1280x720 30 ], to:[ C RGB8 0 640x480 15 ], extrin:[ r[1,0,0,0,1,0,0,0,1] t[0,0,0] ] ) Backend] set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 1 Last Error: Connection timed out [realsense2_camera_node-1] [ERROR] [1776049269.845866242] [camera.camera]: ./src/rs_node_setup.cpp:550:An exception has been thrown: std::exception [realsense2_camera_node-1] [ERROR] [1776049269.846261538] [camera.camera]: ./src/rs_node_setup.cpp:432:An exception has been thrown: std::exception [realsense2_camera_node-1] [ERROR] [1776049269.846507123] [camera.camera]: Error updating the sensors: std::exception [realsense2_camera_node-1] 13/04 11:01:14,965 ERROR [281473231874272] (librealsense-exception.h:52) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 7 Last Error: No such file or directory [realsense2_camera_node-1] 13/04 11:01:14,966 ERROR [281473231874272] (error-handling.cpp:99) Error during polling error handler: get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 7 Last Error: No such file or directory在树莓派上运行相机驱动时出现了一系列错误主要是get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed on control 1 Last Error: Connection timed out和No such file or directory等与内核扩展单元交互失败的异常。而且相机硬件本身正常rs-enumerate-devices可以识别但 ROS 节点启动时 UVC 控制命令超时导致无法获取相机内参和外参最终节点失败。这通常是树莓派上USB 驱动或内核 UVC 模块与 RealSense 的硬件控制通道冲突所致。二、解决方法1.使用 libuvc 后端并应用内核补丁树莓派官方内核的 UVC 驱动对 RealSense 的支持不完整必须使用 Intel 提供的libuvc 安装脚本它会自动应用必要的内核补丁并替换后端。打开终端输入cd ~ wget https://github.com/IntelRealSense/librealsense/raw/master/scripts/libuvc_installation.sh赋予权限chmod x libuvc_installation.sh运行编译./libuvc_installation.sh中间可能要输几次密码。脚本运行完成后必须重启树莓派sudo reboot2.手动处理 UVC 驱动冲突1重新加载模块如果重启后问题依旧可以临时强制卸载并重新加载uvcvideo模块sudo rmmod uvcvideosudo modprobe uvcvideo2永久禁用内核自带 UVC 驱动编辑/boot/firmware/config.txt或/boot/config.txtsudo nano /boot/firmware/config.txt在末尾添加dtoverlaydisable-uvc保存后重启sudo reboot3.更新树莓派固件在终端中输入sudo apt update sudo apt upgrade -y确保系统内核为最新老版本存在已知的 USB 问题sudo rpi-eeprom-update -a sudo reboot三、验证测试1.验证驱动切换重启后再次运行lsmod | grep uvcvideo然后执行rs-enumerate-devices如果正常输出相机支持的流配置则说明 libuvc 后端已生效。Stream Profiles supported by Stereo Module Supported modes: STREAM RESOLUTION FORMAT FPS Infrared 1 1280x800 Y16 25/15 Hz Infrared 1 | Y8 30/15 Hz Infrared 1 1280x720 Y8 30/15/6 Hz Infrared 1 848x480 Y8 90/60/30/15/6 Hz Infrared 1 848x100 Y8 300/100 Hz Infrared 1 640x480 Y8 90/60/30/15/6 Hz Infrared 1 640x400 Y16 25/15 Hz Infrared 1 640x360 Y8 90/60/30/15/6 Hz Infrared 1 480x270 Y8 90/60/30/15/6 Hz Infrared 1 424x240 Y8 90/60/30/15/6 Hz Infrared 2 1280x800 Y16 25/15 Hz Infrared 2 | Y8 30/15 Hz Infrared 2 1280x720 Y8 30/15/6 Hz Infrared 2 848x480 Y8 90/60/30/15/6 Hz Infrared 2 848x100 Y8 300/100 Hz Infrared 2 640x480 Y8 90/60/30/15/6 Hz Infrared 2 640x400 Y16 25/15 Hz Infrared 2 640x360 Y8 90/60/30/15/6 Hz Infrared 2 480x270 Y8 90/60/30/15/6 Hz Infrared 2 424x240 Y8 90/60/30/15/6 Hz Depth 1280x720 Z16 30/15/6 Hz Depth 848x480 Z16 90/60/30/15/6 Hz Depth 848x100 Z16 300/100 Hz Depth 640x480 Z16 90/60/30/15/6 Hz Depth 640x360 Z16 90/60/30/15/6 Hz Depth 480x270 Z16 90/60/30/15/6 Hz Depth 424x240 Z16 90/60/30/15/6 Hz Depth 256x144 Z16 300/90 Hz Stream Profiles supported by RGB Camera Supported modes: STREAM RESOLUTION FORMAT FPS Color 1920x1080 RGB8 30/15/6 Hz Color | BGRA8 30/15/6 Hz Color | RGBA8 30/15/6 Hz Color | BGR8 30/15/6 Hz Color | YUYV 30/15/6 Hz Color 1280x720 RGB8 30/15/6 Hz Color | BGRA8 30/15/6 Hz Color | RGBA8 30/15/6 Hz Color | BGR8 30/15/6 Hz Color | YUYV 30/15/6 Hz Color 960x540 RGB8 60/30/15/6 Hz Color | BGRA8 60/30/15/6 Hz Color | RGBA8 60/30/15/6 Hz Color | BGR8 60/30/15/6 Hz Color | YUYV 60/30/15/6 Hz Color 848x480 RGB8 60/30/15/6 Hz Color | BGRA8 60/30/15/6 Hz Color | RGBA8 60/30/15/6 Hz Color | BGR8 60/30/15/6 Hz Color | YUYV 60/30/15/6 Hz Color 640x480 RGB8 60/30/15/6 Hz Color | BGRA8 60/30/15/6 Hz Color | RGBA8 60/30/15/6 Hz Color | BGR8 60/30/15/6 Hz Color | YUYV 60/30/15/6 Hz Color 640x360 RGB8 60/30/15/6 Hz Color | BGRA8 60/30/15/6 Hz Color | RGBA8 60/30/15/6 Hz Color | BGR8 60/30/15/6 Hz Color | YUYV 60/30/15/6 Hz Color 424x240 RGB8 60/30/15/6 Hz Color | BGRA8 60/30/15/6 Hz Color | RGBA8 60/30/15/6 Hz Color | BGR8 60/30/15/6 Hz Color | YUYV 60/30/15/6 Hz Color 320x240 RGB8 60/30/6 Hz Color | BGRA8 60/30/6 Hz Color | RGBA8 60/30/6 Hz Color | BGR8 60/30/6 Hz Color | YUYV 60/30/6 Hz Color 320x180 RGB8 60/30/6 Hz Color | BGRA8 60/30/6 Hz Color | RGBA8 60/30/6 Hz Color | BGR8 60/30/6 Hz Color | YUYV 60/30/6 Hz3.重新启动相机节点使用之前已验证可工作的命令低负载配置ros2 launch realsense2_camera rs_launch.py \ align_depth.enable:true \ depth_module.depth_profile:640x480x15 \ rgb_camera.color_profile:640x480x15 \ enable_infra1:false \ enable_infra2:false不再出现 UVC 超时错误并看到类似以下成功启动的日志[INFO] [camera.camera]: RealSense Node Is Up!至此问题解决。其他优化项具体操作使用 5GHz WiFi树莓派 4B 支持 5GHz在路由器设置中将两台设备连接到 5GHz 频段。降低图像分辨率/帧率若网络仍有卡顿在树莓派启动相机时改用更低负载depth_module.depth_profile:424x240x6rgb_camera.color_profile:424x240x6调整 DDS 配置高级在.bashrc中添加export RMW_IMPLEMENTATIONrmw_cyclonedds_cppCycloneDDS对 WiFi 更友好。