GNU nano 3.2 tello.py
import socket
import threading
import time
from stats import Stats
class Tello:
def __init__(self):
self.local_ip = ''
self.local_port = 8889
self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # socke$
self.socket.bind((self.local_ip, self.local_port))
# thread for receiving cmd ack
self.receive_thread = threading.Thread(target=self._receive_thread)
self.receive_thread.daemon = True
self.receive_thread.start()
# self.tello_ip = '192.168.10.1' #Tello EDUのデフォルトのIPはコメントアウトしておく。
self.tello_ip = '192.168.xx.cc' #ここをTello EDUに振られたIPアドレスにしておく。
self.tello_port = 8889
self.tello_adderss = (self.tello_ip, self.tello_port)
self.log = []
self.MAX_TIME_OUT = 15.0
GNU nano 3.2 command.txt
command
takeoff
delay 5
land
GNU nano 3.2 command2.txt
command
takeoff
delay 2
land
GNU nano 3.2 flight_test.txt
command
takeoff
delay 2
left 20
delay 2
back 20
delay 2
right 20
delay 2
forward 20
delay 2
land
GNU nano 3.2 flight_test2.txt
command
takeoff
delay 2
flip b
delay 2
flip f
delay 2
flip l
delay 2
flip r
delay 2
land
GNU nano 3.2 flight_test3.txt 変更済み
command
takeoff
delay 2
up 50
delay 2
cw 360
delay 2
down 50
delay 2
ccw 360
delay 2
land
pi@raspberrypi:~/Tello-Python/Single_Tello_Test $ python tello_test.py command.txt
(詳細割愛)
pi@raspberrypi:~/Tello-Python/Single_Tello_Test $ python tello_test.py command2.txt
pi@raspberrypi:~/Tello-Python/Single_Tello_Test $ python tello_test.py flight_test.txt
pi@raspberrypi:~/Tello-Python/Single_Tello_Test $ python tello_test.py flight_test2.txt
pi@raspberrypi:~/Tello-Python/Single_Tello_Test $ python tello_test.py flight_test3.txt
pi@raspberrypi:~/Tello-Python/Single_Tello_Test $ python tello_test.py command2.txt
Traceback (most recent call last):
File "tello_test.py", line 13, in <module>
tello = Tello()
File "/home/pi/Tello-Python/Single_Tello_Test/tello.py", line 11, in __init__
self.socket.bind((self.local_ip, self.local_port))
File "/usr/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 98] Address already in use
pi@raspberrypi:~/Tello-Python/Single_Tello_Test $ ps -fA | grep python
pi 685 1 0 5月02 ? 00:00:00 /usr/bin/python3 /usr/share/system-config-printer/applet.py
pi 20201 20030 14 16:33 pts/0 00:00:33 python tello_test.py command2.txt
pi 20259 20030 0 16:36 pts/0 00:00:00 grep --color=auto python
pi@raspberrypi:~/Tello-Python/Single_Tello_Test $ sudo lsof -i:8889
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
python 20201 pi 4u IPv4 469376 0t0 UDP *:8889
pi@raspberrypi:~/Tello-Python/Single_Tello_Test $
pi@raspberrypi:~/Tello-Python/Single_Tello_Test $ kill -9 20201
pi@raspberrypi:~/Tello-Python/Single_Tello_Test $ ps -fA | grep python
pi 685 1 0 5月02 ? 00:00:00 /usr/bin/python3 /usr/share/system-config-printer/applet.py
pi 20268 20030 0 16:38 pts/0 00:00:00 grep --color=auto python
pi@raspberrypi:~/Tello-Python/Single_Tello_Test $
pi@raspberrypi:~/Tello-Python/Single_Tello_Test $ sudo lsof -i:8889
[1]+ 強制終了 python tello_test.py command2.txt
0 件のコメント:
コメントを投稿