Hello everyone,
A few weeks ago I started a project to control two drones on one PC.
After many attempts, I have now managed to establish the connection to the drones with two WLAN antennas and also to start them, etc.
If you want to know more about this, please let me know.
However, my biggest problem at the moment is that I cannot display the video stream of the drones without latency.
I am using an Ubuntu system and the following commands in the terminal:
This way I can separate the stream from the two drones and display each to myself, even though they are both sending their stream to the same port.
I do this in Python:
So now the question, how do I get rid of the latency?
Does anyone have any ideas? The latency is currently at 3-4 seconds. The system still has enough power, so that shouldn't be the reason for it.
My idea would be to switch off the buffer, if it exists at all?
Any ideas welcome
System:
Ubuntu 18.04
python 3.6.9
cv2 4.5
A few weeks ago I started a project to control two drones on one PC.
After many attempts, I have now managed to establish the connection to the drones with two WLAN antennas and also to start them, etc.
If you want to know more about this, please let me know.
However, my biggest problem at the moment is that I cannot display the video stream of the drones without latency.
I am using an Ubuntu system and the following commands in the terminal:
sudo iptables -A INPUT -i wlan0 -p udp --dport 11111 -j ACCEPT
sudo iptables -A INPUT -i wlan0 -p udp --dport 11113 -j ACCEPT
sudo iptables -A PREROUTING -t nat -i wlan0 -p udp --dport 11111 -j REDIRECT --to-port 11113
This way I can separate the stream from the two drones and display each to myself, even though they are both sending their stream to the same port.
I do this in Python:
import cv2
...
cap_1=cv2.VideoCapture("udp://@0.0.0.0:11113")
cap_1.set (cv2.CAP_PROP_BUFFERSIZE,1)
cap_2=cv2.VideoCapture("udp://@0.0.0.0:11111")
cap_2.set (cv2.CAP_PROP_BUFFERSIZE,1)
while True:
ret, frame_1 = cap_1.read()
ret, frame_2 = cap_2.read()
cv2.imshow('frame_1', frame_1)
cv2.imshow('frame_2', frame_2)
if cv2.waitKey(1)&0XFF == ord('q'):
break
So now the question, how do I get rid of the latency?
Does anyone have any ideas? The latency is currently at 3-4 seconds. The system still has enough power, so that shouldn't be the reason for it.
My idea would be to switch off the buffer, if it exists at all?
Any ideas welcome

System:
Ubuntu 18.04
python 3.6.9
cv2 4.5