pymycobot 3.5.0.dev9__tar.gz → 3.5.0.dev11__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 (78) hide show
  1. {pymycobot-3.5.0.dev9/pymycobot.egg-info → pymycobot-3.5.0.dev11}/PKG-INFO +1 -1
  2. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/__init__.py +1 -1
  3. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/error.py +7 -2
  4. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mercury_api.py +144 -110
  5. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/robot_info.py +6 -6
  6. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11/pymycobot.egg-info}/PKG-INFO +1 -1
  7. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/LICENSE +0 -0
  8. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/MANIFEST.in +0 -0
  9. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/README.md +0 -0
  10. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/Interface.py +0 -0
  11. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/bluet.py +0 -0
  12. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/close_loop.py +0 -0
  13. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/common.py +0 -0
  14. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/conveyor_api.py +0 -0
  15. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/dualcobotx.py +0 -0
  16. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/elephantrobot.py +0 -0
  17. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/generate.py +0 -0
  18. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/genre.py +0 -0
  19. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/log.py +0 -0
  20. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mecharm.py +0 -0
  21. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mecharm270.py +0 -0
  22. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mecharmsocket.py +0 -0
  23. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mercury.py +0 -0
  24. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mercury_arms_socket.py +0 -0
  25. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mercury_ros_api.py +0 -0
  26. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mercurychassis.py +0 -0
  27. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mercurychassis_api.py +0 -0
  28. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mercurysocket.py +0 -0
  29. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/myagv.py +0 -0
  30. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/myarm.py +0 -0
  31. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/myarm_api.py +0 -0
  32. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/myarmc.py +0 -0
  33. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/myarmm.py +0 -0
  34. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/myarmm_control.py +0 -0
  35. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/myarmsocket.py +0 -0
  36. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mybuddy.py +0 -0
  37. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mybuddybluetooth.py +0 -0
  38. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mybuddyemoticon.py +0 -0
  39. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mybuddysocket.py +0 -0
  40. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mycobot.py +0 -0
  41. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mycobot280.py +0 -0
  42. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mycobot280socket.py +0 -0
  43. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mycobot280x5pi.py +0 -0
  44. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mycobot320.py +0 -0
  45. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mycobot320socket.py +0 -0
  46. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mycobotpro630.py +0 -0
  47. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mycobotsocket.py +0 -0
  48. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mypalletizer.py +0 -0
  49. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mypalletizer260.py +0 -0
  50. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/mypalletizersocket.py +0 -0
  51. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/pro400.py +0 -0
  52. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/pro400client.py +0 -0
  53. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/pro630.py +0 -0
  54. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/pro630client.py +0 -0
  55. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/progripper.py +0 -0
  56. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/protocol_packet_handler.py +0 -0
  57. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/public.py +0 -0
  58. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/sms.py +0 -0
  59. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/tool_coords.py +0 -0
  60. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/ultraArm.py +0 -0
  61. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot/utils.py +0 -0
  62. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot.egg-info/SOURCES.txt +0 -0
  63. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot.egg-info/dependency_links.txt +0 -0
  64. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot.egg-info/requires.txt +0 -0
  65. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/pymycobot.egg-info/top_level.txt +0 -0
  66. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/requirements.txt +0 -0
  67. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/setup.cfg +0 -0
  68. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/setup.py +0 -0
  69. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/tests/__init__.py +0 -0
  70. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/tests/conftest.py +0 -0
  71. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/tests/rasp_myArm_test_gui.py +0 -0
  72. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/tests/rasp_mycobot_test_gui.py +0 -0
  73. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/tests/rasp_mypall_test_gui.py +0 -0
  74. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/tests/special_angles.py +0 -0
  75. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/tests/test_api.py +0 -0
  76. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/tests/test_generator.py +0 -0
  77. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/tests/test_socket.py +0 -0
  78. {pymycobot-3.5.0.dev9 → pymycobot-3.5.0.dev11}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pymycobot
3
- Version: 3.5.0.dev9
3
+ Version: 3.5.0.dev11
4
4
  Summary: Python API for serial communication of MyCobot.
5
5
  Home-page: https://github.com/elephantrobotics/pymycobot
6
6
  Author: Elephantrobotics
@@ -87,7 +87,7 @@ if sys.platform == "linux":
87
87
  from pymycobot.mybuddyemoticon import MyBuddyEmoticon
88
88
  __all__.append("MyBuddyEmoticon")
89
89
 
90
- __version__ = "3.5.0dev9"
90
+ __version__ = "3.5.0dev11"
91
91
  __author__ = "Elephantrobotics"
92
92
  __email__ = "weiquan.xu@elephantrobotics.com"
93
93
  __git_url__ = "https://github.com/elephantrobotics/pymycobot"
