pymycobot 3.5.0.dev10__tar.gz → 3.5.0.dev12__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.dev10/pymycobot.egg-info → pymycobot-3.5.0.dev12}/PKG-INFO +1 -1
  2. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/__init__.py +1 -1
  3. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/error.py +34 -8
  4. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mercury_api.py +104 -70
  5. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/robot_info.py +16 -8
  6. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12/pymycobot.egg-info}/PKG-INFO +1 -1
  7. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/LICENSE +0 -0
  8. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/MANIFEST.in +0 -0
  9. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/README.md +0 -0
  10. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/Interface.py +0 -0
  11. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/bluet.py +0 -0
  12. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/close_loop.py +0 -0
  13. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/common.py +0 -0
  14. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/conveyor_api.py +0 -0
  15. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/dualcobotx.py +0 -0
  16. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/elephantrobot.py +0 -0
  17. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/generate.py +0 -0
  18. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/genre.py +0 -0
  19. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/log.py +0 -0
  20. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mecharm.py +0 -0
  21. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mecharm270.py +0 -0
  22. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mecharmsocket.py +0 -0
  23. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mercury.py +0 -0
  24. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mercury_arms_socket.py +0 -0
  25. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mercury_ros_api.py +0 -0
  26. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mercurychassis.py +0 -0
  27. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mercurychassis_api.py +0 -0
  28. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mercurysocket.py +0 -0
  29. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/myagv.py +0 -0
  30. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/myarm.py +0 -0
  31. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/myarm_api.py +0 -0
  32. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/myarmc.py +0 -0
  33. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/myarmm.py +0 -0
  34. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/myarmm_control.py +0 -0
  35. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/myarmsocket.py +0 -0
  36. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mybuddy.py +0 -0
  37. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mybuddybluetooth.py +0 -0
  38. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mybuddyemoticon.py +0 -0
  39. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mybuddysocket.py +0 -0
  40. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mycobot.py +0 -0
  41. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mycobot280.py +0 -0
  42. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mycobot280socket.py +0 -0
  43. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mycobot280x5pi.py +0 -0
  44. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mycobot320.py +0 -0
  45. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mycobot320socket.py +0 -0
  46. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mycobotpro630.py +0 -0
  47. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mycobotsocket.py +0 -0
  48. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mypalletizer.py +0 -0
  49. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mypalletizer260.py +0 -0
  50. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/mypalletizersocket.py +0 -0
  51. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/pro400.py +0 -0
  52. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/pro400client.py +0 -0
  53. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/pro630.py +0 -0
  54. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/pro630client.py +0 -0
  55. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/progripper.py +0 -0
  56. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/protocol_packet_handler.py +0 -0
  57. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/public.py +0 -0
  58. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/sms.py +0 -0
  59. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/tool_coords.py +0 -0
  60. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/ultraArm.py +0 -0
  61. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot/utils.py +0 -0
  62. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot.egg-info/SOURCES.txt +0 -0
  63. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot.egg-info/dependency_links.txt +0 -0
  64. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot.egg-info/requires.txt +0 -0
  65. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/pymycobot.egg-info/top_level.txt +0 -0
  66. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/requirements.txt +0 -0
  67. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/setup.cfg +0 -0
  68. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/setup.py +0 -0
  69. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/tests/__init__.py +0 -0
  70. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/tests/conftest.py +0 -0
  71. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/tests/rasp_myArm_test_gui.py +0 -0
  72. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/tests/rasp_mycobot_test_gui.py +0 -0
  73. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/tests/rasp_mypall_test_gui.py +0 -0
  74. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/tests/special_angles.py +0 -0
  75. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/tests/test_api.py +0 -0
  76. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/tests/test_generator.py +0 -0
  77. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/tests/test_socket.py +0 -0
  78. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev12}/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.dev10
3
+ Version: 3.5.0.dev12
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.0dev10"
90
+ __version__ = "3.5.0dev12"
91
91
  __author__ = "Elephantrobotics"
92
92
  __email__ = "weiquan.xu@elephantrobotics.com"
93
93
  __git_url__ = "https://github.com/elephantrobotics/pymycobot"
@@ -93,16 +93,26 @@ def check_value_type(parameter, value_type, exception_class, _type):
93
93
  "The acceptable parameter {} should be an {}, but the received {}".format(parameter, _type, value_type))
94
94
 
95
95
 
