@@ -138,45 +138,30 @@ def _mesg(self, genre, *args, **kwargs):
138138 return res
139139 return None
140140
141- def get_radians (self ):
142- """Get all angle return a list
141+ def get_radians (self , id ):
142+ """Get the radians of all joints
143143
144+ Args:
145+ id: 1/2 (L/R)
146+
144147 Return:
145- data_list ( list[radian ...]):
148+ list: A list of float radians [radian1, ...]
146149 """
147- angles = self ._mesg (ProtocolCode .GET_ANGLES , has_reply = True )
150+ angles = self ._mesg (ProtocolCode .GET_ANGLES , id , has_reply = True )
148151 return [round (angle * (math .pi / 180 ), 3 ) for angle in angles ]
149152
150- def send_radians (self , radians , speed ):
151- """Send all angles
153+ def send_radians (self , id , radians , speed ):
154+ """Send the radians of all joints to robot arm
152155
153156 Args:
154- radians (list): example [0, 0, 0, 0, 0, 0]
155- speed (int): 0 ~ 100
157+ id: 1/2 (L/R).
158+ radians: a list of radian values( List[float]), length 6
159+ speed: (int )0 ~ 100
156160 """
157- calibration_parameters (len6 = radians , speed = speed )
161+ # calibration_parameters(len6=radians, speed=speed)
158162 degrees = [self ._angle2int (radian * (180 / math .pi ))
159163 for radian in radians ]
160- return self ._mesg (ProtocolCode .SEND_ANGLES , degrees , speed )
161-
162- def sync_send_angles (self , degrees , speed , timeout = 7 ):
163- t = time .time ()
164- self .send_angles (degrees , speed )
165- while time .time () - t < timeout :
166- f = self .is_in_position (degrees , 0 )
167- if f :
168- break
169- time .sleep (0.1 )
170- return self
171-
172- def sync_send_coords (self , coords , speed , mode , timeout = 7 ):
173- t = time .time ()
174- self .send_coords (coords , speed , mode )
175- while time .time () - t < timeout :
176- if self .is_in_position (coords , 1 ):
177- break
178- time .sleep (0.1 )
179- return self
164+ return self ._mesg (ProtocolCode .SEND_ANGLES , id , degrees , speed )
180165
181166 def set_gpio_mode (self , mode ):
182167 """Set pin coding method
0 commit comments