pymycobot 3.5.0.dev10__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.dev10/pymycobot.egg-info → pymycobot-3.5.0.dev11}/PKG-INFO +1 -1
  2. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/__init__.py +1 -1
  3. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/error.py +7 -2
  4. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mercury_api.py +100 -67
  5. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/robot_info.py +6 -6
  6. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11/pymycobot.egg-info}/PKG-INFO +1 -1
  7. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/LICENSE +0 -0
  8. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/MANIFEST.in +0 -0
  9. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/README.md +0 -0
  10. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/Interface.py +0 -0
  11. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/bluet.py +0 -0
  12. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/close_loop.py +0 -0
  13. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/common.py +0 -0
  14. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/conveyor_api.py +0 -0
  15. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/dualcobotx.py +0 -0
  16. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/elephantrobot.py +0 -0
  17. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/generate.py +0 -0
  18. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/genre.py +0 -0
  19. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/log.py +0 -0
  20. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mecharm.py +0 -0
  21. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mecharm270.py +0 -0
  22. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mecharmsocket.py +0 -0
  23. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mercury.py +0 -0
  24. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mercury_arms_socket.py +0 -0
  25. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mercury_ros_api.py +0 -0
  26. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mercurychassis.py +0 -0
  27. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mercurychassis_api.py +0 -0
  28. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mercurysocket.py +0 -0
  29. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/myagv.py +0 -0
  30. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/myarm.py +0 -0
  31. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/myarm_api.py +0 -0
  32. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/myarmc.py +0 -0
  33. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/myarmm.py +0 -0
  34. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/myarmm_control.py +0 -0
  35. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/myarmsocket.py +0 -0
  36. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mybuddy.py +0 -0
  37. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mybuddybluetooth.py +0 -0
  38. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mybuddyemoticon.py +0 -0
  39. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mybuddysocket.py +0 -0
  40. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mycobot.py +0 -0
  41. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mycobot280.py +0 -0
  42. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mycobot280socket.py +0 -0
  43. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mycobot280x5pi.py +0 -0
  44. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mycobot320.py +0 -0
  45. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mycobot320socket.py +0 -0
  46. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mycobotpro630.py +0 -0
  47. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mycobotsocket.py +0 -0
  48. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mypalletizer.py +0 -0
  49. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mypalletizer260.py +0 -0
  50. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/mypalletizersocket.py +0 -0
  51. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/pro400.py +0 -0
  52. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/pro400client.py +0 -0
  53. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/pro630.py +0 -0
  54. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/pro630client.py +0 -0
  55. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/progripper.py +0 -0
  56. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/protocol_packet_handler.py +0 -0
  57. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/public.py +0 -0
  58. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/sms.py +0 -0
  59. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/tool_coords.py +0 -0
  60. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/ultraArm.py +0 -0
  61. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot/utils.py +0 -0
  62. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot.egg-info/SOURCES.txt +0 -0
  63. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot.egg-info/dependency_links.txt +0 -0
  64. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot.egg-info/requires.txt +0 -0
  65. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/pymycobot.egg-info/top_level.txt +0 -0
  66. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/requirements.txt +0 -0
  67. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/setup.cfg +0 -0
  68. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/setup.py +0 -0
  69. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/tests/__init__.py +0 -0
  70. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/tests/conftest.py +0 -0
  71. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/tests/rasp_myArm_test_gui.py +0 -0
  72. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/tests/rasp_mycobot_test_gui.py +0 -0
  73. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/tests/rasp_mypall_test_gui.py +0 -0
  74. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/tests/special_angles.py +0 -0
  75. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/tests/test_api.py +0 -0
  76. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/tests/test_generator.py +0 -0
  77. {pymycobot-3.5.0.dev10 → pymycobot-3.5.0.dev11}/tests/test_socket.py +0 -0
  78. {pymycobot-3.5.0.dev10 → 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.dev10
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.0dev10"
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":
@@ -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 == 36 and genre == ProtocolCode.MERCURY_ROBOT_STATUS:
399
+ elif data_len in [32, 36] and genre == ProtocolCode.MERCURY_ROBOT_STATUS:
400
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:
@@ -1036,7 +1036,7 @@ class MercuryCommandGenerator(DataProcessor):
1036
1036
 
1037
1037
  def drag_teach_execute(self):
1038
1038
  """Start dragging the teaching point and only execute it once."""
1039
- return self._mesg(ProtocolCode.MERCURY_DRAG_TECH_EXECUTE)
1039
+ return self._mesg(ProtocolCode.MERCURY_DRAG_TECH_EXECUTE, has_reply=True)
1040
1040
 
1041
1041
  def drag_teach_pause(self):
1042
1042
  """Pause recording of dragging teaching point"""
@@ -2110,7 +2110,15 @@ class MercuryCommandGenerator(DataProcessor):
2110
2110
  for angle in new_coords[3:]:
2111
2111
  coord_list.append(self._angle2int(angle))
2112
2112
  angles = [self._angle2int(angle) for angle in old_angles]
2113
- 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
2114
2122
 
2115
2123
  def get_drag_fifo(self):
2116
2124
  return self._mesg(ProtocolCode.GET_DRAG_FIFO)
@@ -2307,86 +2315,94 @@ class MercuryCommandGenerator(DataProcessor):
2307
2315
 
2308
2316
  def __set_tool_fittings_value(self, addr, *args, gripper_id=14, **kwargs):
2309
2317
  kwargs["has_replay"] = True
2318
+ self.calibration_parameters(class_name=self.__class__.__name__, gripper_id=gripper_id)
2310
2319
  return self._mesg(ProtocolCode.MERCURY_SET_TOQUE_GRIPPER, gripper_id, [addr], *args or ([0x00],), **kwargs)
2311
2320
 
2312
2321
  def __get_tool_fittings_value(self, addr, *args, gripper_id=14, **kwargs):
2313
2322
  kwargs["has_replay"] = True
2314
2323
  return self._mesg(ProtocolCode.MERCURY_GET_TOQUE_GRIPPER, gripper_id, [addr], *args or ([0x00],), **kwargs)
2315
2324
 
2316
- def get_hand_firmware_major_version(self, gripper_id):
2325
+ def get_hand_firmware_major_version(self, gripper_id=14):
2317
2326
  return self.__get_tool_fittings_value(
2318
2327
  FingerGripper.GET_HAND_MAJOR_FIRMWARE_VERSION, gripper_id=gripper_id
2319
2328
  )
2320
2329
 
2321
- def get_hand_firmware_minor_version(self, gripper_id):
2330
+ def get_hand_firmware_minor_version(self, gripper_id=14):
2322
2331
  return self.__get_tool_fittings_value(FingerGripper.GET_HAND_MINOR_FIRMWARE_VERSION, gripper_id=gripper_id)
2323
2332
 
2324
- 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)
2325
2335
  return self.__set_tool_fittings_value(
2326
2336
  FingerGripper.SET_HAND_GRIPPER_ID, [hand_id], gripper_id=gripper_id
2327
2337
  )