96
- def check_coords(value, robot_limit, class_name, exception_class):
96
+ def check_coords(value, robot_limit, class_name, exception_class, serial_port=None):
97
97
  if not isinstance(value, list):
98
98
  raise exception_class("`coords` must be a list.")
99
99
  if len(value) != 6:
100
100
  raise exception_class("The length of `coords` must be 6.")
101
+ if serial_port:
102
+ if serial_port == "/dev/left_arm":
103
+ min_coord = robot_limit[class_name]["left_coords_min"]
104
+ max_coord = robot_limit[class_name]["left_coords_max"]
105
+ elif serial_port == "/dev/right_arm":
106
+ min_coord = robot_limit[class_name]["right_coords_min"]
107
+ max_coord = robot_limit[class_name]["right_coords_max"]
108
+ else:
109
+ min_coord = robot_limit[class_name]["coords_min"]
110
+ max_coord = robot_limit[class_name]["coords_max"]
101
111
  for idx, coord in enumerate(value):
102
- if not robot_limit[class_name]["coords_min"][idx] <= coord <= robot_limit[class_name]["coords_max"][idx]:
112
+ if not min_coord[idx] <= coord <= max_coord[idx]:
103
113
  raise exception_class(
104
114
  "Has invalid coord value, error on index {0}. received {3} .but angle should be {1} ~ {2}.".format(
105
- idx, robot_limit[class_name]["coords_min"][idx], robot_limit[class_name]["coords_max"][idx], coord
115
+ idx, min_coord, max_coord, coord
106
116
  )
107
117
  )
108
118
 
@@ -291,8 +301,8 @@ def calibration_parameters(**kwargs):
291
301
  check_id(value, robot_limit[class_name][parameter], MercuryDataException)
292
302
  elif parameter == 'angle':
293
303
  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
304
+ if joint_id in [11,12]:
305
+ index = robot_limit[class_name]['joint_id'][joint_id-5] - 5
296
306
  else:
297
307
  index = robot_limit[class_name]['joint_id'][joint_id-1] - 1
298
308
  if value < robot_limit[class_name]["angles_min"][index] or value > robot_limit[class_name]["angles_max"][index]:
@@ -316,15 +326,26 @@ def calibration_parameters(**kwargs):
316
326
 
317
327
  elif parameter == 'coord':
318
328
  index = kwargs.get('coord_id', None) - 1
319
- if value < robot_limit[class_name]["coords_min"][index] or value > robot_limit[class_name]["coords_max"][index]:
329
+ serial_port = kwargs.get('serial_port', None)
330
+ if serial_port == "/dev/left_arm":
331
+ min_coord = robot_limit[class_name]["left_coords_min"][index]
332
+ max_coord = robot_limit[class_name]["left_coords_max"][index]
333
+ elif serial_port == "/dev/right_arm":
334
+ min_coord = robot_limit[class_name]["right_coords_min"][index]
335
+ max_coord = robot_limit[class_name]["right_coords_max"][index]
336
+ else:
337
+ min_coord = robot_limit[class_name]["coords_min"][index]
338
+ max_coord = robot_limit[class_name]["coords_max"][index]
339
+ if value < min_coord or value > min_coord:
320
340
  raise MercuryDataException(
321
341
  "The coord value of {} exceeds the limit, and the limit range is {} ~ {}".format(
322
- value, robot_limit[class_name]["coords_min"][index], robot_limit[class_name]["coords_max"][index]
342
+ value, min_coord, max_coord
323
343
  )
324
344
  )
325
345
  elif parameter == 'coords':
346
+ serial_port = kwargs.get('serial_port', None)
326
347
  check_coords(value, robot_limit, class_name,
327
- MercuryDataException)
348
+ MercuryDataException, serial_port)
328
349
 
329
350
  elif parameter == 'speed':
330
351
  if not 1 <= value <= 100:
@@ -413,6 +434,11 @@ def calibration_parameters(**kwargs):
413
434
  elif parameter == "torque":
414
435
  if value < 0 or value > 100:
415
436
  raise MercuryDataException("The parameter {} only supports 0 ~ 100, but received {}".format(parameter, value))
437
+ elif parameter == "hand_id":
438
+ if value < 1 or value > 6:
439
+ raise MercuryDataException("The parameter {} only supports 1 ~ 6, but received {}".format(parameter, value))
440
+ elif parameter == 'pinch_mode':
441
+ check_0_or_1(parameter, value, [0, 1, 2, 3], value_type, MercuryDataException, int)
416
442
  else:
