realsense-ros: Major performance problem with align_depth option

Hello, I am using a realsense d435i on a raspberry pi 4, with the intended use case streaming back to a nearby computer to run mapping and object detection.

I am seeing very, very poor performance with the align_depth option. Initially, I thought I had network issues, but I’ve reproduced the performance solely on the raspberry pi 4 (so I’ve eliminated network issues as a cause).

When I look at rostopic hz /camera/depth/image_rect_raw on the rpi4, I see ~15 images per second. When I look at rostopic hz /camera/color/image_raw on the rpi4, I also see ~15 images per second. However, when I look at rostopic hz /camera/aligned_depth_to_color/image_raw on the rpi4, I only see ~1.2 images per second. Clearly, the aligned topic has much lower performance. Looking at the system metrics, I have 7.3G of memory free and I’m using about 250% of the 400% total CPUs available.

What can I do to get aligned images so that I can use RTabMap, but without the major performance loss? Is the aligning something that happens on the host CPU and not on the realsense hardware? If so, are there build flags I should use to ensure I get reasonable performance [1]?

Thank you for your help.

[1] This seems strange, because I do not see the CPUs even close to full utilization.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 28 (6 by maintainers)

Most upvoted comments

I checked out rs-align, and whether I select “align to depth” or “align to color”, it is snappy enough (definitely in the 10+ FPS range, never in the 1 FPS range). It is noticeably slower when I have “align to color” selected, but it’s like ~20 fps with “align to depth” vs ~10fps with “align to color”. I used htop to watch the CPU usage, and I see that the rs-align process consistently uses around 185%cpu, which should be fine (this device has 4 cpus).

p.s. Sorry it took me so long to reply–I forgot to enable notifications. I’ll be able to respond more quickly going forward.