ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Time delays when using two high-res cameras

asked 2017-07-20 05:28:49 -0500

samlcharreyron gravatar image

I have an application where I want to use two Basler cameras simultaneously. When I use a single camera, or set the region of interest to be low for both cameras, there is a small time delay associated with sending the image message from the camera node to a listener node (10 ms). When I use both however, there is a significant time delay in the received images (300 ms). I've created a small test node that listens on the image messages for verifying this:

delay_ms = (rospy.Time.now() - msg.header.stamp).to_nsec() / 1e6

Following previous answers, I've tried increasing the buff_size parameter in the subscribers but that doesn't help. I've also tried to increase the TCP window size in linux but that doesn't help either.

I'm wondering where the bottleneck is exactly. Is it in the TCP/IP stack itself or could it be the serialization of the large images that causes latency? How do I check for these?

Additional Info:

  • I'm using the basler_camera package for reading images from the cameras.
  • The computer has 4 cores and 8 GB of RAM

camera 1:

  • 1280x960 RGB
  • 20 MByte/s bw in rostopic

camera 2:

  • 2048x1088 Mono
  • 330 MByte/s bw in rostopic
edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2017-07-24 05:46:06 -0500

samlcharreyron gravatar image

After looking at it further, I realized the problem is not in the TCP/IP stack but rather due to CPU utilization. I noticed that each camera node used 100% of a CPU core and with listeners attached the CPU utilization was maxed out, probably resulting in queuing on the CPU side rather than in the network. Switching to a faster machine solved the problem for me.

edit flag offensive delete link more

Comments

Feel free to accept this as the answer to close out the question

Airuno2L gravatar image Airuno2L  ( 2017-07-24 07:43:12 -0500 )edit
0

answered 2017-07-21 09:24:30 -0500

Airuno2L gravatar image

If the camera node and listener node are on the same computer you can use nodelets instead of nodes to avoid using TCP/IP (they send pointers instead of the actual data).

edit flag offensive delete link more
0

answered 2017-07-22 10:16:28 -0500

NEngelhard gravatar image

There is also the MTU of your interface that has a large influence on the performance. You could also try to use the pylon_camera-driver. We (at Magazino) developed it in cooperation with Basler and use it in several industrial applications and is probably the best ROS driver for Basler currently). It would be great if you could test your setup with this driver.

edit flag offensive delete link more

Comments

If I can get a chance, I will check if the problem is the same with pylon_camera. I moved to basler_pylon because I couldn't find a way to set the image size/height programmatically in pylon_camera.

samlcharreyron gravatar image samlcharreyron  ( 2017-07-24 05:46:01 -0500 )edit

How do you want to set the image size? Do you mean arbitrary scaling?

NEngelhard gravatar image NEngelhard  ( 2017-07-24 18:54:24 -0500 )edit

I mean that I want to set the ROI size and position.

samlcharreyron gravatar image samlcharreyron  ( 2017-07-25 04:53:33 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2017-07-20 05:28:49 -0500

Seen: 1,105 times

Last updated: Jul 24 '17