417
443
  public_check(parameter_list, kwargs, robot_limit, class_name, MercuryDataException)
418
444
  elif class_name == "MyAgv":
@@ -167,7 +167,8 @@ class MercuryCommandGenerator(DataProcessor):
167
167
  ProtocolCode.JOG_BASE_INCREMENT_COORD,
168
168
  ProtocolCode.WRITE_MOVE_C,
169
169
  ProtocolCode.JOG_RPY,
170
- ProtocolCode.WRITE_MOVE_C_R] and self.sync_mode:
170
+ ProtocolCode.WRITE_MOVE_C_R,
171
+ ProtocolCode.MERCURY_DRAG_TECH_EXECUTE] and self.sync_mode:
171
172
  wait_time = 300
172
173
  is_in_position = True
173
174
  big_wait_time = True
@@ -396,12 +397,12 @@ class MercuryCommandGenerator(DataProcessor):
396
397
  one = valid_data[i: i + 2]
397
398
  res.append(self._decode_int16(one))
398
399
  i += 2
399
- elif data_len == 36 and genre == ProtocolCode.MERCURY_ROBOT_STATUS:
400
+ elif data_len in [32, 36] and genre == ProtocolCode.MERCURY_ROBOT_STATUS:
400
401
  # 图灵右臂上位机错误:2+6+8*2+6*2 = 36
401
402
  i = 0
402
403
  res = []
403
404
  while i < data_len:
404
- if i < 9:
405
+ if i < 8:
405
406
  res.append(valid_data[i])
406
407
  i += 1
407
408
  else:
@@ -984,7 +985,7 @@ class MercuryCommandGenerator(DataProcessor):
984
985
  speed (int): 1 ~ 100
985
986
  """
986
987
  self.calibration_parameters(
987
- class_name=self.__class__.__name__, coord_id=coord_id, coord=coord, speed=speed)
988
+ class_name=self.__class__.__name__, coord_id=coord_id, coord=coord, speed=speed, serial_port=self._serial_port.port)
988
989
  if coord_id < 4:
989
990
  coord = self._coord2int(coord)
990
991
  else:
@@ -1000,7 +1001,7 @@ class MercuryCommandGenerator(DataProcessor):
1000
1001
  speed (int): 1 ~ 100
1001
1002
  """
1002
1003
  self.calibration_parameters(
1003
- class_name=self.__class__.__name__, coords=coords, speed=speed)
1004
+ class_name=self.__class__.__name__, coords=coords, speed=speed, serial_port=self._serial_port.port)
1004
1005
  coord_list = []
1005
1006
  for idx in range(3):
1006
1007
  coord_list.append(self._coord2int(coords[idx]))
@@ -1036,7 +1037,7 @@ class MercuryCommandGenerator(DataProcessor):
1036
1037
 
1037
1038
  def drag_teach_execute(self):
1038
1039
  """Start dragging the teaching point and only execute it once."""
1039
- return self._mesg(ProtocolCode.MERCURY_DRAG_TECH_EXECUTE)
1040
+ return self._mesg(ProtocolCode.MERCURY_DRAG_TECH_EXECUTE, has_reply=True)
1040
1041
 
1041
1042
  def drag_teach_pause(self):
1042
1043
  """Pause recording of dragging teaching point"""
@@ -2110,7 +2111,15 @@ class MercuryCommandGenerator(DataProcessor):
2110
2111
  for angle in new_coords[3:]:
2111
2112
  coord_list.append(self._angle2int(angle))
2112
2113
  angles = [self._angle2int(angle) for angle in old_angles]
2113
- return self._mesg(ProtocolCode.SOLVE_INV_KINEMATICS, coord_list, angles, has_reply=True)
2114
+ res = self._mesg(ProtocolCode.SOLVE_INV_KINEMATICS, coord_list, angles, has_reply=True)
2115
+ r = True
2116
+ if isinstance(res, list):
2117
+ for i in res:
2118
+ if i == -572.95:
2119
+ r = False
2120
+ else:
2121
+ r = True
2122
+ return None if r == False else res
2114
2123
 
2115
2124
  def get_drag_fifo(self):
2116
2125
  return self._mesg(ProtocolCode.GET_DRAG_FIFO)
@@ -2307,86 +2316,94 @@ class MercuryCommandGenerator(DataProcessor):
2307
2316
 
2308
2317
  def __set_tool_fittings_value(self, addr, *args, gripper_id=14, **kwargs):
