@@ -106,6 +106,7 @@ def _mesg(self, genre, *args, **kwargs):
106106 has_reply: Whether there is a return value to accept.
107107 """
108108 command_data = self ._process_data_command (genre , self .__class__ .__name__ , args )
109+
109110 if genre == 178 :
110111 # 修改wifi端口
111112 command_data = self ._encode_int16 (command_data )
@@ -232,7 +233,7 @@ def get_angles(self):
232233 """
233234 return self ._mesg (ProtocolCode .GET_ANGLES , has_reply = True )
234235
235- def send_angle (self , id , angle , speed ):
236+ def send_angle (self , id , degree , speed ):
236237 """Send one angle of joint to robot arm.
237238
238239 Args:
@@ -243,8 +244,8 @@ def send_angle(self, id, angle, speed):
243244 angle : angle value(float)(about -170 ~ 170).
244245 speed : (int) 1 ~ 100
245246 """
246- self .calibration_parameters (class_name = self .__class__ .__name__ , id = id , angle = angle , speed = speed )
247- return self ._mesg (ProtocolCode .SEND_ANGLE , id , [self ._angle2int (angle )], speed )
247+ self .calibration_parameters (class_name = self .__class__ .__name__ , id = id , angle = degree , speed = speed )
248+ return self ._mesg (ProtocolCode .SEND_ANGLE , id , [self ._angle2int (degree )], speed )
248249
249250 # @check_parameters(Command.SEND_ANGLES)
250251 def send_angles (self , angles , speed ):
@@ -695,31 +696,24 @@ def set_pwm_output(self, channel, frequency, pin_val):
695696 """
696697 return self ._mesg (ProtocolCode .SET_PWM_OUTPUT , channel , [frequency ], pin_val )
697698
698- def get_gripper_value (self , gripper_type = None ):
699- """Get the value of gripper.
700-
701- Args:
702- gripper_type (int):
703- 1 - Adaptive gripper.\n
704- 3 - Parallel gripper, this parameter can be omitted, default to adaptive gripper
699+ def get_gripper_value (self , _type = None ):
700+ """Get the value of gripper.
705701
706702 Return:
707703 gripper value (int)
708704 """
709- self .calibration_parameters (class_name = self .__class__ .__name__ , gripper_type = gripper_type )
710- if gripper_type is None :
705+ if _type is None :
711706 return self ._mesg (ProtocolCode .GET_GRIPPER_VALUE , has_reply = True )
712707 else :
713- return self ._mesg (ProtocolCode .GET_GRIPPER_VALUE , gripper_type , has_reply = True )
708+ return self ._mesg (ProtocolCode .GET_GRIPPER_VALUE , _type , has_reply = True )
714709
715710
716- def set_gripper_state (self , flag , speed , _type = None ):
711+ def set_gripper_state (self , flag , speed , _type ):
717712 """Set gripper switch state
718713
719714 Args:
720- flag (int): 0 - open, 1 - close, 254 - release
715+ flag (int): 0 - open, 1 - close, 10 - release
721716 speed (int): 1 ~ 100
722- _type (int): 1- Adaptive gripper, 2 - 5 finger dexterous hand, 3 - Parallel gripper, this parameter can be omitted, default to adaptive gripper
723717 """
724718 self .calibration_parameters (class_name = self .__class__ .__name__ , flag = flag , speed = speed , _type = _type )
725719 if _type is None :
@@ -733,10 +727,7 @@ def set_gripper_value(self, gripper_value, speed, gripper_type=None):
733727
734728 Args:
735729 gripper_value (int): 0 ~ 100
736- speed (int): 1 ~ 100\n
737- gripper_type (int):
738- 1 - Adaptive gripper\n
739- 3 - Parallel gripper, this parameter can be omitted, default to adaptive gripper
730+ speed (int): 1 ~ 100
740731 """
741732 if gripper_type is not None :
742733 self .calibration_parameters (class_name = self .__class__ .__name__ , gripper_value = gripper_value , speed = speed , gripper_type = gripper_type )
@@ -748,9 +739,6 @@ def set_gripper_value(self, gripper_value, speed, gripper_type=None):
748739 def set_gripper_calibration (self ):
749740 """Set the current position to zero, set current position value is `2048`."""
750741 return self ._mesg (ProtocolCode .SET_GRIPPER_CALIBRATION )
751-
752- def set_gripper_torque (self , torque , gripper_type_1 ):
753- return self ._mesg (ProtocolCode .SET_GRIPPER_TORQUE , [torque ], gripper_type_1 )
754742
755743 def is_gripper_moving (self ):
756744 """Judge whether the gripper is moving or not
@@ -1127,26 +1115,31 @@ def get_atom_version(self):
11271115 return self ._mesg (ProtocolCode .GET_ATOM_VERSION , has_reply = True )
11281116
11291117 def set_HTS_gripper_torque (self , torque ):
1130- """Clamp torque control
1118+ """Set new adaptive gripper torque
11311119
11321120 Args:
1133- torque (int): 150-980 (the setting cannot exceed the current protection current)
1121+ torque (int): 150 ~ 980
1122+
1123+ Return:
1124+ 0: Set failed
1125+ 1: Set successful
11341126 """
1127+ self .calibration_parameters (class_name = self .__class__ .__name__ , torque = torque )
11351128 return self ._mesg (ProtocolCode .SetHTSGripperTorque , torque , has_reply = True )
11361129
11371130 def get_HTS_gripper_torque (self ):
11381131 """Get gripper torque
11391132
11401133 Returns:
1141- int: 150- 980
1134+ int: 150 ~ 980
11421135 """
11431136 return self ._mesg (ProtocolCode .GetHTSGripperTorque , has_reply = True )
11441137
11451138 def get_gripper_protect_current (self ):
11461139 """Get the gripper protection current
11471140
11481141 Returns:
1149- int: _description_
1142+ int: 1 ~ 500
11501143 """
11511144 return self ._mesg (ProtocolCode .GetGripperProtectCurrent , has_reply = True )
11521145
@@ -1162,8 +1155,10 @@ def set_gripper_protect_current(self, current):
11621155 """Set the gripper protection current
11631156
11641157 Args:
1165- current (_type_ ): _description_
1158+ current (int ): 1 ~ 500
11661159 """
1160+ self .calibration_parameters (class_name = self .__class__ .__name__ , current = current )
1161+
11671162 return self ._mesg (ProtocolCode .InitGripper , current )
11681163
11691164 def set_four_pieces_zero (self ):
@@ -1173,6 +1168,4 @@ def set_four_pieces_zero(self):
11731168 int: 0 or 1 (1 - success)
11741169 """
11751170 return self ._mesg (ProtocolCode .SET_FOUR_PIECES_ZERO , has_reply = True )
1176-
1177- def
11781171
0 commit comments