Skip to content

Commit a98a4d8

Browse files
author
changji
committed
fix some error
1 parent 3e27204 commit a98a4d8

File tree

1 file changed

+30
-18
lines changed

1 file changed

+30
-18
lines changed

pymycobot/ultraArm.py

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@ def set_coords(self, degrees, speed=0):
237237
238238
Args:
239239
degrees: a list of coords value(List[float]).
240-
x : 0 ~ 270 mm
241-
y : 0 ~ 270 mm
242-
z : 0 ~ 125 mm
240+
x : -260 ~ 300 mm
241+
y : -300 ~ 300 mm
242+
z : -70 ~ 135 mm
243243
speed : (int) 0-100 mm/s
244244
"""
245245
degrees = [degree for degree in degrees]
@@ -250,6 +250,8 @@ def set_coords(self, degrees, speed=0):
250250
command += " Y" + str(degrees[1])
251251
if degrees[2] is not None:
252252
command += " Z" + str(degrees[2])
253+
if degrees[3] is not None:
254+
command += " E" + str(degrees[3])
253255
if speed > 0:
254256
command += " F" + str(speed)
255257
command += ProtocolCode.END
@@ -263,18 +265,18 @@ def set_coord(self, id=None, coord=None, speed=0):
263265
264266
Args:
265267
coord:
266-
x : 0 ~ 270 mm
267-
y : 0 ~ 270 mm
268-
z : 0 ~ 125 mm
268+
x : -260 ~ 300 mm
269+
y : -300 ~ 300 mm
270+
z : -70 ~ 135 mm
269271
speed : (int) 0-100 mm/s
270272
"""
271273

272274
command = ProtocolCode.COORDS_SET
273275
if id == "x" or id == "X":
274276
command += " X" + str(coord)
275-
if id == "y" and id == "Y":
277+
if id == "y" or id == "Y":
276278
command += " Y" + str(coord)
277-
if id == "z" and id == "z":
279+
if id == "z" or id == "Z":
278280
command += " Z" + str(coord)
279281
if speed > 0:
280282
command += " F" + str(speed)
@@ -338,8 +340,8 @@ def set_gpio_state(self, state):
338340
339341
Args:
340342
state:
341-
0 - close
342-
1 - open
343+
0 - open
344+
1 - close
343345
"""
344346
if state:
345347
command = ProtocolCode.GPIO_ON + ProtocolCode.END
@@ -395,12 +397,13 @@ def set_angle(self, id=None, angle=None, speed=0):
395397
"""Set single angle.
396398
397399
Args:
398-
id : joint (1/2/3)
400+
id : joint (1/2/3/4)
399401
400402
angle :
401-
1 : -170° ~ +170°
402-
2 : 0° ~ 90°
403-
3 : 0° ~ 75°
403+
1 : -150° ~ +170°
404+
2 : -20° ~ 90°
405+
3 : -5° ~ 60°
406+
4 : -180° ~ + 180°
404407
speed : (int) 0-100 mm/s
405408
"""
406409
command = ProtocolCode.SET_ANGLE
@@ -421,9 +424,12 @@ def set_angles(self, degrees, speed=0):
421424
422425
Args:
423426
degrees: a list of angles value(List[float]).
424-
joint1 : -170° ~ +170°
425-
joint2 : 0° ~ 90°
426-
joint3 : 0° ~ 75°
427+
angle :
428+
1 : -150° ~ +170°
429+
2 : -20° ~ 90°
430+
3 : -5° ~ 60°
431+
4 : -180° ~ + 180°
432+
speed : (int) 0-100 mm/s
427433
speed : (int) 0-100 mm/s
428434
"""
429435
degrees = [degree for degree in degrees]
@@ -434,6 +440,8 @@ def set_angles(self, degrees, speed=0):
434440
command += " Y" + str(degrees[1])
435441
if degrees[2] is not None:
436442
command += " Z" + str(degrees[2])
443+
if degrees[3] is not None:
444+
command += " E" + str(degrees[3])
437445
if speed > 0:
438446
command += " F" + str(speed)
439447
command += ProtocolCode.END
@@ -483,7 +491,11 @@ def set_jog_coord(self, axis=None, direction=None, speed=0):
483491
"""Start jog movement with coord
484492
485493
Args:
486-
axis : x/y/z
494+
axis :
495+
1 : x
496+
2 : y
497+
3 : z
498+
4 : θ
487499
488500
direction:
489501
0 : positive

0 commit comments

Comments
 (0)