2309
2318
  kwargs["has_replay"] = True
2319
+ self.calibration_parameters(class_name=self.__class__.__name__, gripper_id=gripper_id)
2310
2320
  return self._mesg(ProtocolCode.MERCURY_SET_TOQUE_GRIPPER, gripper_id, [addr], *args or ([0x00],), **kwargs)
2311
2321
 
2312
2322
  def __get_tool_fittings_value(self, addr, *args, gripper_id=14, **kwargs):
2313
2323
  kwargs["has_replay"] = True
2314
2324
  return self._mesg(ProtocolCode.MERCURY_GET_TOQUE_GRIPPER, gripper_id, [addr], *args or ([0x00],), **kwargs)
2315
2325
 
2316
- def get_hand_firmware_major_version(self, gripper_id):
2326
+ def get_hand_firmware_major_version(self, gripper_id=14):
2317
2327
  return self.__get_tool_fittings_value(
2318
2328
  FingerGripper.GET_HAND_MAJOR_FIRMWARE_VERSION, gripper_id=gripper_id
2319
2329
  )
2320
2330
 
2321
- def get_hand_firmware_minor_version(self, gripper_id):
2331
+ def get_hand_firmware_minor_version(self, gripper_id=14):
2322
2332
  return self.__get_tool_fittings_value(FingerGripper.GET_HAND_MINOR_FIRMWARE_VERSION, gripper_id=gripper_id)
2323
2333
 
2324
- def set_hand_gripper_id(self, gripper_id, hand_id):
2334
+ def set_hand_gripper_id(self, hand_id, gripper_id=14):
2335
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2325
2336
  return self.__set_tool_fittings_value(
2326
2337
  FingerGripper.SET_HAND_GRIPPER_ID, [hand_id], gripper_id=gripper_id
2327
2338
  )
2328
2339
 
2329
- def get_hand_gripper_id(self, gripper_id):
2340
+ def get_hand_gripper_id(self, gripper_id=14):
2330
2341
  return self.__get_tool_fittings_value(
2331
2342
  FingerGripper.GET_HAND_GRIPPER_ID, gripper_id=gripper_id
2332
2343
  )
2333
2344
 
2334
- def set_hand_gripper_angle(self, gripper_id, joint_id, gripper_angle):
2345
+ def set_hand_gripper_angle(self, hand_id, gripper_angle, gripper_id=14):
2335
2346
  """Set the angle of the single joint of the gripper
2336
2347
 
2337
2348
  Args:
2338
- gripper_id (int) : 1 ~ 254
2339
- joint_id (int): 1 ~ 6
2349
+ hand_id (int): 1 ~ 6
2340
2350
  gripper_angle (int): 0 ~ 100
2351
+ gripper_id (int) : 1 ~ 254
2341
2352
  """
2353
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id, gripper_angle=gripper_angle)
2342
2354
  return self.__set_tool_fittings_value(
2343
- FingerGripper.SET_HAND_GRIPPER_ANGLE, [joint_id], [gripper_angle], gripper_id=gripper_id
2355
+ FingerGripper.SET_HAND_GRIPPER_ANGLE, [hand_id], [gripper_angle], gripper_id=gripper_id
2344
2356
  )
2345
2357
 
2346
- def get_hand_gripper_angle(self, gripper_id, joint_id):
2358
+ def get_hand_gripper_angle(self, hand_id, gripper_id=14):
2347
2359
  """Get the angle of the single joint of the gripper
2348
2360
 
2349
2361
  Args:
2362
+ hand_id (int): 1 ~ 6
2350
2363
  gripper_id (int) : 1 ~ 254
2351
- joint_id (int): 1 ~ 6
2352
2364
 
2353
2365
  Return:
2354
2366
  gripper_angle (int): 0 ~ 100
2355
2367
  """
2368
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2356
2369
  return self.__get_tool_fittings_value(
2357
- FingerGripper.GET_HAND_GRIPPER_ANGLE, [joint_id], gripper_id=gripper_id
2370
+ FingerGripper.GET_HAND_GRIPPER_ANGLE, [hand_id], gripper_id=gripper_id
2358
2371
  )
2359
2372
 
2360
- def set_hand_gripper_angles(self, gripper_id, angles, speed):
2373
+ def set_hand_gripper_angles(self, angles, speed, gripper_id=14):
2374
+ self.calibration_parameters(class_name=self.__class__.__name__, speed=speed)
2361
2375
  return self.__set_tool_fittings_value(
2362
2376
  FingerGripper.SET_HAND_GRIPPER_ANGLES, [angles], [speed], gripper_id=gripper_id
2363
2377
  )