@@ -291,8 +291,8 @@ def calibration_parameters(**kwargs):
291
291
  check_id(value, robot_limit[class_name][parameter], MercuryDataException)
292
292
  elif parameter == 'angle':
293
293
  joint_id = kwargs.get('joint_id', None)
294
- if joint_id in [11,12,13]:
295
- index = robot_limit[class_name]['joint_id'][joint_id-4] - 4
294
+ if joint_id in [11,12]:
295
+ index = robot_limit[class_name]['joint_id'][joint_id-5] - 5
296
296
  else:
297
297
  index = robot_limit[class_name]['joint_id'][joint_id-1] - 1
298
298
  if value < robot_limit[class_name]["angles_min"][index] or value > robot_limit[class_name]["angles_max"][index]:
@@ -413,6 +413,11 @@ def calibration_parameters(**kwargs):
413
413
  elif parameter == "torque":
414
414
  if value < 0 or value > 100:
415
415
  raise MercuryDataException("The parameter {} only supports 0 ~ 100, but received {}".format(parameter, value))
416
+ elif parameter == "hand_id":
417
+ if value < 1 or value > 6:
418
+ raise MercuryDataException("The parameter {} only supports 1 ~ 6, but received {}".format(parameter, value))
419
+ elif parameter == 'pinch_mode':
420
+ check_0_or_1(parameter, value, [0, 1, 2, 3], value_type, MercuryDataException, int)
416
421
  else:
417
422
  public_check(parameter_list, kwargs, robot_limit, class_name, MercuryDataException)
418
423
  elif class_name == "MyAgv":
@@ -32,9 +32,9 @@ class MercuryCommandGenerator(DataProcessor):
32
32
  self.all_read_data = b""
33
33
 
34
34
  def _joint_limit_init(self):
35
- max_joint = np.zeros(7)
36
- min_joint = np.zeros(7)
37
- for i in range(7):
35
+ max_joint = np.zeros(6)
36
+ min_joint = np.zeros(6)
37
+ for i in range(6):
38
38
  max_joint[i] = self.get_joint_max_angle(i + 1)
39
39
  min_joint[i] = self.get_joint_min_angle(i + 1)
40
40
  return max_joint, min_joint
@@ -318,8 +318,8 @@ class MercuryCommandGenerator(DataProcessor):
318
318
  byte_value = int.from_bytes(
319
319
  valid_data[i:i+4], byteorder='big', signed=True)
320
320
  res.append(byte_value)
321
- elif data_len == 6 and genre in [ProtocolCode.GET_SERVO_STATUS, ProtocolCode.GET_SERVO_VOLTAGES,
322
- ProtocolCode.GET_SERVO_CURRENTS]:
321
+ elif data_len == 6 and genre in [ProtocolCode.GET_SERVO_STATUS, ProtocolCode.GET_SERVO_VOLTAGES,ProtocolCode.GET_TORQUE_COMP,
322
+ ProtocolCode.GET_SERVO_CURRENTS, ProtocolCode.GET_MODEL_DIRECTION, ProtocolCode.GET_COLLISION_THRESHOLD]:
323
323
  for i in range(data_len):
324
324
  res.append(valid_data[i])
325
325
  else:
@@ -396,12 +396,12 @@ class MercuryCommandGenerator(DataProcessor):
396
396
  one = valid_data[i: i + 2]
397
397
  res.append(self._decode_int16(one))
398
398
  i += 2
399
- elif data_len == 41 and genre == ProtocolCode.MERCURY_ROBOT_STATUS:
400
- # 图灵右臂上位机错误
399
+ elif data_len in [32, 36] and genre == ProtocolCode.MERCURY_ROBOT_STATUS:
400
+ # 图灵右臂上位机错误:2+6+8*2+6*2 = 36
401
401
  i = 0
402
402
  res = []
403
403
  while i < data_len:
404
- if i < 9:
404
+ if i < 8:
405
405
  res.append(valid_data[i])
406
406
  i += 1
407
407
  else:
@@ -590,6 +590,7 @@ class MercuryCommandGenerator(DataProcessor):
590
590
  elif genre == ProtocolCode.COBOTX_GET_ANGLE:
591
591
  return self._int2angle(res[0])
592
592
  elif genre == ProtocolCode.MERCURY_ROBOT_STATUS:
593
+ # 图灵:2+6+8*2+6*2 = 36
593
594
  if len(res) == 23:
594
595
  index = 9
595
596
  else:
@@ -1035,7 +1036,7 @@ class MercuryCommandGenerator(DataProcessor):
1035
1036
 
1036
1037
  def drag_teach_execute(self):
1037
1038
  """Start dragging the teaching point and only execute it once."""
1038
- return self._mesg(ProtocolCode.MERCURY_DRAG_TECH_EXECUTE)
1039
+ return self._mesg(ProtocolCode.MERCURY_DRAG_TECH_EXECUTE, has_reply=True)
1039
1040
 