2328
2338
 
2329
- def get_hand_gripper_id(self, gripper_id):
2339
+ def get_hand_gripper_id(self, gripper_id=14):
2330
2340
  return self.__get_tool_fittings_value(
2331
2341
  FingerGripper.GET_HAND_GRIPPER_ID, gripper_id=gripper_id
2332
2342
  )
2333
2343
 
2334
- 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):
2335
2345
  """Set the angle of the single joint of the gripper
2336
2346
 
2337
2347
  Args:
2338
- gripper_id (int) : 1 ~ 254
2339
- joint_id (int): 1 ~ 6
2348
+ hand_id (int): 1 ~ 6
2340
2349
  gripper_angle (int): 0 ~ 100
2350
+ gripper_id (int) : 1 ~ 254
2341
2351
  """
2352
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id, gripper_angle=gripper_angle)
2342
2353
  return self.__set_tool_fittings_value(
2343
- 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
2344
2355
  )
2345
2356
 
2346
- def get_hand_gripper_angle(self, gripper_id, joint_id):
2357
+ def get_hand_gripper_angle(self, hand_id, gripper_id=14):
2347
2358
  """Get the angle of the single joint of the gripper
2348
2359
 
2349
2360
  Args:
2361
+ hand_id (int): 1 ~ 6
2350
2362
  gripper_id (int) : 1 ~ 254
2351
- joint_id (int): 1 ~ 6
2352
2363
 
2353
2364
  Return:
2354
2365
  gripper_angle (int): 0 ~ 100
2355
2366
  """
