codrone-edu 2.10__tar.gz → 2.11__tar.gz

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.
Files changed (36) hide show
  1. {codrone_edu-2.10 → codrone_edu-2.11}/PKG-INFO +1 -1
  2. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/drone.py +19 -19
  3. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/system.py +13 -3
  4. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/tools/update.py +1 -1
  5. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu.egg-info/PKG-INFO +1 -1
  6. {codrone_edu-2.10 → codrone_edu-2.11}/setup.py +1 -1
  7. {codrone_edu-2.10 → codrone_edu-2.11}/MANIFEST.in +0 -0
  8. {codrone_edu-2.10 → codrone_edu-2.11}/README.md +0 -0
  9. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/__init__.py +0 -0
  10. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/__main__.py +0 -0
  11. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/crc.py +0 -0
  12. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/data/black.txt +0 -0
  13. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/data/blue.txt +0 -0
  14. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/data/green.txt +0 -0
  15. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/data/lightblue.txt +0 -0
  16. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/data/purple.txt +0 -0
  17. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/data/red.txt +0 -0
  18. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/data/white.txt +0 -0
  19. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/data/yellow.txt +0 -0
  20. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/errors.py +0 -0
  21. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/protocol.py +0 -0
  22. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/receiver.py +0 -0
  23. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/storage.py +0 -0
  24. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/swarm.py +0 -0
  25. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/tools/__init__.py +0 -0
  26. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/tools/interrupter.py +0 -0
  27. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/tools/module_loader.py +0 -0
  28. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/tools/parser.py +0 -0
  29. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/tools/scrubber.py +0 -0
  30. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu/tools/transformer.py +0 -0
  31. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu.egg-info/SOURCES.txt +0 -0
  32. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu.egg-info/dependency_links.txt +0 -0
  33. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu.egg-info/not-zip-safe +0 -0
  34. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu.egg-info/requires.txt +0 -0
  35. {codrone_edu-2.10 → codrone_edu-2.11}/codrone_edu.egg-info/top_level.txt +0 -0
  36. {codrone_edu-2.10 → codrone_edu-2.11}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codrone_edu
3
- Version: 2.10
3
+ Version: 2.11
4
4
  Summary: Python CoDrone EDU library
5
5
  Home-page:
6
6
  Author:
@@ -1286,7 +1286,7 @@ class Drone:
1286
1286
  speed_level = 1
1287
1287
 
1288
1288
  self.sendCommand(CommandType.ControlSpeed, int(speed_level))
1289
- if self.information_data[1] == ModelNumber.Drone_12_Drone_P1:
1289
+ if is_jrotc_drone(self.information_data[1]):
1290
1290
  time.sleep(0.03)
1291
1291
  else:
1292
1292
  time.sleep(0.01)
@@ -2277,7 +2277,7 @@ class Drone:
2277
2277
  if state_flight is ModeFlight.Ready:
2278
2278
  device_info = self.get_information_data()
2279
2279
 
2280
- if self.information_data[1] == ModelNumber.Drone_12_Drone_P1:
2280
+ if is_jrotc_drone(self.information_data[1]):
2281
2281
  print(Fore.GREEN + "Connected to CoDrone EDU (JROTC ed.)." + Style.RESET_ALL)
2282
2282
  else:
2283
2283
  print(Fore.GREEN + "Connected to CoDrone EDU." + Style.RESET_ALL)
@@ -2363,7 +2363,7 @@ class Drone:
2363
2363
  if state_flight is ModeFlight.Ready:
2364
2364
  device_info = await self.get_information_data()
2365
2365
 
2366
- if self.information_data[1] == ModelNumber.Drone_12_Drone_P1:
2366
+ if is_jrotc_drone(self.information_data[1]):
2367
2367
  print(Fore.GREEN + "Connected to CoDrone EDU (JROTC ed.)." + Style.RESET_ALL)
2368
2368
  else:
2369
2369
  print(Fore.GREEN + "Connected to CoDrone EDU." + Style.RESET_ALL)
@@ -2412,7 +2412,7 @@ class Drone:
2412
2412
 