2364
2378
 
2365
- def get_hand_gripper_angles(self, gripper_id):
2379
+ def get_hand_gripper_angles(self, gripper_id=14):
2366
2380
  return self.__get_tool_fittings_value(FingerGripper.GET_HAND_ALL_ANGLES, gripper_id)
2367
2381
 
2368
- def set_hand_gripper_torque(self, gripper_id, joint_id, value):
2382
+ def set_hand_gripper_torque(self, hand_id, torque, gripper_id=14):
2383
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id, torque=torque)
2369
2384
  return self.__set_tool_fittings_value(
2370
- FingerGripper.SET_HAND_GRIPPER_TORQUE, [joint_id], [value], gripper_id=gripper_id
2385
+ FingerGripper.SET_HAND_GRIPPER_TORQUE, [hand_id], [torque], gripper_id=gripper_id
2371
2386
  )
2372
2387
 
2373
- def get_hand_gripper_torque(self, gripper_id, joint_id):
2388
+ def get_hand_gripper_torque(self, hand_id, gripper_id=14):
2389
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2374
2390
  return self.__get_tool_fittings_value(
2375
- FingerGripper.GET_HAND_GRIPPER_TORQUE, [joint_id], gripper_id=gripper_id
2391
+ FingerGripper.GET_HAND_GRIPPER_TORQUE, [hand_id], gripper_id=gripper_id
2376
2392
  )
2377
2393
 
2378
- def set_hand_gripper_calibrate(self, gripper_id, joint_id):
2394
+ def set_hand_gripper_calibrate(self, hand_id, gripper_id=14):
2379
2395
  """ Setting the gripper jaw zero position
2380
2396
 
2381
2397
  Args:
2398
+ hand_id (int): 1 ~ 6
2382
2399
  gripper_id (int): 1 ~ 254
2383
- joint_id (int): 1 ~ 6
2384
2400
  """
2401
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2385
2402
  return self.__set_tool_fittings_value(
2386
- FingerGripper.SET_HAND_GRIPPER_CALIBRATION, [joint_id], gripper_id=gripper_id
2403
+ FingerGripper.SET_HAND_GRIPPER_CALIBRATION, [hand_id], gripper_id=gripper_id
2387
2404
  )
2388
2405
 
2389
- def get_hand_gripper_status(self, gripper_id):
2406
+ def get_hand_gripper_status(self, gripper_id=14):
2390
2407
  """ Get the clamping status of the gripper
2391
2408
 
2392
2409
  Args:
@@ -2402,47 +2419,50 @@ class MercuryCommandGenerator(DataProcessor):
2402
2419
  FingerGripper.GET_HAND_GRIPPER_STATUS, gripper_id=gripper_id
2403
2420
  )
2404
2421
 
2405
- def set_hand_gripper_enabled(self, gripper_id, flag):
2422
+ def set_hand_gripper_enabled(self, flag, gripper_id=14):
2406
2423
  """ Set the enable state of the gripper
2407
2424
 
2408
2425
  Args:
2409
2426
  gripper_id (int): 1 ~ 254
2410
- flag (int): 1 ~ 6
2427
+ flag (int): 0 or 1
2411
2428
 
2412
2429
  """
2430
+ self.calibration_parameters(class_name=self.__class__.__name__, flag=flag)
2413
2431
  return self.__set_tool_fittings_value(
2414
2432
  FingerGripper.SET_HAND_GRIPPER_ENABLED, [flag], gripper_id=gripper_id
2415
2433
  )
2416
2434
 
2417
- def set_hand_gripper_speed(self, gripper_id, joint_id, speed):
2435
+ def set_hand_gripper_speed(self, hand_id, speed, gripper_id=14):
2418
2436
  """ Set the speed of the gripper
2419
2437
 
2420
2438
  Args:
2421
- gripper_id (int): 1 ~ 254
2422
- joint_id (int): 1 ~ 6
2439
+ hand_id (int): 1 ~ 6
2423
2440
  speed (int): 1 ~ 100
2441
+ gripper_id (int): 1 ~ 254
2424
2442
 
