RADU: Realsense D435 Installation Troubles with ROS2

First Approach: Installing and Running Ubuntu Packages

SDK and Library Installation

sudo apt-get install ros-$ROS_DISTRO-realsense2-camera
sudo apt-get install ros-$ROS_DISTRO-realsense2-description
[ 9985.717873] usb 1-1.3: new high-speed USB device number 3 using xhci_hcd
[ 9985.822961] usb 1-1.3: New USB device found, idVendor=8086, idProduct=0b07, bcdDevice=50.cd
[ 9985.822978] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 9985.822991] usb 1-1.3: Product: Intel(R) RealSense(TM) Depth Camera 435
[ 9985.823002] usb 1-1.3: Manufacturer: Intel(R) RealSense(TM) Depth Camera 435
[ 9985.826872] uvcvideo: Unknown video format 00000050-0000-0010-8000-00aa00389b71
[ 9985.827127] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435 (8086:0b07)
[ 9985.830442] input: Intel(R) RealSense(TM) Depth Ca as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3:1.0/input/input1
[ 9985.832009] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435 (8086:0b07)

Starting the ROS2 node

ros2 launch realsense2_camera rs_launch.py device_type:=d435
realsense2_camera_node-1]  03/07 11:15:46,387 ERROR [281472753719712] (handle-libusb.h:51) failed to open usb interface: 0, error: RS2_USB_STATUS_ACCESS
[realsense2_camera_node-1] 03/07 11:15:46,387 ERROR [281472994937248] (sensor.cpp:526) acquire_power failed: failed to set power state
[realsense2_camera_node-1] 03/07 11:15:46,388 WARNING [281472994937248] (rs.cpp:306) null pointer passed for argument "device"
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[realsense2_camera_node-1] [INFO] [1625310949.972289490] [rclcpp]: signal_handler(signal_value=2)
$> ros2 topic list
/camera/color/camera_info
/camera/color/image_raw
/camera/depth/camera_info
/camera/depth/color/points
/camera/depth/image_rect_raw
/camera/extrinsics/depth_to_color
/clicked_point
/goal_pose
/initialpose
/parameter_events
/rosout
/tf
/tf_static

Visualization with RViz

[INFO] [1625329665.271601068] [rviz]: Message Filter dropping message: frame 'camera_color_optical_frame' at time 1625329664,860 for reason 'Unknown'
control_transfer returned error, index: 768, error: No data available
ros2 launch realsense2_camera rs_launch.py device_type:=d435 initial_reset:=true --debug
....
[realsense2_camera_node-1] [INFO] [1625385699.954313972] [RealSenseCameraNode]: RealSense ROS v3.2.1
[realsense2_camera_node-1] [INFO] [1625385699.954474877] [RealSenseCameraNode]: Built with LibRealSense v2.45.0
[realsense2_camera_node-1] [INFO] [1625385699.954518413] [RealSenseCameraNode]: Running with LibRealSense v2.45.0

Second Approach: Building, Installing and Running from Source

Librealsense SDK

  • Install build essentials for your Linux system
  • Clone the GitHub repository
  • Run cmake
  • Build and install

ROS2 Realsense Package

  • install the latest Realsense SDK
  • Create a ROS2 package with ros2 pkg create --build-type ament_cmake ros2-realsense
  • Clone the desired ros2-librealsense v3.2.2 into the src folder
  • Configure and compile the sources with colcon build