2413
2413
  device_info = await self.get_information_data()
2414
2414
 
2415
- if device_info[0] == ModelNumber.Drone_12_Drone_P1:
2415
+ if is_jrotc_drone(device_info[1]):
2416
2416
  print("Connected to CoDrone EDU (JROTC ed.).", color="green")
2417
2417
  else:
2418
2418
  print("Connected to CoDrone EDU.", color="green")
@@ -4070,7 +4070,7 @@ class Drone:
4070
4070
  # store current position and z_angle
4071
4071
  pos_data = None
4072
4072
  z_angle = None # angle offset between G_new and L
4073
- if self.information_data[1] == ModelNumber.Drone_12_Drone_P1:
4073
+ if is_jrotc_drone(self.information_data[1]):
4074
4074
  for _ in range(3):
4075
4075
  pos_data = self.get_position_data()
4076
4076
  z_angle = self.get_angle_z()
@@ -4205,7 +4205,7 @@ class Drone:
4205
4205
  # store current position and z_angle
4206
4206
  pos_data = None
4207
4207
  z_angle = None # angle offset between G_new and L
4208
- if self.information_data[1] == ModelNumber.Drone_12_Drone_P1:
4208
+ if is_jrotc_drone(self.information_data[1]):
4209
4209
  for _ in range(3):
4210
4210
  pos_data = await self.get_position_data()
4211
4211
  z_angle = await self.get_angle_z()
@@ -7374,7 +7374,7 @@ class Drone:
7374
7374
  return image
7375
7375
 
7376
7376
  async def _controller_create_canvas_emscripten(self, color="white"):
