osrf / ovc

the Open Vision Computer
Apache License 2.0
198 stars 42 forks source link

Throttled image rate using ROS #37

Closed augustebleu closed 3 years ago

augustebleu commented 3 years ago

Hello,

I recently cloned the OVC3b module with great success. However, when I connect the module to my laptop with USB-C, the image rate is lower than what I get on the OVC (15-20Hz instead of 33Hz). Have you ever experienced such a result? I would like to avoid compressing the image to avoid additional latency.

I really appreciate the effort put into this project. Thank you !

luca-della-vedova commented 3 years ago

Hi!

First of all how many cameras are you trying to subscribe to in parallel? You might reach bandwidth issues if you are running a lot of those and your USB is not fast enough. We had some issues of laptops USB controllers not being fast enough, can you run: iperf3 -s on your laptop and iperf3 -c <your_laptop_ip> on the OVC and report the results? Ideally you should get something in the 2.7-3.2Gbps range but I have seen laptops go as low as 1.6Gbps. This is the maximum bandwidth that you have over USB and you can use it together with the image size and frame rate to see if you are being bandwidth limited or not.

augustebleu commented 3 years ago

Luca, thank you so much for your help.

First of all how many cameras are you trying to subscribe to in parallel? You might reach bandwidth issues if you are running a lot of those and your USB is not fast enough.

The three cameras and the IMU work simultaneously. But on the laptop side, I only tried to subscribe to one camera.

Here is the result of the command line on laptop side:

-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 10.0.1.1, port 43302
[  5] local 10.0.1.2 port 5201 connected to 10.0.1.1 port 43304
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-1.00   sec  43.3 MBytes   364 Mbits/sec                  
[  5]   1.00-2.00   sec  45.4 MBytes   381 Mbits/sec                  
[  5]   2.00-3.00   sec  45.5 MBytes   382 Mbits/sec                  
[  5]   3.00-4.00   sec  45.1 MBytes   378 Mbits/sec                  
[  5]   4.00-5.00   sec  45.5 MBytes   382 Mbits/sec                  
[  5]   5.00-6.00   sec  45.5 MBytes   382 Mbits/sec                  
[  5]   6.00-7.00   sec  45.1 MBytes   378 Mbits/sec                  
[  5]   7.00-8.00   sec  45.5 MBytes   382 Mbits/sec                  
[  5]   8.00-9.00   sec  45.5 MBytes   382 Mbits/sec                  
[  5]   9.00-10.00  sec  45.0 MBytes   378 Mbits/sec                  
[  5]  10.00-10.04  sec  2.03 MBytes   380 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-10.04  sec  0.00 Bytes  0.00 bits/sec                  sender
[  5]   0.00-10.04  sec   453 MBytes   379 Mbits/sec                  receiver

You just pointed out the right problem I guess. The bandwidth result is much lower than what you mentioned.

I'm currently using a USB-C to USB-C cable, I'll try on a different hardware with various cables. I will keep you informed of the result.

luca-della-vedova commented 3 years ago

Hi!

You are running at USB2 speed, I think the issue is that you might be using one of those cables that is designed for charging devices and doesn't actually have all the USB3 signal wires (this is usually done to cut costs). Try to find a cable that is certified for USB3 and you should be good to go!

On Wed, Mar 17, 2021, 6:08 PM augustebleu @.***> wrote:

Luca, thank you so much for your help.

First of all how many cameras are you trying to subscribe to in parallel? You might reach bandwidth issues if you are running a lot of those and your USB is not fast enough.

The three cameras and the IMU work simultaneously. But on the laptop side, I only tried to subscribe to one camera.

Here is the result of the command line on laptop side:


Server listening on 5201

Accepted connection from 10.0.1.1, port 43302 [ 5] local 10.0.1.2 port 5201 connected to 10.0.1.1 port 43304 [ ID] Interval Transfer Bandwidth [ 5] 0.00-1.00 sec 43.3 MBytes 364 Mbits/sec [ 5] 1.00-2.00 sec 45.4 MBytes 381 Mbits/sec [ 5] 2.00-3.00 sec 45.5 MBytes 382 Mbits/sec [ 5] 3.00-4.00 sec 45.1 MBytes 378 Mbits/sec [ 5] 4.00-5.00 sec 45.5 MBytes 382 Mbits/sec [ 5] 5.00-6.00 sec 45.5 MBytes 382 Mbits/sec [ 5] 6.00-7.00 sec 45.1 MBytes 378 Mbits/sec [ 5] 7.00-8.00 sec 45.5 MBytes 382 Mbits/sec [ 5] 8.00-9.00 sec 45.5 MBytes 382 Mbits/sec [ 5] 9.00-10.00 sec 45.0 MBytes 378 Mbits/sec [ 5] 10.00-10.04 sec 2.03 MBytes 380 Mbits/sec


[ ID] Interval Transfer Bandwidth [ 5] 0.00-10.04 sec 0.00 Bytes 0.00 bits/sec sender [ 5] 0.00-10.04 sec 453 MBytes 379 Mbits/sec receiver

You just pointed out the right problem I guess. The bandwidth result is much lower than what you mentioned.

I'm currently using a USB-C to USB-C cable, I'll try on a different hardware with various cables. I will keep you informed of the result.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/osrf/ovc/issues/37#issuecomment-800958567, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFQQBWPU5HVREMYRRXJ26DTEB5QZANCNFSM4ZKEUFWA .

augustebleu commented 3 years ago

By trying with a brand new USB3.0 cable, on another computer, the problem is now solved!