asrob-uc3m / robotDevastation-playground

Robot Devastation playground.
http://asrob-uc3m.github.io/workgroups/2017-05-28-robot-devastation.html
1 stars 0 forks source link

Decrease video transmission latency #13

Closed jgvictores closed 5 years ago

jgvictores commented 6 years ago

From @Rodriwp on April 7, 2016 12:52

In order to decrease latency, test if this modules are better than the current ones

Copied from original issue: asrob-uc3m/robotDevastation-robots#9

jgvictores commented 6 years ago

From @David-Estevez on April 7, 2016 15:30

ESP8266 modules aren't USB WiFi dongles, but bridges between USARTs and TCP/UDP sockets on the PC side. Therefore, I doubt that they can be used to stream images from the raspberry pi (and if they can, it's probably through a even slower connection).

To reduce latency (if that is the issue), two approaches can be followed:

  1. Upgrade cheap WiFi dongle with a higher quality (Bandwidth) one. I can lend you one ASUS N11 dongle I have at home for testing.
  2. Try to view a mjpeg stream directly using mjpg-streamer on the raspberry pi. If using only mjpg-streamer the video doesn't have any latency, this latency might be introduced by the image processing done on the PC (not related to WiFi hardware).

I think is better to create a new issue in robotDevastation repo to deal with the latency issue.

jgvictores commented 6 years ago

Option 2 involves invoking mjpg_streamer on the raspi, as in: mjpg_streamer -i "input_uvc.so -f 15 -d /dev/video0 -y" -o "output_http.so -p 8080" It's good because we'd drop some wrapping processes involved in using opencv and yarp on the raspi side. We could then hook the stream on the robotDevastation (PC client) side as we did in https://github.com/robotology/yarp/issues/254 (with a Darwin-op robot using mjpg_streamer: https://sourceforge.net/projects/mjpg-streamer/).

jgvictores commented 6 years ago

From @David-Estevez on April 7, 2016 15:55

Another possible related software improvement could be print the received images before further processing (to have a higher update rate) and process only a few frames (use tracking to interpolate enemies between frames).

jgvictores commented 6 years ago

Ok to change the topic to Decrease video transmission latency?

jgvictores commented 6 years ago

From @Rodriwp on April 10, 2016 9:17

RaspiMjpeg seems to solve the problem. https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=61771 Next sesion I will test it

jgvictores commented 6 years ago

From @David-Estevez on April 23, 2016 14:7

Some new points:

  1. Last wednesday we tested the wifi connection and it was ok between two PCs on the same LAN, so the problem must be related to the robot. Next thing to try is changing the wifi dongle by a faster one, to check if high latency is related to wifi dongle bandwidth.
  2. Related to use the ESP8266 as wifi dongle, I have found the following resources:

    It is a difficult issue, and I'm not sure that this solution is faster that the current chinese wifi dongle.

jgvictores commented 6 years ago

From @Rodriwp on November 9, 2016 16:55

The next test we need to perform is with RD2 Black and @David-Estevez expensive wifi module. So, we can discard that our chinese hardward is the problem

jgvictores commented 6 years ago

From @Rodriwp on November 23, 2016 14:33

@David-Estevez and @jgvictores Did you realize if RD ambassador decrease transmission latency ?

jgvictores commented 6 years ago

Yesteday at https://github.com/asrob-uc3m/actas/issues/36 latency was surprisingly low on both old Raspi1 (RD2) and new Raspi2 (RD Ambassator) platforms.

It would be great if you could stay focused on #4 for the time being.

jgvictores commented 6 years ago

Just for the record, I've read one of the greatest improvements on Raspberry 3 B+ is on comms, note the 2.4GHz and 5GHz IEEE 802.11.b/g/n/ac wireless LAN spec: https://www.raspberrypi.org/products/raspberry-pi-3-model-b-plus/

jgvictores commented 5 years ago

The assumption is that the bottleneck is the actual wifi (in fact via cable connection all is good), so no use to get rid of YARP opencv_grabber device yet. Cleanup on Raspi recommendation at https://github.com/asrob-uc3m/robotDevastation-playground/commit/13c6de57743b73ab751bbc0ee5530da21e6d6840

jgvictores commented 5 years ago

Tested with a Raspi 3B+ via wifi (not sure which of the two wireless interfaces), using phone as router, flash at 27.5 is shown at 28.3, which makes a 0.8 second latency.