2367
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2356
2368
  return self.__get_tool_fittings_value(
2357
- FingerGripper.GET_HAND_GRIPPER_ANGLE, [joint_id], gripper_id=gripper_id
2369
+ FingerGripper.GET_HAND_GRIPPER_ANGLE, [hand_id], gripper_id=gripper_id
2358
2370
  )
2359
2371
 
2360
- 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)
2361
2374
  return self.__set_tool_fittings_value(
2362
2375
  FingerGripper.SET_HAND_GRIPPER_ANGLES, [angles], [speed], gripper_id=gripper_id
2363
2376
  )
2364
2377
 
2365
- def get_hand_gripper_angles(self, gripper_id):
2378
+ def get_hand_gripper_angles(self, gripper_id=14):
2366
2379
  return self.__get_tool_fittings_value(FingerGripper.GET_HAND_ALL_ANGLES, gripper_id)
2367
2380
 
2368
- 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)
2369
2383
  return self.__set_tool_fittings_value(
2370
- 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
2371
2385
  )
2372
2386
 
2373
- 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)
2374
2389
  return self.__get_tool_fittings_value(
2375
- FingerGripper.GET_HAND_GRIPPER_TORQUE, [joint_id], gripper_id=gripper_id
2390
+ FingerGripper.GET_HAND_GRIPPER_TORQUE, [hand_id], gripper_id=gripper_id
2376
2391
  )
2377
2392
 
2378
- def set_hand_gripper_calibrate(self, gripper_id, joint_id):
2393
+ def set_hand_gripper_calibrate(self, hand_id, gripper_id=14):
2379
2394
  """ Setting the gripper jaw zero position
2380
2395
 
2381
2396
  Args:
2397
+ hand_id (int): 1 ~ 6
2382
2398
  gripper_id (int): 1 ~ 254
2383
- joint_id (int): 1 ~ 6
2384
2399
  """
2400
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2385
2401
  return self.__set_tool_fittings_value(
2386
- FingerGripper.SET_HAND_GRIPPER_CALIBRATION, [joint_id], gripper_id=gripper_id
2402
+ FingerGripper.SET_HAND_GRIPPER_CALIBRATION, [hand_id], gripper_id=gripper_id
2387
2403
  )
2388
2404
 
2389
- def get_hand_gripper_status(self, gripper_id):
2405
+ def get_hand_gripper_status(self, gripper_id=14):
2390
2406
  """ Get the clamping status of the gripper
2391
2407
 
2392
2408
  Args:
@@ -2402,47 +2418,50 @@ class MercuryCommandGenerator(DataProcessor):
2402
2418
  FingerGripper.GET_HAND_GRIPPER_STATUS, gripper_id=gripper_id
2403
2419
  )
2404
2420
 
2405
- def set_hand_gripper_enabled(self, gripper_id, flag):
2421
+ def set_hand_gripper_enabled(self, flag, gripper_id=14):
2406
2422
  """ Set the enable state of the gripper
2407
2423
 
2408
2424
  Args:
2409
2425
  gripper_id (int): 1 ~ 254
2410
- flag (int): 1 ~ 6
2426
+ flag (int): 0 or 1
2411
2427
 