mkdir -p ~/foxy_ws/src
cd ~/foxy_ws/src/
git clone https://github.com/IntelRealSense/realsense-ros.git
cd realsense-ros/
git checkout tags/3.2.2 #Be sure to use latest tag!
cd ..
colcon build --symlink-install
Starting >>> realsense2_camera_msgs
[1.382s] WARNING:colcon.colcon_core.prefix_path.colcon:The path '/home/ubuntu/realsense-ros/install' in the environment variable COLCON_PREFIX_PATH doesn't exist
[1.382s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/ubuntu/realsense-ros/install/realsense-ros' in the environment variable AMENT_PREFIX_PATH doesn't exist
[1.383s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/ubuntu/realsense-ros/install/realsense-ros' in the environment variable CMAKE_PREFIX_PATH doesn't exist
Finished <<< realsense2_camera_msgs [25.5s]
Starting >>> realsense2_camera
Starting >>> realsense2_description
Finished <<< realsense2_description [4.27s]
[Processing: realsense2_camera]
Finished <<< realsense2_camera [2min 18s]
Summary: 3 packages finished [2min 44s]

Starting the ROS2 node

ros2 launch realsense2_camera rs_launch.py enable_pointcloud:=true device_type:=d435 initial_reset:=true enable_sync:=true --debug[realsense2_camera_node-1] [INFO] [1625394768.207055050] [RealSenseCameraNode]: RealSense ROS v3.2.2
[realsense2_camera_node-1] [INFO] [1625394768.207213882] [RealSenseCameraNode]: Built with LibRealSense v2.45.0
[realsense2_camera_node-1] [INFO] [1625394768.207256325] [RealSenseCameraNode]: Running with LibRealSense v2.48.0
[realsense2_camera_node-1] [WARN] [1625394768.207289788] [RealSenseCameraNode]: ***************************************************
[realsense2_camera_node-1] [WARN] [1625394768.207318417] [RealSenseCameraNode]:** running with a different librealsense version **
[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.process.ProcessStderr'
[DEBUG] [launch]: processing event: '<launch.events.process.process_stderr.ProcessStderr object at 0xffffa8320a60>'
[DEBUG] [launch]: processing event: '<launch.events.process.process_stderr.ProcessStderr object at 0xffffa8320a60>' ✓ '<launch.event_handlers.on_process_io.OnProcessIO object at 0xffffa8320e20>'
[realsense2_camera_node-1] [WARN] [1625394768.207345676] [RealSenseCameraNode]:** than the one the wrapper was compiled with! **
[realsense2_camera_node-1] [WARN] [1625394768.207373546] [RealSenseCameraNode]: ***************************************************
ros2 launch realsense2_camera rs_launch.py device_type:=d435 initial_reset:=true --debug[160431.153805] usb 2-1: new SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[160431.174617] usb 2-1: New USB device found, idVendor=8086, idProduct=0b07, bcdDevice=50.cd
[160431.174622] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[160431.174625] usb 2-1: Product: Intel(R) RealSense(TM) Depth Camera 435
[160431.174628] usb 2-1: Manufacturer: Intel(R) RealSense(TM) Depth Camera 435
[160431.174630] usb 2-1: SerialNumber: 020223022670
[160431.180002] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435 (8086:0b07)
[160431.181574] uvcvideo 2-1:1.0: Entity type for entity Intel(R) RealSense(TM) Depth Ca was not initialized!
[160431.181579] uvcvideo 2-1:1.0: Entity type for entity Processing 2 was not initialized!
[160431.181581] uvcvideo 2-1:1.0: Entity type for entity Camera 1 was not initialized!
[160431.181779] input: Intel(R) RealSense(TM) Depth Ca as /devices/pci0000:00/0000:00:15.0/usb2/2-1/2-1:1.0/input/input33
[160431.182552] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435 (8086:0b07)
[160431.183971] uvcvideo 2-1:1.3: Entity type for entity Processing 7 was not initialized!
[160431.183974] uvcvideo 2-1:1.3: Entity type for entity Extension 8 was not initialized!
[160431.183977] uvcvideo 2-1:1.3: Entity type for entity Camera 6 was not initialized!
devcon@giga:/home/work/development/core$ ros2 node info /camera/camera
/camera/camera
Subscribers:
/parameter_events: rcl_interfaces/msg/ParameterEvent
Publishers:
/camera/color/camera_info: sensor_msgs/msg/CameraInfo
/camera/color/image_raw: sensor_msgs/msg/Image
/camera/depth/camera_info: sensor_msgs/msg/CameraInfo
/camera/depth/color/points: sensor_msgs/msg/PointCloud2
/camera/depth/image_rect_raw: sensor_msgs/msg/Image

Visualization with Rviz

Message Filter dropping message: frame 'camera_color_optical_frame'

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sebastian

Sebastian

IT Project Manager & Developer