Performance of nodes that process images

asked 2023-04-17 11:21:42 -0600

pitosalas gravatar image

updated 2023-04-17 11:26:49 -0600

My robot has:

  • ROS1 Notetic Rasberry Pi 4 Raspberry
  • Pi Camera V2 Running raspicam node (https://github.com/UbiquityRobotics/r...)
  • My "remote" computer is running
  • Ubuntu 20.04 on a cluster which is located in my lab
  • They are communicating via Wifi.
  • roscore is running on the robot

The raspicam node is publishing images to it's variety of topics.

I have two nodes on my remote computer, each is processing the images in a different way. One of them is looking for fiducially and one of them is doing some simple image processing with opencv.

Performance is not good. Specifically it seems like the robot itself is not moving smoothly, and there is too much of a delay before the image gets to the remote computer. I have not measured this so this is just a subjective impression.

I hypothesize that the problem is that the image data is big and causing one of a number of problems (or all).

  1. Transmitting it iis too much for the Pi
  2. The wifi is not fast enough
  3. Because there are several nodes on the remote computer that are subscribing to the images, the images are being sent redunantly to the remote computer

I have some ideas on how to try to fix this:

  1. Reduce the image size at the raspicam node
  2. Do some of the imate processing onboard the Pi
  3. Change the image to black and white
  4. Turn off any displays of the image on the remote computer (i.e. rviz and debugging windows)

Any insights on this scenario would be appreciated!

Pito

edit retag flag offensive close merge delete

Comments

Quick comment: as with everything wireless: make sure to first benchmark base wireless throughput/performance (using something like iperf). Compare result to desired transfer rate (ie: image_raw bw). If achieved_bw < desired_bw (or very close to), things will not work (smoothly). Note that desired_bw could be multiple times the bw of a single image_raw subscription, as you write you have multiple subscribers.

In all cases though: transmitting image_raw (or their rectified variants) topics over a limited bw link is not going to work. I'd suggest looking into image_transport and configure a compressed transport. There are lossless plugins available, which would be important if you're looking to use the images for image processing tasks). One example would be swri-robotics/imagezero_transport. It takes some CPU, but reduces bw significantly.

See also #q413068 for a recent discussion about a similar topic.

gvdhoorn gravatar image gvdhoorn  ( 2023-04-18 05:55:55 -0600 )edit