7377
- if (await self.get_information_data())[0] == ModelNumber.Drone_12_Drone_P1:
7377
+ if is_jrotc_drone((await self.get_information_data())[1]):
7378
7378
  warnings.warn(
7379
7379
  "This function is not currently supported for CoDrone EDU (JROTC ed.).",
7380
7380
  RuntimeWarning,
@@ -7487,7 +7487,7 @@ class Drone:
7487
7487
  raise InvalidDrawColorError("Invalid color. Color value must be 'white' or 'black'")
7488
7488
 
7489
7489
  async def _controller_draw_line_emscripten(self, x1, y1, x2, y2, image, color, pixel_width):
7490
- if (await self.get_information_data())[0] == ModelNumber.Drone_12_Drone_P1:
7490
+ if is_jrotc_drone((await self.get_information_data())[1]):
7491
7491
  warnings.warn(
7492
7492
  "This function is not currently supported for CoDrone EDU (JROTC ed.).",
7493
7493
  RuntimeWarning,
@@ -7545,7 +7545,7 @@ class Drone:
7545
7545
  raise InvalidDrawColorError("Invalid color. Color value must be 'white' or 'black'")
7546
7546
 
7547
7547
  async def _controller_draw_rectangle_emscripten(self, x, y, width, height, image, color, fill_in, pixel_width):
7548
- if (await self.get_information_data())[0] == ModelNumber.Drone_12_Drone_P1:
7548
+ if is_jrotc_drone((await self.get_information_data())[1]):
7549
7549
  warnings.warn(
7550
7550
  "This function is not currently supported for CoDrone EDU (JROTC ed.).",
7551
7551
  RuntimeWarning,
@@ -7603,7 +7603,7 @@ class Drone:
7603
7603
  raise InvalidDrawColorError("Invalid color. Color value must be 'white' or 'black'")
7604
7604
 
7605
7605
  async def _controller_draw_square_emscripten(self, x, y, width, image, color, fill_in, pixel_width):
7606
- if (await self.get_information_data())[0] == ModelNumber.Drone_12_Drone_P1:
7606
+ if is_jrotc_drone((await self.get_information_data())[1]):
7607
7607
  warnings.warn(
7608
7608
  "This function is not currently supported for CoDrone EDU (JROTC ed.).",
7609
7609
  RuntimeWarning,
@@ -7651,7 +7651,7 @@ class Drone:
7651
7651
  raise InvalidDrawColorError("Invalid color. Color value must be 'white' or 'black'")
7652
7652
 
7653
7653
  async def _controller_draw_point_emscripten(self, x, y, image, color):
7654
- if (await self.get_information_data())[0] == ModelNumber.Drone_12_Drone_P1:
7654
+ if is_jrotc_drone((await self.get_information_data())[1]):
7655
7655
  warnings.warn(
7656
7656
  "This function is not currently supported for CoDrone EDU (JROTC ed.).",
7657
7657
  RuntimeWarning,
@@ -7683,7 +7683,7 @@ class Drone:
7683
7683
  self.sendDisplayClearAll(pixel)
7684
7684
 
7685
7685
  async def _controller_clear_screen_emscripten(self, pixel=DisplayPixel.White):
7686
- if (await self.get_information_data())[0] == ModelNumber.Drone_12_Drone_P1:
7686
+ if is_jrotc_drone((await self.get_information_data())[1]):
7687
7687
  warnings.warn(
7688
7688
  "This function is not currently supported for CoDrone EDU (JROTC ed.).",
7689
7689
  RuntimeWarning,
@@ -7738,7 +7738,7 @@ class Drone:
7738
7738
 
7739
7739
 
7740
7740
  async def _controller_draw_polygon_emscripten(self, point_list, image, color, fill_in, pixel_width):
7741
- if (await self.get_information_data())[0] == ModelNumber.Drone_12_Drone_P1:
7741
+ if is_jrotc_drone((await self.get_information_data())[1]):
7742
7742
  warnings.warn(
7743
7743
  "This function is not currently supported for CoDrone EDU (JROTC ed.).",
7744
7744
  RuntimeWarning,
@@ -7805,7 +7805,7 @@ class Drone:
7805
7805
  raise InvalidDrawColorError("Invalid color. Color value must be 'white' or 'black'")
7806
7806
 
7807
7807
  async def _controller_draw_ellipse_emscripten(self, ellipse_list, image, color, fill_in=None, pixel_width=1):
7808
- if (await self.get_information_data())[0] == ModelNumber.Drone_12_Drone_P1:
7808
+ if is_jrotc_drone((await self.get_information_data())[1]):
7809
7809
  warnings.warn(
7810
7810
  "This function is not currently supported for CoDrone EDU (JROTC ed.).",
7811
7811
  RuntimeWarning,
@@ -7870,7 +7870,7 @@ class Drone:
7870
7870
  raise InvalidDrawColorError("Invalid color. Color value must be 'white' or 'black'")
7871
7871
 
7872
7872
  async def _controller_draw_arc_emscripten(self, arc_list, start_angle, end_angle, image, color, pixel_width):
7873
- if (await self.get_information_data())[0] == ModelNumber.Drone_12_Drone_P1:
7873
+ if is_jrotc_drone((await self.get_information_data())[1]):
7874
7874
  warnings.warn(
7875
7875
  "This function is not currently supported for CoDrone EDU (JROTC ed.).",
7876
7876
  RuntimeWarning,
@@ -7936,7 +7936,7 @@ class Drone:
7936
7936
  raise InvalidDrawColorError("Invalid color. Color value must be 'white' or 'black'")
7937
7937
 
7938
7938
  async def _controller_draw_chord_emscripten(self, chord_list, start_angle, end_angle, image, color, fill_in, pixel_width):
7939
- if (await self.get_information_data())[0] == ModelNumber.Drone_12_Drone_P1:
7939
+ if is_jrotc_drone((await self.get_information_data())[1]):
7940
7940
  warnings.warn(
7941
7941
  "This function is not currently supported for CoDrone EDU (JROTC ed.).",
7942
7942
  RuntimeWarning,
@@ -7992,7 +7992,7 @@ class Drone:
7992
7992
  raise InvalidDrawColorError("Invalid color. Color value must be 'white' or 'black'")
7993
7993
 
7994
7994
  async def _controller_draw_string_emscripten(self, x, y, string, image, color):
7995
- if (await self.get_information_data())[0] == ModelNumber.Drone_12_Drone_P1:
7995
+ if is_jrotc_drone((await self.get_information_data())[1]):
7996
7996
  warnings.warn(
7997
7997
  "This function is not currently supported for CoDrone EDU (JROTC ed.).",
7998
7998
  RuntimeWarning,
@@ -8066,7 +8066,7 @@ class Drone:
8066
8066
  raise InvalidDrawColorError("Invalid color. Color value must be 'white' or 'black'")
8067
8067
 
8068
8068
  async def _controller_draw_string_align_emscripten(self, x_start, x_end, y, string, image, color, alignment):
8069
- if (await self.get_information_data())[0] == ModelNumber.Drone_12_Drone_P1:
8069
+ if is_jrotc_drone((await self.get_information_data())[1]):
8070
8070
  warnings.warn(
8071
8071
  "This function is not currently supported for CoDrone EDU (JROTC ed.).",
8072
8072
  RuntimeWarning,
@@ -8153,7 +8153,7 @@ class Drone:
8153
8153
  return
8154
8154
 
8155
8155
  async def _controller_draw_image_emscripten(self, pixel_list):
8156
- if (await self.get_information_data())[0] == ModelNumber.Drone_12_Drone_P1:
8156
+ if is_jrotc_drone((await self.get_information_data())[1]):
8157
8157
  warnings.warn(
8158
8158
  "This function is not currently supported for CoDrone EDU (JROTC ed.).",
8159
8159
  RuntimeWarning,
@@ -77,11 +77,21 @@ class ModelNumber(Enum):
77
77
 
78
78
  Drone_12_Controller_P1 = 0x000C2001 # Drone_12_Controller_P1 (CDE JROTC ed.)
79
79
  Drone_12_Drone_P1 = 0x000C1002 # Drone_12_Drone_P1 (CDE JROTC ed.)
80
+ Drone_12_Drone_P3 = 0x000C1003 # Drone_12_Drone_P3 (CDE JROTC ed.) (IMU)
80
81
  Drone_8_Drone_P3 = 0x00081003 # Drone_8_Drone_P3 CoDrone EDU (IMU)
81
82
 
82
- Drone_12_Controller_P10 = 0x000C200A # CDEP Controller (v1.0)
83
- Drone_12_Controller_P11 = 0x000C2010 # CDEP Controller (v1.1)
84
- Drone_12_Drone_P10 = 0x000C100A # CDEP Drone
83
+
84
+ JROTC_DRONE_MODEL_NUMBERS = (
85
+ ModelNumber.Drone_12_Drone_P1,
86
+ ModelNumber.Drone_12_Drone_P3,
87
+ )
88
+
89
+
90
+ def is_jrotc_drone(model_number):
91
+ """
92
+ Returns True if model_number belongs to a CoDrone EDU (JROTC ed.) drone.
93
+ """
94
+ return model_number in JROTC_DRONE_MODEL_NUMBERS
85
95
 
86
96
 
87
97
  class DeviceType(Enum):
@@ -175,7 +175,7 @@ class Updater:
175
175
  exit()
176
176
 
177
177
  #print("model number", self.modelNumber)
178
- if self.modelNumber == ModelNumber.Drone_12_Drone_P1 or self.modelNumber == ModelNumber.Drone_12_Controller_P1:
178
+ if is_jrotc_drone(self.modelNumber) or self.modelNumber == ModelNumber.Drone_12_Controller_P1:
179
179
  print(Fore.RED + "Python firmware updater not available for CoDrone EDU (JROTC ed.)")
180
180
  exit()
181
181
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codrone_edu
3
- Version: 2.10
3
+ Version: 2.11
4
4
  Summary: Python CoDrone EDU library
5
5
  Home-page:
6
6
  Author:
@@ -22,7 +22,7 @@ Python package for controlling CoDrone EDU.
22
22
 
23
23
  setup(
24
24
  name='codrone_edu',
25
- version='2.10',
25
+ version='2.11',
26
26
  description='Python CoDrone EDU library',
27
27
  url='',
28
28
  author='',
File without changes
File without changes
File without changes