1040
1041
  def drag_teach_pause(self):
1041
1042
  """Pause recording of dragging teaching point"""
@@ -1537,47 +1538,47 @@ class MercuryCommandGenerator(DataProcessor):
1537
1538
  return self._mesg(ProtocolCode.SEND_ANGLE, joint_id, [self._angle2int(angle)], speed, has_reply=True,
1538
1539
  _async=_async)
1539
1540
 
1540
- # def send_coord(self, coord_id, coord, speed, _async=False):
1541
- # """Send one coord to robot arm.
1541
+ def send_coord(self, coord_id, coord, speed, _async=False):
1542
+ """Send one coord to robot arm.
1542
1543
 
1543
- # Args:
1544
- # coord_id (int): coord id, range 1 ~ 6
1545
- # coord (float): coord value.
1546
- # The coord range of `X` is -351.11 ~ 566.92.
1547
- # The coord range of `Y` is -645.91 ~ 272.12.
1548
- # The coord range of `Y` is -262.91 ~ 655.13.
1549
- # The coord range of `RX` is -180 ~ 180.
1550
- # The coord range of `RY` is -180 ~ 180.
1551
- # The coord range of `RZ` is -180 ~ 180.
1552
- # speed (int): 1 ~ 100
1553
- # """
1544
+ Args:
1545
+ coord_id (int): coord id, range 1 ~ 6
1546
+ coord (float): coord value.
1547
+ The coord range of `X` is -351.11 ~ 566.92.
1548
+ The coord range of `Y` is -645.91 ~ 272.12.
1549
+ The coord range of `Y` is -262.91 ~ 655.13.
1550
+ The coord range of `RX` is -180 ~ 180.
1551
+ The coord range of `RY` is -180 ~ 180.
1552
+ The coord range of `RZ` is -180 ~ 180.
1553
+ speed (int): 1 ~ 100
1554
+ """
1554
1555
 
1555
- # self.calibration_parameters(
1556
- # class_name=self.__class__.__name__, coord_id=coord_id, coord=coord, speed=speed)
1557
- # value = self._coord2int(coord) if coord_id <= 3 else self._angle2int(coord)
1558
- # return self._mesg(ProtocolCode.SEND_COORD, coord_id, [value], speed, has_reply=True, _async=_async)
1556
+ self.calibration_parameters(
1557
+ class_name=self.__class__.__name__, coord_id=coord_id, coord=coord, speed=speed)
1558
+ value = self._coord2int(coord) if coord_id <= 3 else self._angle2int(coord)
1559
+ return self._mesg(ProtocolCode.SEND_COORD, coord_id, [value], speed, has_reply=True, _async=_async)
1559
1560
 
1560
- # def send_coords(self, coords, speed, _async=False):
1561
- # """Send all coords to robot arm.
1561
+ def send_coords(self, coords, speed, _async=False):
1562
+ """Send all coords to robot arm.
1562
1563
 
1563
- # Args:
1564
- # coords: a list of coords value(List[float]). len 6 [x, y, z, rx, ry, rz]
1565
- # The coord range of `X` is -351.11 ~ 566.92.
1566
- # The coord range of `Y` is -645.91 ~ 272.12.
1567
- # The coord range of `Y` is -262.91 ~ 655.13.
1568
- # The coord range of `RX` is -180 ~ 180.
1569
- # The coord range of `RY` is -180 ~ 180.
1570
- # The coord range of `RZ` is -180 ~ 180.
1571
- # speed : (int) 1 ~ 100
1572
- # """
1573
- # self.calibration_parameters(
1574
- # class_name=self.__class__.__name__, coords=coords, speed=speed)
1575
- # coord_list = []
1576
- # for idx in range(3):
1577
- # coord_list.append(self._coord2int(coords[idx]))
1578
- # for angle in coords[3:]:
1579
- # coord_list.append(self._angle2int(angle))
1580
- # return self._mesg(ProtocolCode.SEND_COORDS, coord_list, speed, has_reply=True, _async=_async)
1564
+ Args:
1565
+ coords: a list of coords value(List[float]). len 6 [x, y, z, rx, ry, rz]
1566
+ The coord range of `X` is -351.11 ~ 566.92.
1567
+ The coord range of `Y` is -645.91 ~ 272.12.
1568
+ The coord range of `Y` is -262.91 ~ 655.13.
1569
+ The coord range of `RX` is -180 ~ 180.
1570
+ The coord range of `RY` is -180 ~ 180.
1571
+ The coord range of `RZ` is -180 ~ 180.
1572
+ speed : (int) 1 ~ 100
1573
+ """
1574
+ self.calibration_parameters(
1575
+ class_name=self.__class__.__name__, coords=coords, speed=speed)
1576
+ coord_list = []
1577
+ for idx in range(3):
1578
+ coord_list.append(self._coord2int(coords[idx]))
1579
+ for angle in coords[3:]:
1580
+ coord_list.append(self._angle2int(angle))
1581
+ return self._mesg(ProtocolCode.SEND_COORDS, coord_list, speed, has_reply=True, _async=_async)
1581
1582
 
1582
1583
  def resume(self):
1583
1584
  """Recovery movement"""
@@ -2109,7 +2110,15 @@ class MercuryCommandGenerator(DataProcessor):
2109
2110
  for angle in new_coords[3:]:
2110
2111
  coord_list.append(self._angle2int(angle))
2111
2112
  angles = [self._angle2int(angle) for angle in old_angles]
2112
- return self._mesg(ProtocolCode.SOLVE_INV_KINEMATICS, coord_list, angles, has_reply=True)
2113
+ res = self._mesg(ProtocolCode.SOLVE_INV_KINEMATICS, coord_list, angles, has_reply=True)
2114
+ r = True
2115
+ if isinstance(res, list):
2116
+ for i in res:
2117
+ if i == -572.95:
2118
+ r = False
2119
+ else:
2120
+ r = True
2121
+ return None if r == False else res
2113
2122
 
2114
2123
  def get_drag_fifo(self):
2115
2124
  return self._mesg(ProtocolCode.GET_DRAG_FIFO)
@@ -2306,86 +2315,94 @@ class MercuryCommandGenerator(DataProcessor):
2306
2315
 
2307
2316
  def __set_tool_fittings_value(self, addr, *args, gripper_id=14, **kwargs):
2308
2317
  kwargs["has_replay"] = True
2318
+ self.calibration_parameters(class_name=self.__class__.__name__, gripper_id=gripper_id)
2309
2319
  return self._mesg(ProtocolCode.MERCURY_SET_TOQUE_GRIPPER, gripper_id, [addr], *args or ([0x00],), **kwargs)
2310
2320
 
2311
2321
  def __get_tool_fittings_value(self, addr, *args, gripper_id=14, **kwargs):
2312
2322
  kwargs["has_replay"] = True
2313
2323
  return self._mesg(ProtocolCode.MERCURY_GET_TOQUE_GRIPPER, gripper_id, [addr], *args or ([0x00],), **kwargs)
2314
2324
 
2315
- def get_hand_firmware_major_version(self, gripper_id):
2325
+ def get_hand_firmware_major_version(self, gripper_id=14):
2316
2326
  return self.__get_tool_fittings_value(
2317
2327
  FingerGripper.GET_HAND_MAJOR_FIRMWARE_VERSION, gripper_id=gripper_id
2318
2328
  )
2319
2329
 
2320
- def get_hand_firmware_minor_version(self, gripper_id):
2330
+ def get_hand_firmware_minor_version(self, gripper_id=14):
2321
2331
  return self.__get_tool_fittings_value(FingerGripper.GET_HAND_MINOR_FIRMWARE_VERSION, gripper_id=gripper_id)
2322
2332
 
2323
- def set_hand_gripper_id(self, gripper_id, hand_id):
2333
+ def set_hand_gripper_id(self, hand_id, gripper_id=14):
2334
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2324
2335
  return self.__set_tool_fittings_value(
2325
2336
  FingerGripper.SET_HAND_GRIPPER_ID, [hand_id], gripper_id=gripper_id
2326
2337
  )
2327
2338
 
2328
- def get_hand_gripper_id(self, gripper_id):
2339
+ def get_hand_gripper_id(self, gripper_id=14):
2329
2340
  return self.__get_tool_fittings_value(
2330
2341
  FingerGripper.GET_HAND_GRIPPER_ID, gripper_id=gripper_id
2331
2342
  )
2332
2343
 
2333
- def set_hand_gripper_angle(self, gripper_id, joint_id, gripper_angle):
2344
+ def set_hand_gripper_angle(self, hand_id, gripper_angle, gripper_id=14):
2334
2345
  """Set the angle of the single joint of the gripper