2412
2428
  """
2429
+ self.calibration_parameters(class_name=self.__class__.__name__, flag=flag)
2413
2430
  return self.__set_tool_fittings_value(
2414
2431
  FingerGripper.SET_HAND_GRIPPER_ENABLED, [flag], gripper_id=gripper_id
2415
2432
  )
2416
2433
 
2417
- def set_hand_gripper_speed(self, gripper_id, joint_id, speed):
2434
+ def set_hand_gripper_speed(self, hand_id, speed, gripper_id=14):
2418
2435
  """ Set the speed of the gripper
2419
2436
 
2420
2437
  Args:
2421
- gripper_id (int): 1 ~ 254
2422
- joint_id (int): 1 ~ 6
2438
+ hand_id (int): 1 ~ 6
2423
2439
  speed (int): 1 ~ 100
2440
+ gripper_id (int): 1 ~ 254
2424
2441
 
2425
2442
  """
2443
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id, speed=speed)
2426
2444
  return self.__set_tool_fittings_value(
2427
- 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
2428
2446
  )
2429
2447
 
2430
- def get_hand_gripper_default_speed(self, gripper_id, joint_id):
2448
+ def get_hand_gripper_default_speed(self, hand_id, gripper_id=14):
2431
2449
  """ Get the default speed of the gripper
2432
2450
 
2433
2451
  Args:
2452
+ hand_id (int): 1 ~ 6
2434
2453
  gripper_id (int): 1 ~ 254
2435
- joint_id (int): 1 ~ 6
2436
2454
 
2437
2455
  Return:
2438
2456
  default speed (int): 1 ~ 100
2439
2457
 
2440
2458
  """
2459
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2441
2460
  return self.__set_tool_fittings_value(
2442
- 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
2443
2462
  )
2444
2463
 
2445
- def set_hand_gripper_pinch_action(self, gripper_id, pinch_mode):
2464
+ def set_hand_gripper_pinch_action(self, pinch_mode, gripper_id=14):
2446
2465
  """ Set the pinching action of the gripper
2447
2466
 
2448
2467
  Args:
@@ -2453,107 +2472,121 @@ class MercuryCommandGenerator(DataProcessor):
2453
2472
  2 - Three-finger grip
2454
2473
  3 - Two-finger grip
2455
2474
  """
2475
+ self.calibration_parameters(class_name=self.__class__.__name__, pinch_mode=pinch_mode)
2456
2476
  return self.__set_tool_fittings_value(
2457
2477
  FingerGripper.SET_HAND_GRIPPER_PINCH_ACTION, pinch_mode, gripper_id=gripper_id
2458
2478
  )
2459
2479
 
2460
- 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)
2461
2482
  return self.__set_tool_fittings_value(
2462
- 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
2463
2484
  )
2464
2485
 
2465
- 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)
2466
2488
  return self.__get_tool_fittings_value(
2467
- FingerGripper.GET_HAND_GRIPPER_P, [joint_id], gripper_id=gripper_id
2489
+ FingerGripper.GET_HAND_GRIPPER_P, [hand_id], gripper_id=gripper_id
2468
2490
  )
2469
2491
 
2470
- 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)
2471
2494
  return self.__set_tool_fittings_value(
2472
- 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
2473
2496
  )
2474
2497
 
2475
- 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)
2476
2500
  return self.__get_tool_fittings_value(
2477
- FingerGripper.GET_HAND_GRIPPER_D, [joint_id], gripper_id=gripper_id
2501
+ FingerGripper.GET_HAND_GRIPPER_D, [hand_id], gripper_id=gripper_id
2478
2502
  )
2479
2503
 
2480
- 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)
2481
2506
  return self.__set_tool_fittings_value(
2482
- 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
2483
2508
  )
2484
2509
 
2485
- 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)
2486
2512
  return self.__get_tool_fittings_value(
2487
- FingerGripper.GET_HAND_GRIPPER_I, [joint_id], gripper_id=gripper_id
2513
+ FingerGripper.GET_HAND_GRIPPER_I, [hand_id], gripper_id=gripper_id
2488
2514
  )
2489
2515
 
2490
- 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):
2491
2517
  """ Set the minimum starting force of the single joint of the gripper
2492
2518
 
2493
2519
  Args:
