IntelRealSense / realsense-ros

ROS Wrapper for Intel(R) RealSense(TM) Cameras
http://wiki.ros.org/RealSense
Apache License 2.0
2.43k stars 1.71k forks source link

Lockup Issue When Switching Multiple Streams in RealSense-ROS #3141

Open wataru-okumura opened 1 week ago

wataru-okumura commented 1 week ago

Required Info
Camera Model D435i
Firmware Version 5.12.5
Operating System & Version Linux (Ubuntu 20.04.6LTS)
Kernel Version (Linux Only) 5.15.0-107-generic
Platform PC
Librealsense SDK Version 2.55.1
Language python
Segment Robot
ROS Distro Humble
RealSense ROS Wrapper Version 4.55.1

Issue Description

Thanks again. When I try to switch between multiple streams enable as in the code I gave you (stream.py) There is no response from realsenes-ros and it locks up. Is this a limitation of the device? Is it a software glitch?

By the way, if I send one parameter at a time like stream_one.py, it works fine. stream.zip

terminal1

 ros2 launch realsense2_camera rs_launch.py

terminal2

pyhon stream.py
MartyG-RealSense commented 1 week ago

Hi @wataru-okumura It appears that the key difference between stream.py and stream_one.py is that stream.py (the multiple stream toggle script) is applying rclpy.spin_until_future_complete a single time for all streams, whilst stream_one ply applies it for each individual stream.

I have not seen this particular method used with the RealSense ROS wrapper before. However, given how these stream enable parameters are usually set individually in launch file or launch command, I would expect the same to be the case for rclpy. And stream.py does not seem to be a bad way of implementing it.