2335
2346
 
2336
2347
  Args:
2337
- gripper_id (int) : 1 ~ 254
2338
- joint_id (int): 1 ~ 6
2348
+ hand_id (int): 1 ~ 6
2339
2349
  gripper_angle (int): 0 ~ 100
2350
+ gripper_id (int) : 1 ~ 254
2340
2351
  """
2352
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id, gripper_angle=gripper_angle)
2341
2353
  return self.__set_tool_fittings_value(
2342
- FingerGripper.SET_HAND_GRIPPER_ANGLE, [joint_id], [gripper_angle], gripper_id=gripper_id
2354
+ FingerGripper.SET_HAND_GRIPPER_ANGLE, [hand_id], [gripper_angle], gripper_id=gripper_id
2343
2355
  )
2344
2356
 
2345
- def get_hand_gripper_angle(self, gripper_id, joint_id):
2357
+ def get_hand_gripper_angle(self, hand_id, gripper_id=14):
2346
2358
  """Get the angle of the single joint of the gripper
2347
2359
 
2348
2360
  Args:
2361
+ hand_id (int): 1 ~ 6
2349
2362
  gripper_id (int) : 1 ~ 254
2350
- joint_id (int): 1 ~ 6
2351
2363
 
2352
2364
  Return:
2353
2365
  gripper_angle (int): 0 ~ 100