2425
2443
  """
2444
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id, speed=speed)
2426
2445
  return self.__set_tool_fittings_value(
2427
- FingerGripper.SET_HAND_GRIPPER_SPEED, [joint_id], [speed], gripper_id=gripper_id
2446
+ FingerGripper.SET_HAND_GRIPPER_SPEED, [hand_id], [speed], gripper_id=gripper_id
2428
2447
  )
2429
2448
 
2430
- def get_hand_gripper_default_speed(self, gripper_id, joint_id):
2449
+ def get_hand_gripper_default_speed(self, hand_id, gripper_id=14):
2431
2450
  """ Get the default speed of the gripper
2432
2451
 
2433
2452
  Args:
2453
+ hand_id (int): 1 ~ 6
2434
2454
  gripper_id (int): 1 ~ 254
2435
- joint_id (int): 1 ~ 6
2436
2455
 
2437
2456
  Return:
2438
2457
  default speed (int): 1 ~ 100
2439
2458
 
2440
2459
  """
2460
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2441
2461
  return self.__set_tool_fittings_value(
2442
- FingerGripper.GET_HAND_GRIPPER_DEFAULT_SPEED, [joint_id], gripper_id=gripper_id
2462
+ FingerGripper.GET_HAND_GRIPPER_DEFAULT_SPEED, [hand_id], gripper_id=gripper_id
2443
2463
  )
2444
2464
 
2445
- def set_hand_gripper_pinch_action(self, gripper_id, pinch_mode):
2465
+ def set_hand_gripper_pinch_action(self, pinch_mode, gripper_id=14):
2446
2466
  """ Set the pinching action of the gripper
2447
2467
 
2448
2468
  Args:
@@ -2453,107 +2473,121 @@ class MercuryCommandGenerator(DataProcessor):
2453
2473
  2 - Three-finger grip
2454
2474
  3 - Two-finger grip
2455
2475
  """
2476
+ self.calibration_parameters(class_name=self.__class__.__name__, pinch_mode=pinch_mode)
2456
2477
  return self.__set_tool_fittings_value(
2457
2478
  FingerGripper.SET_HAND_GRIPPER_PINCH_ACTION, pinch_mode, gripper_id=gripper_id
2458
2479
  )
2459
2480
 
2460
- def set_hand_gripper_p(self, gripper_id, joint_id, value):
2481
+ def set_hand_gripper_p(self, hand_id, value, gripper_id=14):
2482
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2461
2483
  return self.__set_tool_fittings_value(
2462
- FingerGripper.SET_HAND_GRIPPER_P, [joint_id], [value], gripper_id=gripper_id
2484
+ FingerGripper.SET_HAND_GRIPPER_P, [hand_id], [value], gripper_id=gripper_id
2463
2485
  )
2464
2486
 
2465
- def get_hand_gripper_p(self, gripper_id, joint_id):
2487
+ def get_hand_gripper_p(self, hand_id, gripper_id=14):
2488
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2466
2489
  return self.__get_tool_fittings_value(
2467
- FingerGripper.GET_HAND_GRIPPER_P, [joint_id], gripper_id=gripper_id
2490
+ FingerGripper.GET_HAND_GRIPPER_P, [hand_id], gripper_id=gripper_id
2468
2491
  )
2469
2492
 
2470
- def set_hand_gripper_d(self, gripper_id, joint_id, value):
2493
+ def set_hand_gripper_d(self, hand_id, value, gripper_id=14):
2494
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2471
2495
  return self.__set_tool_fittings_value(
2472
- FingerGripper.SET_HAND_GRIPPER_D, [joint_id], [value], gripper_id=gripper_id
2496
+ FingerGripper.SET_HAND_GRIPPER_D, [hand_id], [value], gripper_id=gripper_id
2473
2497
  )
2474
2498
 
2475
- def get_hand_gripper_d(self, gripper_id, joint_id):
2499
+ def get_hand_gripper_d(self, hand_id, gripper_id=14):
2500
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2476
2501
  return self.__get_tool_fittings_value(
2477
- FingerGripper.GET_HAND_GRIPPER_D, [joint_id], gripper_id=gripper_id
2502
+ FingerGripper.GET_HAND_GRIPPER_D, [hand_id], gripper_id=gripper_id
2478
2503
  )
2479
2504
 
2480
- def set_hand_gripper_i(self, gripper_id, joint_id, value):
2505
+ def set_hand_gripper_i(self, hand_id, value, gripper_id=14):
2506
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2481
2507
  return self.__set_tool_fittings_value(
2482
- FingerGripper.SET_HAND_GRIPPER_I, [joint_id], [value], gripper_id=gripper_id
2508
+ FingerGripper.SET_HAND_GRIPPER_I, [hand_id], [value], gripper_id=gripper_id
2483
2509
  )
2484
2510
 
2485
- def get_hand_gripper_i(self, gripper_id, joint_id):
2511
+ def get_hand_gripper_i(self, hand_id, gripper_id=14):
2512
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2486
2513
  return self.__get_tool_fittings_value(
2487
- FingerGripper.GET_HAND_GRIPPER_I, [joint_id], gripper_id=gripper_id
2514
+ FingerGripper.GET_HAND_GRIPPER_I, [hand_id], gripper_id=gripper_id
2488
2515
  )
2489
2516
 
2490
- def set_hand_gripper_min_pressure(self, gripper_id, joint_id, value):
2517
+ def set_hand_gripper_min_pressure(self, hand_id, value, gripper_id=14):
2491
2518
  """ Set the minimum starting force of the single joint of the gripper
