ArtusAPI 1.3.15__tar.gz → 1.3.16__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 (35) hide show
  1. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/artus_api.py +10 -5
  2. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/communication/WiFi/wifi_server.py +16 -0
  3. ArtusAPI-1.3.16/ArtusAPI/communication/__init__.py +1 -0
  4. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/communication/communication.py +8 -5
  5. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI.egg-info/PKG-INFO +1 -1
  6. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/PKG-INFO +1 -1
  7. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/setup.py +1 -1
  8. ArtusAPI-1.3.15/ArtusAPI/communication/__init__.py +0 -1
  9. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/__init__.py +0 -0
  10. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/commands/__init__.py +0 -0
  11. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/commands/commands.py +0 -0
  12. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/communication/UART/__init__.py +0 -0
  13. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/communication/UART/uart.py +0 -0
  14. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/communication/WiFi/__init__.py +0 -0
  15. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/firmware_update/__init__.py +0 -0
  16. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/firmware_update/firmware_updater.py +0 -0
  17. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/firmware_update/run_full_firmware_update.py +0 -0
  18. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/robot/__init__.py +0 -0
  19. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/robot/artus_lite/__init__.py +0 -0
  20. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/robot/artus_lite/artus_lite.py +0 -0
  21. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/robot/artus_lite/artus_lite_left.py +0 -0
  22. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/robot/artus_lite/artus_lite_plus.py +0 -0
  23. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/robot/artus_lite/artus_lite_plus_left.py +0 -0
  24. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/robot/artus_lite/artus_lite_plus_right.py +0 -0
  25. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/robot/artus_lite/artus_lite_right.py +0 -0
  26. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/robot/robot.py +0 -0
  27. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/sensors/ForceSensor.py +0 -0
  28. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI/sensors/__init__.py +0 -0
  29. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI.egg-info/SOURCES.txt +0 -0
  30. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI.egg-info/dependency_links.txt +0 -0
  31. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI.egg-info/entry_points.txt +0 -0
  32. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI.egg-info/requires.txt +0 -0
  33. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/ArtusAPI.egg-info/top_level.txt +0 -0
  34. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/README.md +0 -0
  35. {ArtusAPI-1.3.15 → ArtusAPI-1.3.16}/setup.cfg +0 -0
@@ -21,7 +21,7 @@ print(desired_path)
21
21
 
22
22
 
23
23
 
24
- from .communication import Communication
24
+ from .communication import Communication,STARTUP_ACK,NORMAL_ACK
25
25
  from .commands import Commands
26
26
  from .robot import Robot
27
27
  from .firmware_update import FirmwareUpdater
@@ -112,7 +112,7 @@ class ArtusAPI:
112
112
  self._communication_handler.send_data(robot_wake_up_command)
113
113
 
114
114
  # wait for data back
115
- if self._communication_handler.wait_for_ack():
115
+ if self._communication_handler.wait_for_ack(value=STARTUP_ACK):
116
116
  self.logger.info(f'Finished calibration')
117
117
  else:
118
118
  self.logger.warning(f'Error in calibration')