2354
2366
  """
2367
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2355
2368
  return self.__get_tool_fittings_value(
2356
- FingerGripper.GET_HAND_GRIPPER_ANGLE, [joint_id], gripper_id=gripper_id
2369
+ FingerGripper.GET_HAND_GRIPPER_ANGLE, [hand_id], gripper_id=gripper_id
2357
2370
  )
2358
2371
 
2359
- def set_hand_gripper_angles(self, gripper_id, angles, speed):
2372
+ def set_hand_gripper_angles(self, angles, speed, gripper_id=14):
2373
+ self.calibration_parameters(class_name=self.__class__.__name__, speed=speed)
2360
2374
  return self.__set_tool_fittings_value(
2361
2375
  FingerGripper.SET_HAND_GRIPPER_ANGLES, [angles], [speed], gripper_id=gripper_id
2362
2376
  )
2363
2377
 
2364
- def get_hand_gripper_angles(self, gripper_id):
2378
+ def get_hand_gripper_angles(self, gripper_id=14):
2365
2379
  return self.__get_tool_fittings_value(FingerGripper.GET_HAND_ALL_ANGLES, gripper_id)
2366
2380
 
2367
- def set_hand_gripper_torque(self, gripper_id, joint_id, value):
2381
+ def set_hand_gripper_torque(self, hand_id, torque, gripper_id=14):
2382
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id, torque=torque)
2368
2383
  return self.__set_tool_fittings_value(
2369
- FingerGripper.SET_HAND_GRIPPER_TORQUE, [joint_id], [value], gripper_id=gripper_id
2384
+ FingerGripper.SET_HAND_GRIPPER_TORQUE, [hand_id], [torque], gripper_id=gripper_id
2370
2385
  )
2371
2386
 
2372
- def get_hand_gripper_torque(self, gripper_id, joint_id):
2387
+ def get_hand_gripper_torque(self, hand_id, gripper_id=14):
2388
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2373
2389
  return self.__get_tool_fittings_value(
2374
- FingerGripper.GET_HAND_GRIPPER_TORQUE, [joint_id], gripper_id=gripper_id
2390
+ FingerGripper.GET_HAND_GRIPPER_TORQUE, [hand_id], gripper_id=gripper_id
2375
2391
  )
2376
2392
 
2377
- def set_hand_gripper_calibrate(self, gripper_id, joint_id):
2393
+ def set_hand_gripper_calibrate(self, hand_id, gripper_id=14):
2378
2394
  """ Setting the gripper jaw zero position
2379
2395
 
2380
2396
  Args:
2397
+ hand_id (int): 1 ~ 6
2381
2398
  gripper_id (int): 1 ~ 254
2382
- joint_id (int): 1 ~ 6
2383
2399
  """
2400
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2384
2401
  return self.__set_tool_fittings_value(
2385
- FingerGripper.SET_HAND_GRIPPER_CALIBRATION, [joint_id], gripper_id=gripper_id
2402
+ FingerGripper.SET_HAND_GRIPPER_CALIBRATION, [hand_id], gripper_id=gripper_id
2386
2403
  )
2387
2404
 
2388
- def get_hand_gripper_status(self, gripper_id):
2405
+ def get_hand_gripper_status(self, gripper_id=14):
2389
2406
  """ Get the clamping status of the gripper
2390
2407
 
2391
2408
  Args:
@@ -2401,47 +2418,50 @@ class MercuryCommandGenerator(DataProcessor):
2401
2418
  FingerGripper.GET_HAND_GRIPPER_STATUS, gripper_id=gripper_id
2402
2419
  )
2403
2420
 
2404
- def set_hand_gripper_enabled(self, gripper_id, flag):
2421
+ def set_hand_gripper_enabled(self, flag, gripper_id=14):
2405
2422
  """ Set the enable state of the gripper
2406
2423
 
2407
2424
  Args:
2408
2425
  gripper_id (int): 1 ~ 254
2409
- flag (int): 1 ~ 6
2426
+ flag (int): 0 or 1
2410
2427
 
2411
2428
  """
2429
+ self.calibration_parameters(class_name=self.__class__.__name__, flag=flag)
2412
2430
  return self.__set_tool_fittings_value(
2413
2431
  FingerGripper.SET_HAND_GRIPPER_ENABLED, [flag], gripper_id=gripper_id
2414
2432
  )