2492
2519
 
2493
2520
  Args:
2494
- gripper_id (int): 1 ~ 254
2495
- joint_id (int): 1 ~ 6
2521
+ hand_id (int): 1 ~ 6
2496
2522
  value (int): 0 ~ 254
2523
+ gripper_id (int): 1 ~ 254
2497
2524
 
2498
2525
  """
2526
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2499
2527
  return self.__get_tool_fittings_value(
2500
- FingerGripper.SET_HAND_GRIPPER_MIN_PRESSURE, [joint_id], [value], gripper_id=gripper_id
2528
+ FingerGripper.SET_HAND_GRIPPER_MIN_PRESSURE, [hand_id], [value], gripper_id=gripper_id
2501
2529
  )
2502
2530
 
2503
- def get_hand_gripper_min_pressure(self, gripper_id, joint_id):
2531
+ def get_hand_gripper_min_pressure(self, hand_id, gripper_id=14):
2504
2532
  """ Set the minimum starting force of the single joint of the gripper
2505
2533
 
2506
2534
  Args:
2507
2535
  gripper_id (int): 1 ~ 254
2508
- joint_id (int): 1 ~ 6
2536
+ hand_id (int): 1 ~ 6
2509
2537
 
2510
2538
  Return:
2511
2539
  min pressure value (int): 0 ~ 254
2512
2540
 
2513
2541
  """
2542
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2514
2543
  return self.__get_tool_fittings_value(
2515
- FingerGripper.SET_HAND_GRIPPER_MIN_PRESSURE, [joint_id], gripper_id=gripper_id
2544
+ FingerGripper.SET_HAND_GRIPPER_MIN_PRESSURE, [hand_id], gripper_id=gripper_id
2516
2545
  )
2517
2546
 
2518
- def set_hand_gripper_clockwise(self, gripper_id, joint_id, value):
2547
+ def set_hand_gripper_clockwise(self, hand_id, value, gripper_id=14):
2519
2548
  """
2520
2549
  state: 0 or 1, 0 - disable, 1 - enable
2521
2550
  """
2551
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2522
2552
  return self.__set_tool_fittings_value(
2523
- FingerGripper.SET_HAND_GRIPPER_CLOCKWISE, [joint_id], [value], gripper_id=gripper_id
2553
+ FingerGripper.SET_HAND_GRIPPER_CLOCKWISE, [hand_id], [value], gripper_id=gripper_id
2524
2554
  )
2525
2555
 
2526
- def get_hand_gripper_clockwise(self, gripper_id, joint_id):
2556
+ def get_hand_gripper_clockwise(self, hand_id, gripper_id=14):
2557
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2527
2558
  return self.__get_tool_fittings_value(
2528
- FingerGripper.GET_HAND_GRIPPER_CLOCKWISE, joint_id, gripper_id=gripper_id
2559
+ FingerGripper.GET_HAND_GRIPPER_CLOCKWISE, hand_id, gripper_id=gripper_id
2529
2560
  )
2530
2561
 
2531
- def set_hand_gripper_counterclockwise(self, gripper_id, joint_id, value):
2562
+ def set_hand_gripper_counterclockwise(self, hand_id, value, gripper_id=14):
2563
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2532
2564
  return self.__set_tool_fittings_value(
2533
- FingerGripper.SET_HAND_GRIPPER_COUNTERCLOCKWISE, [joint_id], [value], gripper_id=gripper_id
2565
+ FingerGripper.SET_HAND_GRIPPER_COUNTERCLOCKWISE, [hand_id], [value], gripper_id=gripper_id
2534
2566
  )
2535
2567
 
2536
- def get_hand_gripper_counterclockwise(self, gripper_id, joint_id):
2568
+ def get_hand_gripper_counterclockwise(self, hand_id, gripper_id=14):
2569
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2537
2570
  return self.__get_tool_fittings_value(
2538
- FingerGripper.GET_HAND_GRIPPER_COUNTERCLOCKWISE, [joint_id], gripper_id=gripper_id
2571
+ FingerGripper.GET_HAND_GRIPPER_COUNTERCLOCKWISE, [hand_id], gripper_id=gripper_id
2539
2572
  )
2540
2573
 
2541
- def get_hand_single_pressure_sensor(self, gripper_id, finger_id):
2574
+ def get_hand_single_pressure_sensor(self, hand_id, gripper_id=14):
2542
2575
  """ Get the counterclockwise runnable error of the single joint of the gripper
