I feel like I missed the times, but I tried a formation flight with tello. Many people are doing it, but I haven't seen many people who have done it in Python, so I will summarize it for myself.
Thank you very much for the following articles / sites. Thank you very much. Connect to wifi access point using Tello Edu as a slave unit [python] Challenge formation flight with DJI's educational toy drone TELLO EDU (2)
I referred to Connecting to wifi access point using Tello Edu as a slave unit [python] presented in the previous section. Please see here as well.
I may be the only one, but I have a little understanding of ip and I got stuck here. I was wondering if I should just throw the command at 192.168.10.1, but it wasn't.
First, make the tello connect to a hotspot on your PC. Then The IP address will be displayed like this, so let's check it. You can find it by pressing the win key and checking with Mobile Hotspot.
import socket
import time
drone1 = '192.168.137.125'
drone2 = '192.168.137.17'
tello_port = 8889
#udp socket
socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
drone1_address = (drone1 , tello_port)
drone2_address = (drone2 , tello_port)
#Enter command mode
socket.sendto('command'.encode('utf-8'),drone1_address)
socket.sendto('command'.encode('utf-8'),drone2_address)
time.sleep(3)
#take off
socket.sendto('takeoff'.encode('utf-8'),drone1_address)
socket.sendto('takeoff'.encode('utf-8'),drone2_address)
time.sleep(0.1)
#landing
socket.sendto('land'.encode('utf-8'),drone1_address)
socket.sendto('land'.encode('utf-8'),drone2_address)
It settles in a very simple shape. This will accommodate any number of drones. As a caveat, as I mentioned earlier, I think that the ip of the drone is different (I'm sorry if it is different), so please check it yourself. Please. The challenge is that as the number of drones increases, the code gets messy. As a future issue, would it be cool if it could be broadcast? ?? I'm thinking.
Recommended Posts