2415
2433
 
2416
- def set_hand_gripper_speed(self, gripper_id, joint_id, speed):
2434
+ def set_hand_gripper_speed(self, hand_id, speed, gripper_id=14):
2417
2435
  """ Set the speed of the gripper
2418
2436
 
2419
2437
  Args:
2420
- gripper_id (int): 1 ~ 254
2421
- joint_id (int): 1 ~ 6
2438
+ hand_id (int): 1 ~ 6
2422
2439
  speed (int): 1 ~ 100
2440
+ gripper_id (int): 1 ~ 254
2423
2441
 
2424
2442
  """
2443
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id, speed=speed)
2425
2444
  return self.__set_tool_fittings_value(
2426
- FingerGripper.SET_HAND_GRIPPER_SPEED, [joint_id], [speed], gripper_id=gripper_id
2445
+ FingerGripper.SET_HAND_GRIPPER_SPEED, [hand_id], [speed], gripper_id=gripper_id
2427
2446
  )
2428
2447
 
2429
- def get_hand_gripper_default_speed(self, gripper_id, joint_id):
2448
+ def get_hand_gripper_default_speed(self, hand_id, gripper_id=14):
2430
2449
  """ Get the default speed of the gripper
2431
2450
 
2432
2451
  Args:
2452
+ hand_id (int): 1 ~ 6
2433
2453
  gripper_id (int): 1 ~ 254
2434
- joint_id (int): 1 ~ 6
2435
2454
 
2436
2455
  Return:
2437
2456
  default speed (int): 1 ~ 100
2438
2457
 
2439
2458
  """
2459
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2440
2460
  return self.__set_tool_fittings_value(
2441
- FingerGripper.GET_HAND_GRIPPER_DEFAULT_SPEED, [joint_id], gripper_id=gripper_id
2461
+ FingerGripper.GET_HAND_GRIPPER_DEFAULT_SPEED, [hand_id], gripper_id=gripper_id
2442
2462
  )
2443
2463
 
2444
- def set_hand_gripper_pinch_action(self, gripper_id, pinch_mode):
2464
+ def set_hand_gripper_pinch_action(self, pinch_mode, gripper_id=14):
2445
2465
  """ Set the pinching action of the gripper
2446
2466
 
2447
2467
  Args:
@@ -2452,107 +2472,121 @@ class MercuryCommandGenerator(DataProcessor):
2452
2472
  2 - Three-finger grip
2453
2473
  3 - Two-finger grip
2454
2474
  """
2475
+ self.calibration_parameters(class_name=self.__class__.__name__, pinch_mode=pinch_mode)
2455
2476
  return self.__set_tool_fittings_value(
2456
2477
  FingerGripper.SET_HAND_GRIPPER_PINCH_ACTION, pinch_mode, gripper_id=gripper_id
2457
2478
  )
2458
2479
 
2459
- def set_hand_gripper_p(self, gripper_id, joint_id, value):
2480
+ def set_hand_gripper_p(self, hand_id, value, gripper_id=14):
2481
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2460
2482
  return self.__set_tool_fittings_value(
2461
- FingerGripper.SET_HAND_GRIPPER_P, [joint_id], [value], gripper_id=gripper_id
2483
+ FingerGripper.SET_HAND_GRIPPER_P, [hand_id], [value], gripper_id=gripper_id
2462
2484
  )
2463
2485
 
2464
- def get_hand_gripper_p(self, gripper_id, joint_id):
2486
+ def get_hand_gripper_p(self, hand_id, gripper_id=14):
2487
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2465
2488
  return self.__get_tool_fittings_value(
2466
- FingerGripper.GET_HAND_GRIPPER_P, [joint_id], gripper_id=gripper_id
2489
+ FingerGripper.GET_HAND_GRIPPER_P, [hand_id], gripper_id=gripper_id
2467
2490
  )
2468
2491
 
2469
- def set_hand_gripper_d(self, gripper_id, joint_id, value):
2492
+ def set_hand_gripper_d(self, hand_id, value, gripper_id=14):
2493
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2470
2494
  return self.__set_tool_fittings_value(
2471
- FingerGripper.SET_HAND_GRIPPER_D, [joint_id], [value], gripper_id=gripper_id
2495
+ FingerGripper.SET_HAND_GRIPPER_D, [hand_id], [value], gripper_id=gripper_id
2472
2496
  )
2473
2497
 
2474
- def get_hand_gripper_d(self, gripper_id, joint_id):
2498
+ def get_hand_gripper_d(self, hand_id, gripper_id=14):
2499
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2475
2500
  return self.__get_tool_fittings_value(
2476
- FingerGripper.GET_HAND_GRIPPER_D, [joint_id], gripper_id=gripper_id
2501
+ FingerGripper.GET_HAND_GRIPPER_D, [hand_id], gripper_id=gripper_id
2477
2502
  )