2543
2576
 
2544
2577
  Args:
2545
2578
  gripper_id (int): 1 ~ 254
2546
- finger_id (int): 1 ~ 5
2579
+ hand_id (int): 1 ~ 6
2547
2580
 
2548
2581
  Return:
2549
2582
  int: 0 ~ 4096
2550
2583
 
2551
2584
  """
2585
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2552
2586
  return self.__get_tool_fittings_value(
2553
- FingerGripper.GET_HAND_SINGLE_PRESSURE_SENSOR, [finger_id], gripper_id=gripper_id
2587
+ FingerGripper.GET_HAND_SINGLE_PRESSURE_SENSOR, [hand_id], gripper_id=gripper_id
2554
2588
  )
2555
2589
 
2556
- def get_hand_all_pressure_sensor(self, gripper_id):
2590
+ def get_hand_all_pressure_sensor(self, gripper_id=14):
2557
2591
  """ Get the counterclockwise runnable error of the single joint of the gripper
2558
2592
 
2559
2593
  Args:
@@ -2567,7 +2601,7 @@ class MercuryCommandGenerator(DataProcessor):
2567
2601
  FingerGripper.GET_HAND_ALL_PRESSURE_SENSOR, gripper_id=gripper_id
2568
2602
  )
2569
2603
 
2570
- def set_hand_gripper_pinch_action_speed_consort(self, gripper_id, pinch_pose, rank_mode, idle_flag=None):
2604
+ def set_hand_gripper_pinch_action_speed_consort(self, pinch_pose, rank_mode, gripper_id=14, idle_flag=None):
2571
2605
  """ Setting the gripper pinching action-speed coordination
2572
2606
 
2573
2607
  Args:
@@ -227,18 +227,26 @@ 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
- "coords_max":[566.92, 645.91, 655.13, 180, 180, 180]
234
+ "coords_max":[566.92, 645.91, 655.13, 180, 180, 180],
235
+ "left_coords_min":[-351.11, -272.12, -262.91, -180, -180, -180],
236
+ "left_coords_max":[566.92, 645.91, 655.13, 180, 180, 180],
237
+ "right_coords_min":[-351.11, -645.91, -262.91, -180, -180, -180],
238
+ "right_coords_max":[566.92, 272.12, 655.13, 180, 180, 180]
235
239
  },
236
240
  "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],
241
+ "joint_id":[1,2,3,4,5,6,11,12],
242
+ "angles_min":[-165, -55, -173, -165, -20, -180, -60, -138],
243
+ "angles_max":[165, 95, 5, 165, 265, 180, 0, 188],
240
244
  "coords_min":[-351.11, -272.12, -262.91, -180, -180, -180],
241
- "coords_max":[566.92, 645.91, 655.13, 180, 180, 180]
245
+ "coords_max":[566.92, 645.91, 655.13, 180, 180, 180],
246
+ "left_coords_min":[-351.11, -272.12, -262.91, -180, -180, -180],
247
+ "left_coords_max":[566.92, 645.91, 655.13, 180, 180, 180],
248
+ "right_coords_min":[-351.11, -645.91, -262.91, -180, -180, -180],
249
+ "right_coords_max":[566.92, 272.12, 655.13, 180, 180, 180]
242
250
  },
243
251
  "MyCobot": {
244
252
  "id": [1, 2, 3, 4, 5, 6, 7],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pymycobot
3
- Version: 3.5.0.dev10
3
+ Version: 3.5.0.dev12
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