pyaidrone 1.2__py3-none-any.whl → 1.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyaidrone might be problematic. Click here for more details.
- pyaidrone/aiDrone.py +9 -2
- pyaidrone/ikeyevent.py +10 -2
- pyaidrone/parse.py +2 -1
- {pyaidrone-1.2.dist-info → pyaidrone-1.4.dist-info}/METADATA +1 -1
- pyaidrone-1.4.dist-info/RECORD +10 -0
- pyaidrone-1.2.dist-info/RECORD +0 -10
- {pyaidrone-1.2.dist-info → pyaidrone-1.4.dist-info}/WHEEL +0 -0
- {pyaidrone-1.2.dist-info → pyaidrone-1.4.dist-info}/top_level.txt +0 -0
pyaidrone/aiDrone.py
CHANGED
|
@@ -22,6 +22,8 @@ class AIDrone(Parse, Packet):
|
|
|
22
22
|
self.posX = 0
|
|
23
23
|
self.posY = 0
|
|
24
24
|
self.rot = 0
|
|
25
|
+
|
|
26
|
+
|
|
25
27
|
|
|
26
28
|
def receiveHandler(self):
|
|
27
29
|
while self.isThreadRun:
|
|
@@ -32,7 +34,7 @@ class AIDrone(Parse, Packet):
|
|
|
32
34
|
self.receiveCallback(packet)
|
|
33
35
|
self.serial.write(self.makepkt.getPacket())
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
|
|
36
38
|
def Open(self, portName = "None"):
|
|
37
39
|
if eq(portName, "None"):
|
|
38
40
|
nodes = comports()
|
|
@@ -132,11 +134,12 @@ class AIDrone(Parse, Packet):
|
|
|
132
134
|
|
|
133
135
|
|
|
134
136
|
def rotation(self, rot=90):
|
|
135
|
-
self.rot += rot
|
|
137
|
+
self.rot += rot
|
|
136
138
|
data = self.rot.to_bytes(2, byteorder="little", signed=True)
|
|
137
139
|
self.makepkt.makePacket(10, data)
|
|
138
140
|
|
|
139
141
|
|
|
142
|
+
|
|
140
143
|
def motor(self, what, speed):
|
|
141
144
|
speed = DefLib.constrain(speed, 100, 0)
|
|
142
145
|
data = speed.to_bytes(2, byteorder="little", signed=True)
|
|
@@ -148,4 +151,8 @@ class AIDrone(Parse, Packet):
|
|
|
148
151
|
self.setOption(0x00)
|
|
149
152
|
self.serial.write(self.makepkt.getPacket())
|
|
150
153
|
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
151
158
|
|
pyaidrone/ikeyevent.py
CHANGED
|
@@ -22,8 +22,10 @@ class IKeyEvent:
|
|
|
22
22
|
self.keyLTurn = True
|
|
23
23
|
if key == keyboard.KeyCode(char="d"):
|
|
24
24
|
self.keyRTurn = True
|
|
25
|
+
if key == keyboard.KeyCode(char="k"):
|
|
26
|
+
self.keyRTurn = True
|
|
25
27
|
if key == keyboard.Key.esc:
|
|
26
|
-
|
|
28
|
+
self.keyEsc = True
|
|
27
29
|
|
|
28
30
|
def on_release(self, key):
|
|
29
31
|
if key == keyboard.Key.enter:
|
|
@@ -46,8 +48,10 @@ class IKeyEvent:
|
|
|
46
48
|
self.keyLTurn = False
|
|
47
49
|
if key == keyboard.KeyCode(char="d"):
|
|
48
50
|
self.keyRTurn = False
|
|
51
|
+
if key == keyboard.KeyCode(char="v"):
|
|
52
|
+
self.keyRTurn = False
|
|
49
53
|
if key == keyboard.Key.esc:
|
|
50
|
-
|
|
54
|
+
self.keyEsc = False
|
|
51
55
|
|
|
52
56
|
def __init__(self):
|
|
53
57
|
self.keyEnter = False
|
|
@@ -60,6 +64,7 @@ class IKeyEvent:
|
|
|
60
64
|
self.keyGoDown = False
|
|
61
65
|
self.keyLTurn= False
|
|
62
66
|
self.keyRTurn = False
|
|
67
|
+
self.keyVideo = False
|
|
63
68
|
self.keyEsc = False
|
|
64
69
|
|
|
65
70
|
listener = keyboard.Listener(on_press=self.on_press, on_release=self.on_release)
|
|
@@ -95,5 +100,8 @@ class IKeyEvent:
|
|
|
95
100
|
def isKeyDPressed(self):
|
|
96
101
|
return self.keyRTurn
|
|
97
102
|
|
|
103
|
+
def isKeyVPressed(self):
|
|
104
|
+
return self.keyVideo
|
|
105
|
+
|
|
98
106
|
def isKeyEscPressed(self):
|
|
99
107
|
return self.keyEsc
|
pyaidrone/parse.py
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
pyaidrone/__init__.py,sha256=LTT-ZpL6vrKdC5t0O71pJnk3zMhDf1eXkNmoLoIRupo,19
|
|
2
|
+
pyaidrone/aiDrone.py,sha256=ImV07TKaoOHKFAlxor4SHxs75MJMlAxqOumuYlosWl4,4778
|
|
3
|
+
pyaidrone/deflib.py,sha256=ZeA_qfnhuXEIhJHUMNSKkCkBEaWuoIS5X7ZqjTo9Sx4,735
|
|
4
|
+
pyaidrone/ikeyevent.py,sha256=5lqZFA_Wg4ntS8JF8bwHEJwPEoq1mEtR8Cwb8kJSivo,3124
|
|
5
|
+
pyaidrone/packet.py,sha256=h02k9dMUhP4oyEBaDuJ9L9HdutfZE_znreBmPOfTLog,813
|
|
6
|
+
pyaidrone/parse.py,sha256=oSG4n3tTJmh7fyNyIOLf9IgQTcpxB2CH8Sfw9RcuHZM,1430
|
|
7
|
+
pyaidrone-1.4.dist-info/METADATA,sha256=xnOCN4zhLBgY75BUSkCuzFc2EIUx345ayU1cEPCO8uk,593
|
|
8
|
+
pyaidrone-1.4.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
9
|
+
pyaidrone-1.4.dist-info/top_level.txt,sha256=YLnJwG3F2TdfFcg6r7jcx02fekcXHF_GC0nv12hJGT8,10
|
|
10
|
+
pyaidrone-1.4.dist-info/RECORD,,
|
pyaidrone-1.2.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
pyaidrone/__init__.py,sha256=LTT-ZpL6vrKdC5t0O71pJnk3zMhDf1eXkNmoLoIRupo,19
|
|
2
|
-
pyaidrone/aiDrone.py,sha256=OawlhlEHgG3wRjkb54p9OBceX2D-BimvVGjdUiwABNg,4713
|
|
3
|
-
pyaidrone/deflib.py,sha256=ZeA_qfnhuXEIhJHUMNSKkCkBEaWuoIS5X7ZqjTo9Sx4,735
|
|
4
|
-
pyaidrone/ikeyevent.py,sha256=ZpRiFu71GhW2XQgyiXzCvb2FYoLU8bH4fVeaKoGEMqM,2866
|
|
5
|
-
pyaidrone/packet.py,sha256=h02k9dMUhP4oyEBaDuJ9L9HdutfZE_znreBmPOfTLog,813
|
|
6
|
-
pyaidrone/parse.py,sha256=5kU1JwQwUXTJ201ewRnnzpwDyZ0jjstHNTKQvku9svA,1364
|
|
7
|
-
pyaidrone-1.2.dist-info/METADATA,sha256=8l1JfRPvK4--eqNNj-zYoxj9VAuYKLtRUSVGUTxFfUU,593
|
|
8
|
-
pyaidrone-1.2.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
9
|
-
pyaidrone-1.2.dist-info/top_level.txt,sha256=YLnJwG3F2TdfFcg6r7jcx02fekcXHF_GC0nv12hJGT8,10
|
|
10
|
-
pyaidrone-1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|