2478
2503
 
2479
- def set_hand_gripper_i(self, gripper_id, joint_id, value):
2504
+ def set_hand_gripper_i(self, hand_id, value, gripper_id=14):
2505
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2480
2506
  return self.__set_tool_fittings_value(
2481
- FingerGripper.SET_HAND_GRIPPER_I, [joint_id], [value], gripper_id=gripper_id
2507
+ FingerGripper.SET_HAND_GRIPPER_I, [hand_id], [value], gripper_id=gripper_id
2482
2508
  )
2483
2509
 
2484
- def get_hand_gripper_i(self, gripper_id, joint_id):
2510
+ def get_hand_gripper_i(self, hand_id, gripper_id=14):
2511
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2485
2512
  return self.__get_tool_fittings_value(
2486
- FingerGripper.GET_HAND_GRIPPER_I, [joint_id], gripper_id=gripper_id
2513
+ FingerGripper.GET_HAND_GRIPPER_I, [hand_id], gripper_id=gripper_id
2487
2514
  )
2488
2515
 
2489
- def set_hand_gripper_min_pressure(self, gripper_id, joint_id, value):
2516
+ def set_hand_gripper_min_pressure(self, hand_id, value, gripper_id=14):
2490
2517
  """ Set the minimum starting force of the single joint of the gripper
2491
2518
 
2492
2519
  Args:
2493
- gripper_id (int): 1 ~ 254
2494
- joint_id (int): 1 ~ 6
2520
+ hand_id (int): 1 ~ 6
2495
2521
  value (int): 0 ~ 254
2522
+ gripper_id (int): 1 ~ 254
2496
2523
 
2497
2524
  """
2525
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2498
2526
  return self.__get_tool_fittings_value(
2499
- FingerGripper.SET_HAND_GRIPPER_MIN_PRESSURE, [joint_id], [value], gripper_id=gripper_id
2527
+ FingerGripper.SET_HAND_GRIPPER_MIN_PRESSURE, [hand_id], [value], gripper_id=gripper_id
2500
2528
  )
2501
2529
 
2502
- def get_hand_gripper_min_pressure(self, gripper_id, joint_id):
2530
+ def get_hand_gripper_min_pressure(self, hand_id, gripper_id=14):
2503
2531
  """ Set the minimum starting force of the single joint of the gripper
2504
2532
 
2505
2533
  Args:
2506
2534
  gripper_id (int): 1 ~ 254
2507
- joint_id (int): 1 ~ 6
2535
+ hand_id (int): 1 ~ 6
2508
2536
 
2509
2537
  Return:
2510
2538
  min pressure value (int): 0 ~ 254
2511
2539
 
2512
2540
  """
2541
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2513
2542
  return self.__get_tool_fittings_value(
2514
- FingerGripper.SET_HAND_GRIPPER_MIN_PRESSURE, [joint_id], gripper_id=gripper_id
2543
+ FingerGripper.SET_HAND_GRIPPER_MIN_PRESSURE, [hand_id], gripper_id=gripper_id
2515
2544
  )
2516
2545
 
2517
- def set_hand_gripper_clockwise(self, gripper_id, joint_id, value):
2546
+ def set_hand_gripper_clockwise(self, hand_id, value, gripper_id=14):
2518
2547
  """
2519
2548
  state: 0 or 1, 0 - disable, 1 - enable
2520
2549
  """
2550
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2521
2551
  return self.__set_tool_fittings_value(
2522
- FingerGripper.SET_HAND_GRIPPER_CLOCKWISE, [joint_id], [value], gripper_id=gripper_id
2552
+ FingerGripper.SET_HAND_GRIPPER_CLOCKWISE, [hand_id], [value], gripper_id=gripper_id
2523
2553
  )
2524
2554
 
2525
- def get_hand_gripper_clockwise(self, gripper_id, joint_id):
2555
+ def get_hand_gripper_clockwise(self, hand_id, gripper_id=14):
2556
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2526
2557
  return self.__get_tool_fittings_value(
2527
- FingerGripper.GET_HAND_GRIPPER_CLOCKWISE, joint_id, gripper_id=gripper_id
2558
+ FingerGripper.GET_HAND_GRIPPER_CLOCKWISE, hand_id, gripper_id=gripper_id
2528
2559
  )
2529
2560
 
2530
- def set_hand_gripper_counterclockwise(self, gripper_id, joint_id, value):
2561
+ def set_hand_gripper_counterclockwise(self, hand_id, value, gripper_id=14):
2562
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2531
2563
  return self.__set_tool_fittings_value(
2532
- FingerGripper.SET_HAND_GRIPPER_COUNTERCLOCKWISE, [joint_id], [value], gripper_id=gripper_id
2564
+ FingerGripper.SET_HAND_GRIPPER_COUNTERCLOCKWISE, [hand_id], [value], gripper_id=gripper_id
2533
2565
  )
