ArtusAPI 1.3.16__tar.gz → 1.3.17__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.
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/artus_api.py +12 -8
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/commands/commands.py +3 -1
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/communication/UART/uart.py +1 -1
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/communication/communication.py +4 -4
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/robot/artus_lite/artus_lite_plus.py +26 -1
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/robot/robot.py +5 -2
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI.egg-info/PKG-INFO +1 -1
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/PKG-INFO +1 -1
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/setup.py +1 -1
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/__init__.py +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/commands/__init__.py +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/communication/UART/__init__.py +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/communication/WiFi/__init__.py +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/communication/WiFi/wifi_server.py +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/communication/__init__.py +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/firmware_update/__init__.py +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/firmware_update/firmware_updater.py +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/firmware_update/run_full_firmware_update.py +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/robot/__init__.py +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/robot/artus_lite/__init__.py +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/robot/artus_lite/artus_lite.py +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/robot/artus_lite/artus_lite_left.py +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/robot/artus_lite/artus_lite_plus_left.py +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/robot/artus_lite/artus_lite_plus_right.py +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/robot/artus_lite/artus_lite_right.py +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/sensors/ForceSensor.py +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI/sensors/__init__.py +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI.egg-info/SOURCES.txt +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI.egg-info/dependency_links.txt +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI.egg-info/entry_points.txt +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI.egg-info/requires.txt +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/ArtusAPI.egg-info/top_level.txt +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/README.md +0 -0
- {ArtusAPI-1.3.16 → ArtusAPI-1.3.17}/setup.cfg +0 -0
|
@@ -223,7 +223,7 @@ class ArtusAPI:
|
|
|
223
223
|
return True
|
|
224
224
|
|
|
225
225
|
# robot feedback
|
|
226
|
-
def _receive_feedback(self):
|
|
226
|
+
def _receive_feedback(self,type=0):
|
|
227
227
|
"""
|
|
228
228
|
Send a request for feedback data and receive feedback data
|
|
229
229
|
|
|
@@ -234,15 +234,19 @@ class ArtusAPI:
|
|
|
234
234
|
self.logger.warning(f'Hand not ready, send `wake_up` command')
|
|
235
235
|
return
|
|
236
236
|
|
|
237
|
-
feedback_command = self._command_handler.get_states_command()
|
|
237
|
+
feedback_command = self._command_handler.get_states_command(type=type)
|
|
238
238
|
self._communication_handler.send_data(feedback_command)
|
|
239
239
|
# test
|
|
240
240
|
time.sleep(0.001)
|
|
241
|
-
return self._communication_handler.receive_data()
|
|
241
|
+
return self._communication_handler.receive_data(type)
|
|
242
242
|
|
|
243
|
-
|
|
243
|
+
|
|
244
|
+
def get_joint_angles(self,type=0):
|
|
244
245
|
"""
|
|
245
246
|
Populate feedback fields in self._robot_handler.hand_joints dict
|
|
247
|
+
type: only applicable to artus+
|
|
248
|
+
0: get joint angles and force values from fingertip
|
|
249
|
+
1: get actuator data (temperature and current)
|
|
246
250
|
|
|
247
251
|
Returns:
|
|
248
252
|
:tuple: (ack, angles, velocities, temperatures)
|
|
@@ -255,16 +259,16 @@ class ArtusAPI:
|
|
|
255
259
|
self.logger.warning(f'Hand not ready, send `wake_up` command')
|
|
256
260
|
return
|
|
257
261
|
|
|
258
|
-
feedback_command = self._receive_feedback()
|
|
262
|
+
feedback_command = self._receive_feedback(type)
|
|
259
263
|
if not self._check_communication_frequency(1):
|
|
260
264
|
return None
|
|
261
|
-
joint_angles = self._robot_handler.get_joint_angles(feedback_command)
|
|
265
|
+
joint_angles = self._robot_handler.get_joint_angles(feedback_command,type=type)
|
|
262
266
|
if joint_angles is None:
|
|
263
267
|
return None
|
|
264
268
|
|
|
265
269
|
angles = joint_angles[1][0:16]
|
|
266
270
|
|
|
267
|
-
if self._robot_handler.robot_type == 'artus_lite':
|
|
271
|
+
if self._robot_handler.robot_type == 'artus_lite' or type == 1:
|
|
268
272
|
# separate joint angles into 3 lists
|
|
269
273
|
velocities = joint_angles[1][16:32]
|
|
270
274
|
temperatures = joint_angles[1][32:48]
|
|
@@ -298,7 +302,7 @@ class ArtusAPI:
|
|
|
298
302
|
if not feedback_command:
|
|
299
303
|
print(f'feedback is none')
|
|
300
304
|
return None
|
|
301
|
-
joint_angles = self._robot_handler.get_joint_angles(feedback_command)
|
|
305
|
+
joint_angles = self._robot_handler.get_joint_angles(feedback_command,type=0)
|
|
302
306
|
return joint_angles
|
|
303
307
|
|
|
304
308
|
def update_firmware(self,upload_flag='y',file_location=None,drivers_to_flash=0):
|
|
@@ -110,9 +110,11 @@ class Commands:
|
|
|
110
110
|
command_list.insert(0,self.commands['sleep_command'])
|
|
111
111
|
return command_list
|
|
112
112
|
|
|
113
|
-
def get_states_command(self):
|
|
113
|
+
def get_states_command(self,type=0):
|
|
114
114
|
command_list = [0]*32
|
|
115
115
|
command_list.insert(0,self.commands['get_feedback_command'])
|
|
116
|
+
if type == 1:
|
|
117
|
+
command_list[1] = 1 # get actuator data -- only applicable to artus+
|
|
116
118
|
return command_list
|
|
117
119
|
|
|
118
120
|
def get_firmware_update_command(self):
|
|
@@ -89,7 +89,7 @@ class UART:
|
|
|
89
89
|
# print(msg_bytes)
|
|
90
90
|
return msg_bytes
|
|
91
91
|
elif self.esp32.in_waiting > 0:
|
|
92
|
-
|
|
92
|
+
msg_bytes = self.esp32.read_all()
|
|
93
93
|
# self.logger.warning(f"Incomplete data received - package size = {(self.esp32.in_waiting)}")
|
|
94
94
|
return None
|
|
95
95
|
else: # non blocking
|
|
@@ -89,11 +89,11 @@ class Communication:
|
|
|
89
89
|
# return byte array to send
|
|
90
90
|
return send_data
|
|
91
91
|
|
|
92
|
-
def _byte_to_list_decode(self,package:bytearray) -> tuple:
|
|
92
|
+
def _byte_to_list_decode(self,package:bytearray,type=0) -> tuple:
|
|
93
93
|
recv_data = []
|
|
94
94
|
i = 0
|
|
95
95
|
|
|
96
|
-
if self.robot_type == 'artus_lite':
|
|
96
|
+
if self.robot_type == 'artus_lite' or type == 1:
|
|
97
97
|
# BYTE 0 : ACK
|
|
98
98
|
# BYTE 1 - 16 : 8 BIT POSITION
|
|
99
99
|
# BYTE 17 - 49 : 16 BIT POSITION
|
|
@@ -164,7 +164,7 @@ class Communication:
|
|
|
164
164
|
pass
|
|
165
165
|
return False
|
|
166
166
|
|
|
167
|
-
def receive_data(self) -> list:
|
|
167
|
+
def receive_data(self,type=0) -> list:
|
|
168
168
|
"""
|
|
169
169
|
receive message
|
|
170
170
|
"""
|
|
@@ -174,7 +174,7 @@ class Communication:
|
|
|
174
174
|
if not byte_msg_recv:
|
|
175
175
|
# self.logger.warning("No data received")
|
|
176
176
|
return None,None
|
|
177
|
-
ack,message_received = self._byte_to_list_decode(byte_msg_recv)
|
|
177
|
+
ack,message_received = self._byte_to_list_decode(byte_msg_recv,type)
|
|
178
178
|
if ack == 9:
|
|
179
179
|
self.logger.warning("[E] error ack")
|
|
180
180
|
# print(ack)
|
|
@@ -27,7 +27,7 @@ class ArtusLite_Plus(ArtusLite):
|
|
|
27
27
|
'indices' : indices[i]
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
def
|
|
30
|
+
def get_joint_angles_force(self, feedback_package:list):
|
|
31
31
|
"""
|
|
32
32
|
Get the joint angles and feedback list data
|
|
33
33
|
and populate the feedback fields in the hand_joints dictionary
|
|
@@ -54,6 +54,31 @@ class ArtusLite_Plus(ArtusLite):
|
|
|
54
54
|
object['data'].z = feedback_slice[i+2]
|
|
55
55
|
i += 3
|
|
56
56
|
|
|
57
|
+
return feedback_package
|
|
58
|
+
except TypeError:
|
|
59
|
+
# print(f'feedback_package is None')
|
|
60
|
+
return None
|
|
61
|
+
except Exception as e:
|
|
62
|
+
print(e)
|
|
63
|
+
return None
|
|
64
|
+
|
|
65
|
+
def get_joint_angles(self, feedback_package:list):
|
|
66
|
+
"""
|
|
67
|
+
Get the joint angles and feedback list data
|
|
68
|
+
and populate the feedback fields in the hand_joints dictionary
|
|
69
|
+
"""
|
|
70
|
+
# print(f'FB PACKAGE = {feedback_package}')
|
|
71
|
+
try:
|
|
72
|
+
for name,joint_data in self.hand_joints.items():
|
|
73
|
+
joint_data.feedback_angle = feedback_package[1][joint_data.index]
|
|
74
|
+
joint_data.feedback_current = feedback_package[1][joint_data.index+15]
|
|
75
|
+
joint_data.feedback_force = round(feedback_package[1][joint_data.index+15] * 0.0035904, 2) # take current value and convert to force
|
|
76
|
+
joint_data.feedback_temperature = feedback_package[1][joint_data.index+31]
|
|
77
|
+
|
|
78
|
+
if joint_data.index in [1,5,8,11,14] and joint_data.feedback_angle < 0:
|
|
79
|
+
joint_data.feedback_angle = -joint_data.feedback_angle
|
|
80
|
+
feedback_package[1][joint_data.index] = -feedback_package[1][joint_data.index]
|
|
81
|
+
|
|
57
82
|
return feedback_package
|
|
58
83
|
except TypeError:
|
|
59
84
|
# print(f'feedback_package is None')
|
|
@@ -71,11 +71,14 @@ class Robot:
|
|
|
71
71
|
"""
|
|
72
72
|
return self.robot.set_home_position()
|
|
73
73
|
|
|
74
|
-
def get_joint_angles(self, joint_angles):
|
|
74
|
+
def get_joint_angles(self, joint_angles,type=0):
|
|
75
75
|
"""
|
|
76
76
|
Get the joint angles of the hand
|
|
77
77
|
"""
|
|
78
|
-
|
|
78
|
+
if type == 1 or self.robot_type == 'artus_lite':
|
|
79
|
+
return self.robot.get_joint_angles(joint_angles)
|
|
80
|
+
elif self.robot_type == 'artus_lite_plus':
|
|
81
|
+
return self.robot.get_joint_angles_force(joint_angles)
|
|
79
82
|
|
|
80
83
|
|
|
81
84
|
def main():
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name='ArtusAPI',
|
|
5
|
-
version='1.3.
|
|
5
|
+
version='1.3.17',
|
|
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',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|