44import logging
55
66from pymycobot .log import setup_logging
7- from pymycobot .error import calibration_parameters
87from pymycobot .common import ProtocolCode , DataProcessor
98
109
@@ -182,7 +181,7 @@ def send_angle(self, id, degree, speed):
182181 degree (float): angle value.
183182 speed (int): 0 ~ 100
184183 """
185- calibration_parameters (id = id , degree = degree , speed = speed )
184+ self . calibration_parameters (id = id , degree = degree , speed = speed )
186185 return self ._mesg (ProtocolCode .SEND_ANGLE , id , [self ._angle2int (degree )], speed )
187186
188187 # @check_parameters(Command.SEND_ANGLES)
@@ -193,9 +192,8 @@ def send_angles(self, degrees, speed):
193192 degrees (list): example [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
194193 speed (int): 0 ~ 100
195194 """
196- calibration_parameters (degrees = degrees , speed = speed )
195+ self . calibration_parameters (degrees = degrees , speed = speed )
197196 degrees = [self ._angle2int (degree ) for degree in degrees ]
198- # data = [degrees, speed]
199197 return self ._mesg (ProtocolCode .SEND_ANGLES , degrees , speed )
200198
201199 def get_coords (self ):
@@ -214,7 +212,7 @@ def send_coord(self, id, coord, speed):
214212 coord(float): mm
215213 speed(int): 0 ~ 100
216214 """
217- calibration_parameters (id = id , speed = speed )
215+ self . calibration_parameters (id = id , speed = speed )
218216 value = self ._coord2int (coord ) if id <= 3 else self ._angle2int (coord )
219217 return self ._mesg (ProtocolCode .SEND_COORD , id , [value ], speed )
220218
@@ -226,12 +224,12 @@ def send_coords(self, coords, speed, mode):
226224 speed(int);
227225 mode(int): 0 - normal, 1 - angluar, 2 - linear
228226 """
229- calibration_parameters (coords = coords , speed = speed )
227+ self . calibration_parameters (coords = coords , speed = speed )
230228 coord_list = []
231229 for idx in range (3 ):
232230 coord_list .append (self ._coord2int (coords [idx ]))
233- for idx in range ( 3 , 6 ) :
234- coord_list .append (self ._angle2int (coords [ idx ] ))
231+ for angle in coords [ 3 :] :
232+ coord_list .append (self ._angle2int (angle ))
235233 return self ._mesg (ProtocolCode .SEND_COORDS , coord_list , speed , mode )
236234
237235 def is_in_position (self , data , id = 0 ):
@@ -247,14 +245,14 @@ def is_in_position(self, data, id=0):
247245 -1: error data
248246 """
249247 if id == 1 :
250- calibration_parameters (coords = data )
248+ self . calibration_parameters (coords = data )
251249 data_list = []
252250 for idx in range (3 ):
253251 data_list .append (self ._coord2int (data [idx ]))
254252 for idx in range (3 , 6 ):
255253 data_list .append (self ._angle2int (data [idx ]))
256254 elif id == 0 :
257- calibration_parameters (degrees = data )
255+ self . calibration_parameters (degrees = data )
258256 data_list = [self ._angle2int (i ) for i in data ]
259257 else :
260258 raise Exception ("id is not right, please input 0 or 1" )
@@ -353,7 +351,7 @@ def set_speed(self, speed):
353351 Args:
354352 speed (int): 0 - 100
355353 """
356- calibration_parameters (speed = speed )
354+ self . calibration_parameters (speed = speed )
357355 return self ._mesg (ProtocolCode .SET_SPEED , speed )
358356
359357 """
@@ -369,11 +367,11 @@ def get_acceleration(self):
369367 """
370368
371369 def get_joint_min_angle (self , joint_id ):
372- calibration_parameters (id = joint_id )
370+ self . calibration_parameters (id = joint_id )
373371 return self ._mesg (ProtocolCode .GET_JOINT_MIN_ANGLE , joint_id , has_reply = True )
374372
375373 def get_joint_max_angle (self , joint_id ):
376- calibration_parameters (id = joint_id )
374+ self . calibration_parameters (id = joint_id )
377375 return self ._mesg (ProtocolCode .GET_JOINT_MAX_ANGLE , joint_id , has_reply = True )
378376
379377 # Servo control
@@ -421,7 +419,7 @@ def set_color(self, r=0, g=0, b=0):
421419 b (int): 0 ~ 255
422420
423421 """
424- calibration_parameters (rgb = [r , g , b ])
422+ self . calibration_parameters (rgb = [r , g , b ])
425423 return self ._mesg (ProtocolCode .SET_COLOR , r , g , b )
426424
427425 def set_pin_mode (self , pin_no , pin_mode ):
@@ -473,7 +471,7 @@ def set_gripper_value(self, value, speed):
473471 value (int): 0 ~ 100
474472 speed (int): 0 ~ 100
475473 """
476- calibration_parameters (speed = speed )
474+ self . calibration_parameters (speed = speed )
477475 return self ._mesg (ProtocolCode .SET_GRIPPER_VALUE , value , speed )
478476
479477 def set_gripper_ini (self ):
0 commit comments