2494
- gripper_id (int): 1 ~ 254
2495
- joint_id (int): 1 ~ 6
2520
+ hand_id (int): 1 ~ 6
2496
2521
  value (int): 0 ~ 254
2522
+ gripper_id (int): 1 ~ 254
2497
2523
 
2498
2524
  """
2525
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2499
2526
  return self.__get_tool_fittings_value(
2500
- 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
2501
2528
  )
2502
2529
 
2503
- def get_hand_gripper_min_pressure(self, gripper_id, joint_id):
2530
+ def get_hand_gripper_min_pressure(self, hand_id, gripper_id=14):
2504
2531
  """ Set the minimum starting force of the single joint of the gripper
2505
2532
 
2506
2533
  Args:
2507
2534
  gripper_id (int): 1 ~ 254
2508
- joint_id (int): 1 ~ 6
2535
+ hand_id (int): 1 ~ 6
2509
2536
 
2510
2537
  Return:
2511
2538
  min pressure value (int): 0 ~ 254
2512
2539
 
2513
2540
  """
2541
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2514
2542
  return self.__get_tool_fittings_value(
2515
- 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
2516
2544
  )
2517
2545
 
2518
- def set_hand_gripper_clockwise(self, gripper_id, joint_id, value):
2546
+ def set_hand_gripper_clockwise(self, hand_id, value, gripper_id=14):
2519
2547
  """
2520
2548
  state: 0 or 1, 0 - disable, 1 - enable
2521
2549
  """
2550
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2522
2551
  return self.__set_tool_fittings_value(
2523
- 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
2524
2553
  )
2525
2554
 
2526
- 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)
2527
2557
  return self.__get_tool_fittings_value(
2528
- FingerGripper.GET_HAND_GRIPPER_CLOCKWISE, joint_id, gripper_id=gripper_id
2558
+ FingerGripper.GET_HAND_GRIPPER_CLOCKWISE, hand_id, gripper_id=gripper_id
2529
2559
  )
2530
2560
 
2531
- 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)
2532
2563
  return self.__set_tool_fittings_value(
2533
- 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
2534
2565
  )
2535
2566
 
2536
- 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)
2537
2569
  return self.__get_tool_fittings_value(
2538
- FingerGripper.GET_HAND_GRIPPER_COUNTERCLOCKWISE, [joint_id], gripper_id=gripper_id
2570
+ FingerGripper.GET_HAND_GRIPPER_COUNTERCLOCKWISE, [hand_id], gripper_id=gripper_id
2539
2571
  )
2540
2572
 
2541
- def get_hand_single_pressure_sensor(self, gripper_id, finger_id):
2573
+ def get_hand_single_pressure_sensor(self, hand_id, gripper_id=14):
2542
2574
  """ Get the counterclockwise runnable error of the single joint of the gripper
2543
2575
 
2544
2576
  Args:
2545
2577
  gripper_id (int): 1 ~ 254
2546
- finger_id (int): 1 ~ 5
2578
+ hand_id (int): 1 ~ 6
2547
2579
 
2548
2580
  Return:
2549
2581
  int: 0 ~ 4096
2550
2582
 
2551
2583
  """
2584
+ self.calibration_parameters(class_name=self.__class__.__name__, hand_id=hand_id)
2552
2585
  return self.__get_tool_fittings_value(
2553
- 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
2554
2587
  )
2555
2588
 
2556
- def get_hand_all_pressure_sensor(self, gripper_id):
2589
+ def get_hand_all_pressure_sensor(self, gripper_id=14):
2557
2590
  """ Get the counterclockwise runnable error of the single joint of the gripper
2558
2591
 
2559
2592
  Args:
@@ -2567,7 +2600,7 @@ class MercuryCommandGenerator(DataProcessor):
2567
2600
  FingerGripper.GET_HAND_ALL_PRESSURE_SENSOR, gripper_id=gripper_id
2568
2601
  )
2569
2602
 
2570
- 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):
2571
2604
  """ Setting the gripper pinching action-speed coordination
2572
2605
 
2573
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.dev10
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