@@ -217,7 +217,7 @@ class ArtusAPI:
217
217
  """
218
218
  current_time = time.perf_counter()
219
219
  if current_time - self.last_times[type] < self._communication_period:
220
- self.logger.warning("Command not sent. Communication frequency is too high.")
220
+ self.logger.debug("Command not sent. Communication frequency is too high.")
221
221
  return False
222
222
  self.last_times[type] = current_time
223
223
  return True
@@ -603,7 +603,8 @@ def main_flash():
603
603
  bin_paths = {
604
604
  "actuator_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/actuator_64.txt",
605
605
  "peripheral_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/peripheral_64.txt",
606
- "peripheral_plus_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/peripheral_plus_64.txt",
606
+ "peripheral_plus_right_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/peripheral_plus_right_64.txt",
607
+ "peripheral_plus_left_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/peripheral_plus_left_64.txt",
607
608
 
608
609
  "master_64_right": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/master_right_64.txt",
609
610
  "master_plus_64_right": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/master_plus_64.txt",
@@ -646,10 +647,14 @@ def main_flash():
646
647
  driver_to_flash = 0
647
648
  print('Flashing actuator')
648
649
  elif type_flash == 'peripheral':
650
+ print(f'flashing peripheral with parameters: {args.robot} {args.side}')
649
651
  if args.robot == 'artus_lite':
650
652
  file_location = bin_paths['peripheral_64']
651
653
  elif args.robot == 'artus_lite_plus':
652
- file_location = bin_paths['peripheral_plus_64']
654
+ if args.side == 'right':
655
+ file_location = bin_paths['peripheral_plus_right_64']
656
+ elif args.side == 'left':
657
+ file_location = bin_paths['peripheral_plus_left_64']
653
658
  driver_to_flash = 9
654
659
  print('Flashing peripheral')
655
660
 
@@ -73,6 +73,20 @@ class WiFiServer:
73
73
  """ Start server and listen for connections """
74
74
  def open(self):
75
75
  try:
76
+ # Refresh network interfaces on the OS to ensure up-to-date network info
77
+ sys_platform = platform.system()
78
+ if sys_platform == "Windows":
79
+ os.system("ipconfig /release")
80
+ os.system("ipconfig /renew")
81
+ elif sys_platform == "Linux":
82
+ os.system("nmcli networking off")
83
+ time.sleep(1)
84
+ os.system("nmcli networking on")
85
+ elif sys_platform == "Darwin":
86
+ os.system("sudo ifconfig en0 down")
87
+ time.sleep(1)
88
+ os.system("sudo ifconfig en0 up")
89
+ time.sleep(2)
76
90
 
77
91
  # look for wifi
78
92
  self._find_ssid()
@@ -196,6 +210,8 @@ class WiFiServer:
196
210
  else:
197
211
  self.logger.warning(f"Incomplete data received - package size = {len(byte_msg)}")
198
212
  return None
213
+ except TimeoutError:
214
+ None
199
215
  except Exception as e:
200
216
  # TODO logging
201
217
  self.logger.warning(f"No data available to receive {e}")
@@ -0,0 +1 @@
1
+ from .communication import Communication,STARTUP_ACK,NORMAL_ACK
@@ -194,12 +194,12 @@ class Communication:
194
194
  with tqdm(total=timeout, unit="s", desc="Waiting for ack") as pbar:
195
195
  while 1:
196
196
  tmp,rc_csum = self.receive_data()
197
- if value == NORMAL_ACK:
198
- if tmp is not None:
199
- self.logger.info(f'ack received in {time.perf_counter() - start_time} seconds')
200
- return 1
201
- elif tmp == value:
197
+ # if value == NORMAL_ACK:
198
+ if tmp is not None:
202
199
  self.logger.info(f'ack received in {time.perf_counter() - start_time} seconds')
200
+ if value == STARTUP_ACK:
201
+ self.logger.info(f'Artus Version {rc_csum[0]}.{rc_csum[1]}')
202
+ print(f'Artus Version {rc_csum[0]}.{rc_csum[1]}')
203
203
  return 1
204
204
  time.sleep(0.01)
205
205
  if time.perf_counter() - start_time > timeout:
@@ -212,6 +212,9 @@ class Communication:
212
212
  tmp,rc_csum = self.receive_data()
213
213
  if tmp is not None:
214
214
  self.logger.info(f'ack received in {time.perf_counter() - start_time} seconds')
215
+ if value == STARTUP_ACK:
216
+ self.logger.info(f'Artus Version {rc_csum[0]}.{rc_csum[1]}')
217
+ print(f'Artus Version {rc_csum[0]}.{rc_csum[1]}')
215
218
  return 1
216
219
  if time.perf_counter() - start_time > timeout:
217
220
  self.logger.error('timeout error\r\ntimeout error\r\ntimeout error')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ArtusAPI
3
- Version: 1.3.15
3
+ Version: 1.3.16
4
4
  Summary: API to control Artus Family of Robots by Sarcomere Dynamics Inc
5
5
  Home-page: https://sarcomeredynamics.com/home
6
6
  Author: Sarcomere Dynamics Inc.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ArtusAPI
3
- Version: 1.3.15
3
+ Version: 1.3.16
4
4
  Summary: API to control Artus Family of Robots by Sarcomere Dynamics Inc
5
5
  Home-page: https://sarcomeredynamics.com/home
6
6
  Author: Sarcomere Dynamics Inc.
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='ArtusAPI',
5
- version='1.3.15',
5
+ version='1.3.16',
6
6
  description='API to control Artus Family of Robots by Sarcomere Dynamics Inc',
7
7
  long_description=open('README.md').read(),
8
8
  long_description_content_type='text/markdown',
@@ -1 +0,0 @@
1
- from .communication import Communication
File without changes
File without changes