2534
2566
 
2535
- def get_hand_gripper_counterclockwise(self, gripper_id, joint_id):
2567
+ def get_hand_gripper_counterclockwise(self, hand_id, gripper_id=14):
2568
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2536
2569
  return self.__get_tool_fittings_value(
2537
- FingerGripper.GET_HAND_GRIPPER_COUNTERCLOCKWISE, [joint_id], gripper_id=gripper_id
2570
+ FingerGripper.GET_HAND_GRIPPER_COUNTERCLOCKWISE, [hand_id], gripper_id=gripper_id
2538
2571
  )
2539
2572
 
2540
- def get_hand_single_pressure_sensor(self, gripper_id, finger_id):
2573
+ def get_hand_single_pressure_sensor(self, hand_id, gripper_id=14):
2541
2574
  """ Get the counterclockwise runnable error of the single joint of the gripper
2542
2575
 
2543
2576
  Args:
2544
2577
  gripper_id (int): 1 ~ 254
2545
- finger_id (int): 1 ~ 5
2578
+ hand_id (int): 1 ~ 6
2546
2579
 
2547
2580
  Return:
2548
2581
  int: 0 ~ 4096
2549
2582
 
2550
2583
  """
2584
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2551
2585
  return self.__get_tool_fittings_value(
2552
- FingerGripper.GET_HAND_SINGLE_PRESSURE_SENSOR, [finger_id], gripper_id=gripper_id
2586
+ FingerGripper.GET_HAND_SINGLE_PRESSURE_SENSOR, [hand_id], gripper_id=gripper_id
2553
2587
  )
2554
2588
 
2555
- def get_hand_all_pressure_sensor(self, gripper_id):
2589
+ def get_hand_all_pressure_sensor(self, gripper_id=14):
2556
2590
  """ Get the counterclockwise runnable error of the single joint of the gripper
2557
2591
 
2558
2592
  Args:
@@ -2566,7 +2600,7 @@ class MercuryCommandGenerator(DataProcessor):
2566
2600
  FingerGripper.GET_HAND_ALL_PRESSURE_SENSOR, gripper_id=gripper_id
2567
2601
  )
2568
2602
 
2569
- def set_hand_gripper_pinch_action_speed_consort(self, gripper_id, pinch_pose, rank_mode, idle_flag=None):
2603
+ def set_hand_gripper_pinch_action_speed_consort(self, pinch_pose, rank_mode, gripper_id=14, idle_flag=None):
2570
2604
  """ Setting the gripper pinching action-speed coordination
2571
2605
 
2572
2606
  Args:
@@ -227,16 +227,16 @@ def _interpret_status_code(language, status_code):
227
227
  class RobotLimit:
228
228
  robot_limit = {
229
229
  "Mercury":{
230
- "joint_id":[1,2,3,4,5,6,11,12,13],
231
- "angles_min":[-165, -50, -173, -165, -165, -20, -180, -60, -140, -120],
232
- "angles_max":[165, 95, 5, 165, 165, 265, 180, 0, 190, 120],
230
+ "joint_id":[1,2,3,4,5,6,11,12],
231
+ "angles_min":[-165, -55, -173, -165, -20, -180, -60, -138],
232
+ "angles_max":[165, 95, 5, 165, 265, 180, 0, 188],
233
233
  "coords_min":[-351.11, -272.12, -262.91, -180, -180, -180],
234
234
  "coords_max":[566.92, 645.91, 655.13, 180, 180, 180]
235
235
  },
236
236
  "MercurySocket":{
237
- "joint_id":[1,2,3,4,5,6,11,12,13],
238
- "angles_min":[-165, -50, -173, -165, -20, -180, -60, -140, -120],
239
- "angles_max":[165, 95, 5, 165, 265, 180, 0, 190, 120],
237
+ "joint_id":[1,2,3,4,5,6,11,12],
238
+ "angles_min":[-165, -55, -173, -165, -20, -180, -60, -138],
239
+ "angles_max":[165, 95, 5, 165, 265, 180, 0, 188],
240
240
  "coords_min":[-351.11, -272.12, -262.91, -180, -180, -180],
241
241
  "coords_max":[566.92, 645.91, 655.13, 180, 180, 180]
242
242
  },
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pymycobot
3
- Version: 3.5.0.dev9
3
+ Version: 3.5.0.dev11
4
4
  Summary: Python API for serial communication of MyCobot.
5
5
  Home-page: https://github.com/elephantrobotics/pymycobot
6
6
  Author: Elephantrobotics
File without changes
File without changes