ArtusAPI 1.3__tar.gz → 1.3.2__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 → ArtusAPI-1.3.2}/ArtusAPI/artus_api.py +202 -134
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/robot/artus_lite/artus_lite.py +4 -2
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI.egg-info/PKG-INFO +1 -1
- ArtusAPI-1.3.2/ArtusAPI.egg-info/entry_points.txt +4 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/PKG-INFO +1 -1
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/setup.py +4 -2
- ArtusAPI-1.3/ArtusAPI.egg-info/entry_points.txt +0 -3
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/__init__.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/commands/__init__.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/commands/commands.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/communication/UART/__init__.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/communication/UART/uart.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/communication/WiFi/__init__.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/communication/WiFi/wifi_server.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/communication/__init__.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/communication/communication.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/firmware_update/__init__.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/firmware_update/firmware_updater.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/firmware_update/run_full_firmware_update.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/robot/__init__.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/robot/artus_lite/__init__.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/robot/artus_lite/artus_lite_left.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/robot/artus_lite/artus_lite_plus.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/robot/artus_lite/artus_lite_plus_right.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/robot/artus_lite/artus_lite_right.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/robot/robot.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/sensors/ForceSensor.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI/sensors/__init__.py +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI.egg-info/SOURCES.txt +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI.egg-info/dependency_links.txt +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI.egg-info/requires.txt +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/ArtusAPI.egg-info/top_level.txt +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/README.md +0 -0
- {ArtusAPI-1.3 → ArtusAPI-1.3.2}/setup.cfg +0 -0
|
@@ -66,6 +66,7 @@ class ArtusAPI:
|
|
|
66
66
|
hand_type = hand_type)
|
|
67
67
|
|
|
68
68
|
self._last_command_sent_time = time.perf_counter()
|
|
69
|
+
self.last_streamed_feedback_time = time.perf_counter()
|
|
69
70
|
self._communication_frequency = communication_frequency
|
|
70
71
|
self._communication_period = 1 / self._communication_frequency
|
|
71
72
|
self._communication_period_ms = self._communication_period * 1000
|
|
@@ -151,7 +152,7 @@ class ArtusAPI:
|
|
|
151
152
|
|
|
152
153
|
|
|
153
154
|
# robot control
|
|
154
|
-
def set_joint_angles(self, joint_angles:dict):
|
|
155
|
+
def set_joint_angles(self, joint_angles:dict,name=False):
|
|
155
156
|
"""
|
|
156
157
|
Set joint angle targets and speed values to the Artus Hand
|
|
157
158
|
|
|
@@ -161,7 +162,7 @@ class ArtusAPI:
|
|
|
161
162
|
if not self.awake:
|
|
162
163
|
self.logger.warning(f'Hand not ready, send `wake_up` command')
|
|
163
164
|
return
|
|
164
|
-
self._robot_handler.set_joint_angles(joint_angles=joint_angles,name=
|
|
165
|
+
self._robot_handler.set_joint_angles(joint_angles=joint_angles,name=name)
|
|
165
166
|
robot_set_joint_angles_command = self._command_handler.get_target_position_command(self._robot_handler.robot.hand_joints)
|
|
166
167
|
# check communication frequency
|
|
167
168
|
if not self._check_communication_frequency(self._last_command_sent_time):
|
|
@@ -253,6 +254,8 @@ class ArtusAPI:
|
|
|
253
254
|
return
|
|
254
255
|
|
|
255
256
|
feedback_command = self._receive_feedback()
|
|
257
|
+
if not self._check_communication_frequency(self._last_command_sent_time):
|
|
258
|
+
return None
|
|
256
259
|
joint_angles = self._robot_handler.get_joint_angles(feedback_command)
|
|
257
260
|
if joint_angles is None:
|
|
258
261
|
return None
|
|
@@ -286,7 +289,7 @@ class ArtusAPI:
|
|
|
286
289
|
self.logger.warning(f'Hand not ready, send `wake_up` command')
|
|
287
290
|
return
|
|
288
291
|
|
|
289
|
-
if not self._check_communication_frequency(self.
|
|
292
|
+
if not self._check_communication_frequency(self.last_streamed_feedback_time):
|
|
290
293
|
return None
|
|
291
294
|
else:
|
|
292
295
|
feedback_command = self._communication_handler.receive_data()
|
|
@@ -516,145 +519,210 @@ def test_artus_api():
|
|
|
516
519
|
artus_api.disconnect()
|
|
517
520
|
|
|
518
521
|
# script entry points
|
|
522
|
+
def main():
|
|
523
|
+
try:
|
|
524
|
+
# import specific to the cli entry point
|
|
525
|
+
import argparse
|
|
526
|
+
|
|
527
|
+
parser = argparse.ArgumentParser(
|
|
528
|
+
description="Artus API CLI Tool"
|
|
529
|
+
)
|
|
530
|
+
# add required arguments
|
|
531
|
+
parser.add_argument('-p','--port',required=True,help="required com port (COMx) or (/dev/ttyUSBx)")
|
|
532
|
+
parser.add_argument('-r','--robot',default='artus_lite',help="Robot type",choices=['artus_lite','artus_lite_plus'])
|
|
533
|
+
parser.add_argument('-s','--side',default='right',choices=['left','right'],help='specify hand side, left or right')
|
|
534
|
+
# parser.add_argument('-b','--baudrate',default=921600,help='specify baudrate',choices=[921600,115200])
|
|
535
|
+
args = parser.parse_args()
|
|
536
|
+
|
|
537
|
+
myrobot = ArtusAPI(robot_type=args.robot, hand_type=args.side, communication_channel_identifier=args.port,baudrate=921600)
|
|
538
|
+
myrobot.connect()
|
|
539
|
+
time.sleep(1)
|
|
540
|
+
|
|
541
|
+
while(1):
|
|
542
|
+
input_command = input('Enter command: ')
|
|
543
|
+
if input_command == 'c1':
|
|
544
|
+
myrobot.calibrate(calibration_type=1)
|
|
545
|
+
elif input_command == 'c':
|
|
546
|
+
myrobot.calibrate()
|
|
547
|
+
elif input_command == 'h':
|
|
548
|
+
myrobot.set_home_position()
|
|
549
|
+
elif input_command == 'm':
|
|
550
|
+
grasp_dict = {'thumb_spread': {'target_angle': 30}, 'thumb_d2': {'target_angle': 30}, 'thumb_flex': {'target_angle': 30},
|
|
551
|
+
'index_d2': {'target_angle': 30}, 'index_flex': {'target_angle': 30},
|
|
552
|
+
'middle_d2': {'target_angle': 30}, 'middle_flex': {'target_angle': 30},
|
|
553
|
+
'ring_d2': {'target_angle': 30}, 'ring_flex': {'target_angle': 30},
|
|
554
|
+
'pinky_d2': {'target_angle': 30}, 'pinky_flex': {'target_angle': 30}}
|
|
555
|
+
myrobot.set_joint_angles(grasp_dict)
|
|
556
|
+
elif input_command == 'q':
|
|
557
|
+
myrobot.sleep()
|
|
558
|
+
time.sleep(1)
|
|
559
|
+
myrobot.disconnect()
|
|
560
|
+
quit()
|
|
561
|
+
elif input_command == 'r':
|
|
562
|
+
j = int(input('Enter joint number: '))
|
|
563
|
+
m = int(input('Enter motor number: '))
|
|
564
|
+
myrobot.reset(j,m)
|
|
565
|
+
else:
|
|
566
|
+
print(f'Invalid command: {input_command}')
|
|
567
|
+
time.sleep(1)
|
|
568
|
+
|
|
569
|
+
except Exception as e:
|
|
570
|
+
print(f"An error occurred: {str(e)}")
|
|
571
|
+
|
|
519
572
|
|
|
520
573
|
def main_flash():
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
parser = argparse.ArgumentParser(
|
|
541
|
-
description="Artus API CLI Tool"
|
|
542
|
-
)
|
|
543
|
-
|
|
544
|
-
# add required arguments
|
|
545
|
-
parser.add_argument('-p','--port',required=True,help="required com port (COMx) or (/dev/ttyUSBx)")
|
|
546
|
-
parser.add_argument('-r','--robot',default='artus_lite',help="Robot type",choices=['artus_lite','artus_lite_plus'])
|
|
547
|
-
parser.add_argument('-s','--side',default='right',choices=['left','right'],help='specify hand side, left or right')
|
|
548
|
-
|
|
549
|
-
args = parser.parse_args()
|
|
550
|
-
|
|
551
|
-
type_flash = None
|
|
552
|
-
driver_to_flash = None
|
|
553
|
-
bootapp_path = None
|
|
554
|
-
partitions_path = None
|
|
555
|
-
bootloader_path = None
|
|
556
|
-
file_location = None
|
|
557
|
-
|
|
558
|
-
# get type of flash
|
|
559
|
-
while type_flash not in ['actuator','peripheral','master']:
|
|
560
|
-
type_flash = input('Enter subsystem to flash (actuator, peripheral, master): ')
|
|
561
|
-
|
|
562
|
-
if type_flash == 'actuator':
|
|
563
|
-
file_location = bin_paths['actuator_64']
|
|
564
|
-
driver_to_flash = 0
|
|
565
|
-
elif type_flash == 'peripheral':
|
|
566
|
-
if args.robot == 'artus_lite':
|
|
567
|
-
file_location = bin_paths['peripheral_64']
|
|
568
|
-
elif args.robot == 'artus_lite_plus':
|
|
569
|
-
file_location = bin_paths['peripheral_plus_64']
|
|
570
|
-
driver_to_flash = 9
|
|
571
|
-
elif type_flash == 'master':
|
|
572
|
-
if args.robot == 'artus_lite':
|
|
573
|
-
file_location = bin_paths['master_64']
|
|
574
|
-
elif args.robot == 'artus_lite_plus':
|
|
575
|
-
file_location = bin_paths['master_plus_64']
|
|
574
|
+
try:
|
|
575
|
+
# import specific to the cli entry point
|
|
576
|
+
import argparse
|
|
577
|
+
import requests
|
|
578
|
+
import os
|
|
579
|
+
import json
|
|
580
|
+
import base64
|
|
581
|
+
import esptool
|
|
582
|
+
|
|
583
|
+
bin_paths = {
|
|
584
|
+
"actuator_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/actuator_64.txt",
|
|
585
|
+
"peripheral_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/peripheral_64.txt",
|
|
586
|
+
"peripheral_plus_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/peripheral_plus_64.txt",
|
|
587
|
+
"master_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/master_64.txt",
|
|
588
|
+
"master_plus_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/master_plus_64.txt",
|
|
589
|
+
"master_bootapp0_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/master_bootapp0_64.txt",
|
|
590
|
+
"master_partitions_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/master_partitions_64.txt",
|
|
591
|
+
"master_bootloader_64": "https://gist.githubusercontent.com/SDRyanLee/ad8bbe17164c74e6417d1e2d4d0843d2/raw/master_bootloader_64.txt"
|
|
592
|
+
}
|
|
576
593
|
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
594
|
+
parser = argparse.ArgumentParser(
|
|
595
|
+
description="Artus API CLI Flash Tool"
|
|
596
|
+
)
|
|
597
|
+
|
|
598
|
+
# add required arguments
|
|
599
|
+
parser.add_argument('-p','--port',required=True,help="required com port (COMx) or (/dev/ttyUSBx)")
|
|
600
|
+
parser.add_argument('-r','--robot',default='artus_lite',help="Robot type",choices=['artus_lite','artus_lite_plus'])
|
|
601
|
+
parser.add_argument('-s','--side',default='right',choices=['left','right'],help='specify hand side, left or right')
|
|
602
|
+
# parser.add_argument('-b','--baudrate',default=921600,help='specify baudrate',choices=[921600,115200])
|
|
603
|
+
args = parser.parse_args()
|
|
604
|
+
|
|
605
|
+
type_flash = None
|
|
606
|
+
driver_to_flash = None
|
|
607
|
+
bootapp_path = None
|
|
608
|
+
partitions_path = None
|
|
609
|
+
bootloader_path = None
|
|
610
|
+
file_location = None
|
|
611
|
+
|
|
612
|
+
# get type of flash
|
|
613
|
+
while type_flash not in ['actuator','peripheral','master']:
|
|
614
|
+
type_flash = input('Enter subsystem to flash (actuator, peripheral, master): ')
|
|
615
|
+
|
|
616
|
+
if type_flash == 'actuator':
|
|
617
|
+
file_location = bin_paths['actuator_64']
|
|
618
|
+
driver_to_flash = 0
|
|
619
|
+
print('Flashing actuator')
|
|
620
|
+
elif type_flash == 'peripheral':
|
|
621
|
+
if args.robot == 'artus_lite':
|
|
622
|
+
file_location = bin_paths['peripheral_64']
|
|
623
|
+
elif args.robot == 'artus_lite_plus':
|
|
624
|
+
file_location = bin_paths['peripheral_plus_64']
|
|
625
|
+
driver_to_flash = 9
|
|
626
|
+
print('Flashing peripheral')
|
|
627
|
+
elif type_flash == 'master':
|
|
628
|
+
if args.robot == 'artus_lite':
|
|
629
|
+
file_location = bin_paths['master_64']
|
|
630
|
+
elif args.robot == 'artus_lite_plus':
|
|
631
|
+
file_location = bin_paths['master_plus_64']
|
|
603
632
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
633
|
+
bootapp_path = bin_paths['master_bootapp0_64']
|
|
634
|
+
partitions_path = bin_paths['master_partitions_64']
|
|
635
|
+
bootloader_path = bin_paths['master_bootloader_64']
|
|
636
|
+
print('Flashing master')
|
|
637
|
+
# write files
|
|
638
|
+
# Download and decode base64 firmware file
|
|
639
|
+
response = requests.get(file_location)
|
|
640
|
+
decoded_firmware = base64.b64decode(response.text)
|
|
609
641
|
|
|
642
|
+
# Write decoded firmware to flash.bin
|
|
643
|
+
with open('flash.bin', 'wb') as f:
|
|
644
|
+
f.write(decoded_firmware)
|
|
645
|
+
|
|
646
|
+
# For master firmware, also download and decode bootloader files
|
|
647
|
+
if type_flash == 'master':
|
|
648
|
+
# Download and decode bootapp
|
|
649
|
+
response = requests.get(bootapp_path)
|
|
650
|
+
decoded_bootapp = base64.b64decode(response.text)
|
|
651
|
+
with open('bootapp0.bin', 'wb') as f:
|
|
652
|
+
f.write(decoded_bootapp)
|
|
653
|
+
|
|
654
|
+
# Download and decode partitions
|
|
655
|
+
response = requests.get(partitions_path)
|
|
656
|
+
decoded_partitions = base64.b64decode(response.text)
|
|
657
|
+
with open('partitions.bin', 'wb') as f:
|
|
658
|
+
f.write(decoded_partitions)
|
|
659
|
+
|
|
660
|
+
# Download and decode bootloader
|
|
661
|
+
response = requests.get(bootloader_path)
|
|
662
|
+
decoded_bootloader = base64.b64decode(response.text)
|
|
663
|
+
with open('bootloader.bin', 'wb') as f:
|
|
664
|
+
f.write(decoded_bootloader)
|
|
665
|
+
|
|
610
666
|
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
file_location = 'flash.bin'
|
|
618
|
-
myrobot.update_firmware(upload_flag='y',file_location=file_location,drivers_to_flash=driver_to_flash)
|
|
619
|
-
|
|
620
|
-
myrobot.disconnect()
|
|
621
|
-
print('Disconnected from robot')
|
|
667
|
+
# flash through api
|
|
668
|
+
if type_flash != 'master':
|
|
669
|
+
myrobot = ArtusAPI(robot_type=args.robot, hand_type=args.side, communication_channel_identifier=args.port,baudrate=921600)
|
|
670
|
+
myrobot.connect()
|
|
671
|
+
print('Connected to robot')
|
|
672
|
+
time.sleep(1)
|
|
622
673
|
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
'
|
|
629
|
-
'--baud', '921600',
|
|
630
|
-
'--before', 'default_reset',
|
|
631
|
-
'--after', 'hard_reset',
|
|
632
|
-
'write_flash',
|
|
633
|
-
'-z',
|
|
634
|
-
'--flash_mode', 'keep',
|
|
635
|
-
'--flash_freq', 'keep',
|
|
636
|
-
'--flash_size', 'keep',
|
|
637
|
-
'0x0', 'bootloader.bin',
|
|
638
|
-
'0x8000', 'partitions.bin',
|
|
639
|
-
'0xe000', 'bootapp0.bin',
|
|
640
|
-
'0x10000', 'flash.bin'
|
|
641
|
-
]
|
|
642
|
-
|
|
643
|
-
# Run esptool flash command
|
|
644
|
-
esptool.main(cmd_args)
|
|
645
|
-
|
|
646
|
-
# Clean up temporary bootloader files
|
|
647
|
-
os.remove('bootloader.bin')
|
|
648
|
-
os.remove('partitions.bin')
|
|
649
|
-
os.remove('bootapp0.bin')
|
|
650
|
-
|
|
651
|
-
# delete bin file
|
|
652
|
-
time.sleep(1)
|
|
653
|
-
os.remove('flash.bin')
|
|
654
|
-
print('Flash complete')
|
|
655
|
-
|
|
656
|
-
print('Done')
|
|
674
|
+
file_location = 'flash.bin'
|
|
675
|
+
myrobot.update_firmware(upload_flag='y',file_location=file_location,drivers_to_flash=driver_to_flash)
|
|
676
|
+
time.sleep(1)
|
|
677
|
+
|
|
678
|
+
myrobot.disconnect()
|
|
679
|
+
print('Disconnected from robot')
|
|
657
680
|
|
|
681
|
+
else:
|
|
682
|
+
|
|
683
|
+
# Build esptool command arguments
|
|
684
|
+
cmd_args = [
|
|
685
|
+
'--chip', 'esp32s3',
|
|
686
|
+
'--port', args.port,
|
|
687
|
+
'--baud', '921600',
|
|
688
|
+
'--before', 'default_reset',
|
|
689
|
+
'--after', 'hard_reset',
|
|
690
|
+
'write_flash',
|
|
691
|
+
'-z',
|
|
692
|
+
'--flash_mode', 'keep',
|
|
693
|
+
'--flash_freq', 'keep',
|
|
694
|
+
'--flash_size', 'keep',
|
|
695
|
+
'0x0', 'bootloader.bin',
|
|
696
|
+
'0x8000', 'partitions.bin',
|
|
697
|
+
'0xe000', 'bootapp0.bin',
|
|
698
|
+
'0x10000', 'flash.bin'
|
|
699
|
+
]
|
|
700
|
+
|
|
701
|
+
# Run esptool flash command
|
|
702
|
+
esptool.main(cmd_args)
|
|
703
|
+
|
|
704
|
+
# Clean up temporary bootloader files
|
|
705
|
+
os.remove('bootloader.bin')
|
|
706
|
+
os.remove('partitions.bin')
|
|
707
|
+
os.remove('bootapp0.bin')
|
|
708
|
+
|
|
709
|
+
# delete bin file
|
|
710
|
+
time.sleep(1)
|
|
711
|
+
os.remove('flash.bin')
|
|
712
|
+
print('Flash complete')
|
|
713
|
+
|
|
714
|
+
print('Done')
|
|
715
|
+
|
|
716
|
+
except Exception as e:
|
|
717
|
+
print(f"An error occurred: {str(e)}")
|
|
718
|
+
# Clean up any remaining temporary files
|
|
719
|
+
temp_files = ['flash.bin', 'bootloader.bin', 'partitions.bin', 'bootapp0.bin']
|
|
720
|
+
for file in temp_files:
|
|
721
|
+
if os.path.exists(file):
|
|
722
|
+
try:
|
|
723
|
+
os.remove(file)
|
|
724
|
+
except:
|
|
725
|
+
pass
|
|
658
726
|
|
|
659
727
|
if __name__ == "__main__":
|
|
660
728
|
test_artus_api()
|
|
@@ -58,6 +58,7 @@ class ArtusLite:
|
|
|
58
58
|
self.velocity = velocity
|
|
59
59
|
self.feedback_angle = 0
|
|
60
60
|
self.feedback_current = 0
|
|
61
|
+
self.feedback_force = 0.0
|
|
61
62
|
self.feedback_temperature = temperature
|
|
62
63
|
|
|
63
64
|
def __str__(self):
|
|
@@ -130,10 +131,10 @@ class ArtusLite:
|
|
|
130
131
|
"""
|
|
131
132
|
# set values based on names
|
|
132
133
|
for name,target_data in joint_angles.items():
|
|
133
|
-
self.hand_joints[name].target_angle = target_data
|
|
134
|
+
self.hand_joints[name].target_angle = target_data['target_angle']*self.hand_joints[name].rotation_direction
|
|
134
135
|
|
|
135
136
|
if 'velocity' in target_data:
|
|
136
|
-
self.hand_joints[name].velocity = target_data
|
|
137
|
+
self.hand_joints[name].velocity = target_data['velocity']
|
|
137
138
|
else: # fill default velocity
|
|
138
139
|
self.hand_joints[name].velocity = self.joint_velocities[self.hand_joints[name].index]
|
|
139
140
|
self._check_joint_limits(self.hand_joints)
|
|
@@ -185,6 +186,7 @@ class ArtusLite:
|
|
|
185
186
|
for name,joint_data in self.hand_joints.items():
|
|
186
187
|
joint_data.feedback_angle = feedback_package[1][joint_data.index]
|
|
187
188
|
joint_data.feedback_current = feedback_package[1][joint_data.index+15]
|
|
189
|
+
joint_data.feedback_force = round(feedback_package[1][joint_data.index+15] * 0.0035904, 2) # take current value and convert to force
|
|
188
190
|
joint_data.feedback_temperature = feedback_package[1][joint_data.index+31]
|
|
189
191
|
|
|
190
192
|
if joint_data.index in [1,5,8,11,14] and joint_data.feedback_angle < 0:
|
|
@@ -2,8 +2,9 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name='ArtusAPI',
|
|
5
|
-
version='1.3',
|
|
5
|
+
version='1.3.2',
|
|
6
6
|
description='API to control Artus Family of Robots by Sarcomere Dynamics Inc',
|
|
7
|
+
project_description='Python API to control Artus Family of Robots by Sarcomere Dynamics Inc',
|
|
7
8
|
# package_dir={'': '/'}, # tells setuptools that your packages are under src
|
|
8
9
|
packages=find_packages(exclude=['data*', 'examples*', 'tests*','venv*', 'urdf*', 'ros2*']),
|
|
9
10
|
author='Sarcomere Dynamics Inc.',
|
|
@@ -19,7 +20,8 @@ setup(
|
|
|
19
20
|
python_requires='>=3.10',
|
|
20
21
|
entry_points={
|
|
21
22
|
'console_scripts': [
|
|
22
|
-
'
|
|
23
|
+
'artusapiflash = ArtusAPI.artus_api:main_flash',
|
|
24
|
+
'artusapimain = ArtusAPI.artus_api:main'
|
|
23
25
|
]
|
|
24
26
|
}
|
|
25
27
|
# packages=find_packages(where='/'),
|
|
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
|
|
File without changes
|
|
File without changes
|