realsense-ros
realsense-ros copied to clipboard
ROS2-beta: RGB and depth FPS is lower than configured
launch ROS2 realsense node and echo rgb/depth topic with ros2 topic hz. The report FPS is much lower than configurated FPS
Hi @guoqingzh If you are launching in ros2_beta with rs_launch.py, do you get improved FPS if you launch with ros2 run
ros2 run realsense2_camera realsense2_camera_node
Hi @guoqingzh If you are launching in ros2_beta with rs_launch.py, do you get improved FPS if you launch with ros2 run
ros2 run realsense2_camera realsense2_camera_node
this is the command I used:
ros2 launch realsense2_camera rs_launch.py camera_name:='camera2' serial_no:="'_xxxxxxxxx'" rgb_camera.profile :='1280,720,30'
What is the actual FPS that is being reported?
Also, can you confirm whether the camera is being detected as being on a USB 3 connection. If it was being detected as USB 2.1 (either because the connection was mis-detected or the camera is plugged into a USB 2 port / attached to a USB 2 cable) then the only FPS speed supported for 1280x720 resolution in USB 2.1 mode would be 6 FPS (5 on the RealSense D455 camera model).
What is the actual FPS that is being reported?
Also, can you confirm whether the camera is being detected as being on a USB 3 connection. If it was being detected as USB 2.1 (either because the connection was mis-detected or the camera is plugged into a USB 2 port / attached to a USB 2 cable) then the only FPS speed supported for 1280x720 resolution in USB 2.1 mode would be 6 FPS (5 on the RealSense D455 camera model).
It is USB3. The reported FPG is ~ 23 FPS when configured 30 FPS.
Thank you. And what is the FPS for color when launching with ros2 run realsense2_camera realsense2_camera_node
Thank you. And what is the FPS for color when launching with ros2 run realsense2_camera realsense2_camera_node
it is the same
As you are using camera_name:='camera2' do you have more than one camera enabled at the same time?
I note from the title of this case that you are using both depth and RGB. Does the FPS improve if you disable the RGB option auto_exposure_priority with the instruction below?
ros2 param set /camera/camera rgb_camera.auto_exposure_priority false
As you are using **camera_name:='camera2' ** do you have more than one camera enabled at the same time?
I note from the title of this case that you are using both depth and RGB. Does the FPS improve if you disable the RGB option auto_exposure_priority with the instruction below?
ros2 param set /camera/camera rgb_camera.auto_exposure_priority false
Yes, the idea was to run 4 RS cameras streaming both RGB and depth with difference resolution and FPS. But the FPS drop is reproducible with only 1 RS. I will try the auto_exposure_priority params and let you know the result
@MartyG-RealSense the suggested parameters auto_exposure_priority false doesn't help. For depth, I set it to 30 FPS but only got ~13 FPS. But if I set depth_module.enable_auto_exposure to true , that seems to help (increase from 13 fps to 27 fps but still not 30 fps )
For the disabling of auto_exposure_priority to work, auto_exposure must also be set to true in order for a constant FPS rate to be enforced. So if you have auto_exposure_priority = false and auto_exposure = true and FPS increases from 13 to 27, then the FPS rate enforcement mechanism activated by setting the priority to false may be working correctly. There could be another factor pulling the overall FPS down from 30 to 27 though.
Is 27 fast enough for your particular project if 30 cannot be achieved, or does it need to be as close to 30 as possible?
Hi @guoqingzh Do you have an update about this case that you can provide, please? Thanks!
@MartyG-RealSense we are doing performance testing. We want the FPS to be exactly the value we set with +/- 1 error maximum .
@MartyG-RealSense We have the following findings while testing:
- if we subscribe to the RS topic from another docker container, it seems to have impact on FPS (make it reaching 30FPS) but if we stop the subscription it starts to decreasing
- One the same PC, realsense viewer can streams desired FPS up to 4 cameras simulatenously.
To me, the problem is either in ros2 or realsense_ros2 node
Which versions of the librealsense SDK and ros2_beta wrapper are you using, please? For example, librealsense version 2.51.1 should be matched with ros2_beta wrapper version 4.51.1
Do you see any improvement in performance if you reset the cameras at launch with initial_reset
ros2 launch realsense2_camera rs_launch.py camera_name:='camera2' serial_no:="'_xxxxxxxxx'" rgb_camera.profile :='1280,720,30' initial_reset:=true
I'm also having massive issues with FPS on the ROS2 realsense wrapper.
I have noetic (ROS1) and foxy (ROS2) installed on the same machine. I recorded bags of /camera/color for both ROS1 and ROS2, the ROS1 bags have no issue, framerate is exactly as expected, ROS2 has significant frame drop. I'm using the latest versions of the RealSense wrapper in the ROS apt-get repos for both noetic and foxy. I also tried using the one from the ros2-beta
branch but got worse results.
Hi @dheera Please create a new case for your problem by visiting the link below and clicking the green New Issue button. Thanks!
https://github.com/IntelRealSense/realsense-ros/issues
Hi @guoqingzh. I also had issues with FPS using D455 camera and running depth and RGB streams. The issue is resolved if running in auto exposure mode. There is a bug (probably) that blocks me from setting auto exposure to true when starting the camera node, so what I do is add a delayed action in the launch file to set it a bit later:
TimerAction( period=10.0, actions=[ ExecuteProcess( cmd=[[ 'ros2 param set /camera/camera depth_module.enable_auto_exposure true' ]], shell=True ) ] ),
Hi @guoqingzh. I also had issues with FPS using D455 camera and running depth and RGB streams. The issue is resolved if running in auto exposure mode. There is a bug (probably) that blocks me from setting auto exposure to true when starting the camera node, so what I do is add a delayed action in the launch file to set it a bit later:
TimerAction( period=10.0, actions=[ ExecuteProcess( cmd=[[ 'ros2 param set /camera/camera depth_module.enable_auto_exposure true' ]], shell=True ) ] ),
Yes, Gilad. Alex told me the work around. I am reporting this to librealsense to let them fix the "bug"
Hi @guoqingzh Do you require further assistance with this case, please? Thanks!
see #2507 for more information about this issue.
#2612