Cartesian movement
This page contains information on all functions present within move_cartesian.py and aims to give a clear understanding both of what these functions do and the requirements for any data to be input into them.
These functions allow for handling of all different types of movement allowed within the original python sdk
Functions
cartesian_control
Source code in actions\move_cartesian.py
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 | |
clean_linear_motor_error()
Clean the linear motor error
Note
- only available if firmware_version >= 1.8.0
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\move_cartesian.py
657 658 659 660 661 662 663 664 665 666 667 | |
emergency_stop()
Emergency stop (set_state(4) -> motion_enable(True) -> set_state(0))
Note
- This interface does not automatically clear errors. If there is an error, you will need to handle it according to the error code.
Source code in actions\move_cartesian.py
346 347 348 349 350 351 352 353 | |
get_linear_motor_error()
Get the error code of the linear motor
Note
- only available if firmware_version >= 1.8.0
Returns:
| Name | Type | Description |
|---|---|---|
out |
tuple[int, int]
|
tuple((code, error)), returned result is only corrent when code is 0. |
code |
int
|
See the API Code Documentation for details. |
error |
int
|
See the Linear Motor Error Code Documentation for details. |
Source code in actions\move_cartesian.py
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 | |
get_linear_motor_is_enabled()
Get if the linear motor is enabled or not
Note
- only available if firmware_version >= 1.8.0
Returns:
| Name | Type | Description |
|---|---|---|
out |
tuple[int, int]
|
tuple((code, status)), returned result is only corrent when code is 0. |
code |
int
|
See the API Code Documentation for details. |
status |
int
|
0: linear motor is not enabled 1: linear motor is enabled |
Source code in actions\move_cartesian.py
585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 | |
get_linear_motor_on_zero()
Get if the linear motor is on zero positon or not
Note
- only available if firmware_version >= 1.8.0
Returns:
| Name | Type | Description |
|---|---|---|
out |
tuple[int, int]
|
tuple((code, status)), returned result is only corrent when code is 0. |
code |
int
|
See the API Code Documentation for details. |
status |
int
|
0: linear motor is not on zero 1: linear motor is on zero |
Source code in actions\move_cartesian.py
605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 | |
get_linear_motor_pos()
Get the pos of the linear motor
Note
- only available if firmware_version >= 1.8.0
Returns:
| Name | Type | Description |
|---|---|---|
out |
tuple[int, int]
|
tuple((code, position)) returned result is only corrent when code is 0. |
code |
int
|
See the API Code Documentation for details. |
position |
int
|
position |
Source code in actions\move_cartesian.py
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 | |
get_linear_motor_registers(**kwargs)
Get the status of the linear motor
Note
- only available if firmware_version >= 1.8.0
Returns:
| Name | Type | Description |
|---|---|---|
out |
tuple[int, dict]
|
tuple((code, status)), returned result is only corrent when code is 0. |
code |
int
|
See the API Code Documentation for details. |
status |
dict
|
status, like { 'pos': 0, 'status': 0, 'error': 0, 'is_enabled': 0, 'on_zero': 0, 'sci': 1, 'sco': [0, 0], } |
Source code in actions\move_cartesian.py
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 | |
get_linear_motor_sci()
Get the sci1 value of the linear motor
Note
- only available if firmware_version >= 1.8.0
Returns:
| Name | Type | Description |
|---|---|---|
out |
tuple[int, int]
|
tuple((code, sci1)), returned result is only corrent when code is 0. |
code |
int
|
See the API Code Documentation for details. |
sci1 |
int
|
sci1 value |
Source code in actions\move_cartesian.py
625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 | |
get_linear_motor_sco()
Get the sco value of the linear motor
Note
- only available if firmware_version >= 1.8.0
Returns:
| Name | Type | Description |
|---|---|---|
out |
tuple[int, list]
|
tuple((code, sco)), returned result is only corrent when code is 0. |
code |
int
|
See the API Code Documentation for details. |
sco |
list[int]
|
[sco0, sco1] |
Source code in actions\move_cartesian.py
641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 | |
get_linear_motor_status()
Get the status of the linear motor
Note
- only available if firmware_version >= 1.8.0
Returns:
| Name | Type | Description |
|---|---|---|
out |
tuple[int, int]
|
tuple((code, status)), returned result is only corrent when code is 0. |
code |
int
|
See the API Code Documentation for details. |
status |
int
|
status status & 0x00: motion finish status & 0x01: in motion status & 0x02: has stop |
Source code in actions\move_cartesian.py
547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 | |
get_pose_offset(pose1, pose2, orient_type_in=0, orient_type_out=0, is_radian=None)
Calculate the pose offset of two given points
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pose1
|
[x(mm), y(mm), z(mm), roll/rx(rad or °), pitch/ry(rad or °), yaw/rz(rad or °)] |
required | |
pose2
|
[x(mm), y(mm), z(mm), roll/rx(rad or °), pitch/ry(rad or °), yaw/rz(rad or °)] |
required | |
orient_type_in
|
input attitude notation, 0 is RPY(roll/pitch/yaw) (default), 1 is axis angle(rx/ry/rz) |
0
|
|
orient_type_out
|
notation of output attitude, 0 is RPY (default), 1 is axis angle |
0
|
|
is_radian
|
if the roll/rx/pitch/ry/yaw/rz of pose1/pose2/return_pose is radian or not |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
tuple[int, list]
|
tuple((code, pose)), returned result is only corrent when code is 0. |
code |
int
|
See the API Code Documentation for details. |
pose |
list[float]
|
[x(mm), y(mm), z(mm), roll/rx(rad or °), pitch/ry(rad or °), yaw/rz(rad or °)] |
Source code in actions\move_cartesian.py
925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 | |
get_position_aa(is_radian=None)
Get the pose represented by the axis angle pose
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
is_radian
|
the returned value (only rx/ry/rz) is in radians or not, default is self.default_is_radian |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
out |
tuple[int, list]
|
tuple((code, [x, y, z, rx, ry, rz])), returned result is only corrent when code is 0. |
code |
int
|
See the API Code Documentation for details. |
Source code in actions\move_cartesian.py
950 951 952 953 954 955 956 957 958 959 960 961 962 | |
get_servo_angle(servo_id=None, is_radian=None, is_real=False)
returns the servo angle
Note
- if value returned should be in radians, please set is_radian to True
- If you want to return only the angle of a single joint, please set the parameter servo_id ex: code, angle = arm.get_servo_angle(servo_id=2)
- This interface is only used in the base coordinate system.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
servo_id
|
1-(Number of axes), None(8), default is None |
None
|
|
is_radian
|
the returned value is in radians or not, default is self.default_is_radian |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
|
out tuple[int, float | list[float]]: tuple((code, angle list if servo_id is None or 8 else angle)), returned result is only corrent when code is 0. |
||
code |
int
|
See the API Code Documentation for details. |
angle |
float | list[float]
|
angle or list of angles depending on servo_id, unit depends on is_radian |
Source code in actions\move_cartesian.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | |
get_trajectories()
Get the trajectories
Note
- This interface relies on xArmStudio 1.2.0 or above
- This interface relies on Firmware 1.2.0 or above
Returns:
| Name | Type | Description |
|---|---|---|
out |
tuple[int, list]
|
tuple((code, trajectories)) |
code |
int
|
See the API Code Documentation for details. |
trajectories |
list
|
[{ 'name'- name, The name of the trajectory 'duration'- duration, The duration of the trajectory (seconds) }] |
Source code in actions\move_cartesian.py
883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 | |
move_arc_lines(paths, is_radian=None, times=1, first_pause_time=0.1, repeat_pause_time=0, automatic_calibration=True, speed=None, mvacc=None, mvtime=None, wait=False)
Continuous linear motion with interpolation.
Note
- If an error occurs, it will return early.
- If the emergency_stop interface is called actively, it will return early.
- The last_used_position/last_used_tcp_speed/last_used_tcp_acc will be modified.
- The last_used_angles/last_used_joint_speed/last_used_joint_acc will not be modified.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
paths
|
cartesian path list 1. Specify arc radius: [[x, y, z, roll, pitch, yaw, radius], ....]
|
required | |
is_radian
|
if roll/pitch/yaw of the paths are in radians or not, default is self.default_is_radian |
None
|
|
times
|
amount of times to repeat, 0 is infinite loop, default is 1 |
1
|
|
first_pause_time
|
sleep time at first, purpose is to cache the commands and plan continuous motion, default is 0.1s |
0.1
|
|
repeat_pause_time
|
interval between repeated movements, unit: (s)second |
0
|
|
automatic_calibration
|
automatic calibration or not, default is True |
True
|
|
speed
|
move speed (mm/s, rad/s), default is self.last_used_tcp_speed |
None
|
|
mvacc
|
move acceleration (mm/s^2, rad/s^2), default is self.last_used_tcp_acc |
None
|
|
mvtime
|
0, reserved |
None
|
|
wait
|
whether to wait for the arm to complete, default is False |
False
|
Source code in actions\move_cartesian.py
842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 | |
move_circle(pose1, pose2, percent, speed=None, mvacc=None, mvtime=None, is_radian=None, wait=False, timeout=None, is_tool_coord=False, is_axis_angle=False, **kwargs)
The motion calculates the trajectory of the space circle according to the three-point coordinates. The three-point coordinates are (current starting point, pose1, pose2).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pose1
|
cartesian position, [x(mm), y(mm), z(mm), roll(rad or °), pitch(rad or °), yaw(rad or °)] |
required | |
pose2
|
cartesian position, [x(mm), y(mm), z(mm), roll(rad or °), pitch(rad or °), yaw(rad or °)] |
required | |
percent
|
the percentage of arc length and circumference of the movement |
required | |
speed
|
move speed (mm/s, rad/s), default is self.last_used_tcp_speed |
None
|
|
mvacc
|
move acceleration (mm/s^2, rad/s^2), default is self.last_used_tcp_acc |
None
|
|
mvtime
|
0, reserved |
None
|
|
is_radian
|
if roll/pitch/yaw values are in radians or not, default is self.default_is_radian |
None
|
|
wait
|
whether to wait for the arm to complete, default is False |
False
|
|
timeout
|
maximum waiting time(unit: second), default is None(no timeout), only valid if wait is True |
None
|
|
is_tool_coord
|
is tool coord or not, default is False, only available if firmware_version >= 1.11.100 |
False
|
|
is_axis_angle
|
is axis angle or not, default is False, only available if firmware_version >= 1.11.100 |
False
|
|
kwargs
|
reserved |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. code < 0: the last_used_tcp_speed/last_used_tcp_acc will not be modified code >= 0: the last_used_tcp_speed/last_used_tcp_acc will be modified |
Source code in actions\move_cartesian.py
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | |
move_gohome(speed=None, mvacc=None, mvtime=None, is_radian=None, wait=False, timeout=None, **kwargs)
Move to go home (Back to zero)
Warning: without limit detection
Note
- If you want to wait for the robot to complete it's current action and then return, set wait to True. ex: code = arm.move_gohome(wait=True)
- This interface does not modify the value of last_used_joint_speed/last_used_joint_acc
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
speed
|
gohome speed (unit: rad/s if is_radian is True else °/s), default is 50 °/s |
None
|
|
mvacc
|
gohome acceleration (unit: rad/s^2 if is_radian is True else °/s^2), default is 5000 °/s^2 |
None
|
|
mvtime
|
reserved |
None
|
|
is_radian
|
if the speed and acceleration are in radians or not, default is self.default_is_radian |
None
|
|
wait
|
whether to wait for the arm to complete, default is False |
False
|
|
timeout
|
maximum waiting time(unit: second), default is None(no timeout), only valid if wait is True |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\move_cartesian.py
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 | |
reset(speed=None, mvacc=None, mvtime=None, is_radian=None, wait=False, timeout=None)
Reset the xArm
Warning
without limit detection
Note
- If there are errors or warnings, this interface will clear the warnings and errors.
- If not ready, the api will auto enable motion and set state
- This interface does not modify the value of last_used_angles/last_used_joint_speed/last_used_joint_acc
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
speed
|
reset speed (unit: rad/s if is_radian is True else °/s), default is 50 °/s |
None
|
|
mvacc
|
reset acceleration (unit: rad/s^2 if is_radian is True else °/s^2), default is 5000 °/s^2 |
None
|
|
mvtime
|
reserved |
None
|
|
is_radian
|
if the speed and acceleration are in radians or not, defaults to self.default_is_radian |
None
|
|
wait
|
whether to wait for the arm to complete, default is False |
False
|
|
timeout
|
maximum waiting time(unit: second), default is None(no timeout), only valid if wait is True |
None
|
Source code in actions\move_cartesian.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
set_cartesian_velo_continuous(on_off)
Set cartesian motion velocity continuous
Note
- only available if firmware_version >= 1.9.0
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
on_off
|
continuous or not, True means continuous, default is False |
required |
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\move_cartesian.py
964 965 966 967 968 969 970 971 972 973 974 975 976 977 | |
set_linear_motor_back_origin(wait=True, **kwargs)
Set the linear motor to go back to the origin position
Note
- only available if firmware_version >= 1.8.0
- only useful when powering on for the first time
- this operation must be performed at the first power-on
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wait
|
wait to motion finish or not, default is True |
True
|
|
kwargs
|
auto_enable: enable after back to origin or not, default is True |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\move_cartesian.py
699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 | |
set_linear_motor_enable(enable)
Set the linear motor enable/disable
Note
- only available if firmware_version >= 1.8.0
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enable
|
enable or not |
required |
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\move_cartesian.py
669 670 671 672 673 674 675 676 677 678 679 680 681 682 | |
set_linear_motor_pos(pos, speed=None, wait=True, timeout=100, **kwargs)
Set the position of the linear motor
Note
- only available if firmware_version >= 1.8.0
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pos
|
position. Integer between 0 and 700/1000/1500mm. If SN start with AL1300 the position range is 0~700mm. If SN start with AL1301 the position range is 0~1000mm. If SN start with AL1302 the position range is 0~1500mm. |
required | |
speed
|
speed of the linear motor. Integer between 1 and 1000mm/s. default is not set |
None
|
|
wait
|
wait to motion finish or not, default is True |
True
|
|
timeout
|
wait timeout, seconds, default is 100s. |
100
|
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\move_cartesian.py
719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 | |
set_linear_motor_speed(speed)
Set the speed of the linear motor
Note
- only available if firmware_version >= 1.8.0
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
speed
|
Integer between 1 and 1000mm/s. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\move_cartesian.py
684 685 686 687 688 689 690 691 692 693 694 695 696 697 | |
set_linear_motor_stop()
Set the linear motor to stop
Note
- only available if firmware_version >= 1.8.0
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\move_cartesian.py
746 747 748 749 750 751 752 753 754 755 756 | |
set_position(x=None, y=None, z=None, roll=None, pitch=None, yaw=None, radius=None, speed=None, mvacc=None, mvtime=None, relative=False, is_radian=None, wait=False, timeout=None, **kwargs)
Set the cartesian position, the API will modify self.last_used_position value
Note
- If it is xArm5, roll must be set to 180° or π rad, pitch must be set to 0
- If the parameter(roll/pitch/yaw) you are passing is an radian unit, set is_radian to True. ex: code = arm.set_position(x=300, y=0, z=200, roll=-3.14, pitch=0, yaw=0, is_radian=True)
- If you want to wait for the robot to complete this action and then return, set wait to True. ex: code = arm.set_position(x=300, y=0, z=200, roll=180, pitch=0, yaw=0, is_radian=False, wait=True)
- This interface is only used in the base coordinate system.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
cartesian position x, (mm), default is self.last_used_position[0] |
None
|
|
y
|
cartesian position y, (mm), default is self.last_used_position[1] |
None
|
|
z
|
cartesian position z, (mm), default is self.last_used_position[2] |
None
|
|
roll
|
rotate around the X axis, (unit: rad if is_radian is True else °), default is self.last_used_position[3] |
None
|
|
pitch
|
rotate around the Y axis, (unit: rad if is_radian is True else °), default is self.last_used_position[4] |
None
|
|
yaw
|
rotate around the Z axis, (unit: rad if is_radian is True else °), default is self.last_used_position[5] |
None
|
|
radius
|
move radius, if radius is None or radius less than 0, will MoveLine, else MoveArcLine MoveLine: Linear motion
MoveArcLine: Linear arc motion with interpolation
|
None
|
|
speed
|
move speed (mm/s, rad/s), default is self.last_used_tcp_speed |
None
|
|
mvacc
|
move acceleration (mm/s^2, rad/s^2), default is self.last_used_tcp_acc |
None
|
|
mvtime
|
0, reserved |
None
|
|
relative
|
relative move or not |
False
|
|
is_radian
|
the roll/pitch/yaw in radians or not, default is self.default_is_radian |
None
|
|
wait
|
whether to wait for the arm to complete, default is False |
False
|
|
timeout
|
maximum waiting time(unit: second), default is None(no timeout), only valid if wait is True |
None
|
|
kwargs
|
extra parameters motion_type: motion planning type, default is 0
Note:
|
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. code < 0: the last_used_position/last_used_tcp_speed/last_used_tcp_acc will not be modified code >= 0: the last_used_position/last_used_tcp_speed/last_used_tcp_acc will be modified |
Source code in actions\move_cartesian.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
set_position_aa(axis_angle_pose, speed=None, mvacc=None, mvtime=None, is_radian=None, is_tool_coord=False, relative=False, wait=False, timeout=None, radius=None, **kwargs)
Set the pose represented by the axis angle pose
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
axis_angle_pose
|
the axis angle pose, [x(mm), y(mm), z(mm), rx(rad or °), ry(rad or °), rz(rad or °)] |
required | |
speed
|
move speed (mm/s, rad/s), default is self.last_used_tcp_speed |
None
|
|
mvacc
|
move acceleration (mm/s^2, rad/s^2), default is self.last_used_tcp_acc |
None
|
|
mvtime
|
0, reserved |
None
|
|
is_radian
|
if the rx/ry/rz of axis_angle_pose are in radians or not, default is self.default_is_radian |
None
|
|
is_tool_coord
|
is tool coordinate or not, if True, the relative parameter is no longer valid |
False
|
|
relative
|
relative move or not |
False
|
|
wait
|
whether to wait for the arm to complete, default is False |
False
|
|
timeout
|
maximum waiting time(unit: second), default is None(no timeout), only valid if wait is True |
None
|
|
radius
|
move radius, if radius is None or radius less than 0, will MoveLineAA, else MoveArcLineAA only available if firmware_version >= 1.11.100 MoveLineAA: Linear motion
MoveArcLineAA: Linear arc motion with interpolation
|
None
|
|
kwargs
|
extra parameters
|
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\move_cartesian.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 | |
set_servo_angle(servo_id=None, angle=None, speed=None, mvacc=None, mvtime=None, relative=False, is_radian=None, wait=False, timeout=None, radius=None, **kwargs)
Set the servo angle, the API will modify self.last_used_angles value
Note
- If the parameter angle you are passing is an radian unit, be sure to set the parameter is_radian to True. ex: code = arm.set_servo_angle(servo_id=1, angle=1.57, is_radian=True)
- If you want to wait for the robot to complete this action and then return, please set the parameter wait to True. ex: code = arm.set_servo_angle(servo_id=1, angle=45, is_radian=False,wait=True)
- This interface is only used in the base coordinate system.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
servo_id
|
1-(Number of axes), None(8)
|
None
|
|
angle
|
angle or angle list, (unit: rad if is_radian is True else °)
|
None
|
|
speed
|
move speed (unit: rad/s if is_radian is True else °/s), default is self.last_used_joint_speed |
None
|
|
mvacc
|
move acceleration (unit: rad/s^2 if is_radian is True else °/s^2), default is self.last_used_joint_acc |
None
|
|
mvtime
|
0, reserved |
None
|
|
relative
|
relative move or not |
False
|
|
is_radian
|
the angle in radians or not, default is self.default_is_radian |
None
|
|
wait
|
whether to wait for the arm to complete, default is False |
False
|
|
timeout
|
maximum waiting time(unit: second), default is None(no timeout), only valid if wait is True |
None
|
|
radius
|
move radius, if radius is None or radius less than 0, will MoveJoint, else MoveArcJoint Note: Only available if version > 1.5.20 Note: The blending radius cannot be greater than the track length. MoveJoint: joint motion
MoveArcJoint: joint fusion motion with interpolation
|
None
|
|
kwargs
|
reserved |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. code < 0: the last_used_angles/last_used_joint_speed/last_used_joint_acc will not be modified code >= 0: the last_used_angles/last_used_joint_speed/last_used_joint_acc will be modified |
Source code in actions\move_cartesian.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
set_servo_angle_j(angles, speed=None, mvacc=None, mvtime=None, is_radian=None, **kwargs)
Set the servo angle, execute only the last instruction, need to be set to servo motion mode(self.set_mode(1))
Note
- This interface does not modify the value of last_used_angles/last_used_joint_speed/last_used_joint_acc
- This interface is only used in the base coordinate system.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
angles
|
angle list, (unit: rad if is_radian is True else °) |
required | |
speed
|
speed, reserved |
None
|
|
mvacc
|
acceleration, reserved |
None
|
|
mvtime
|
0, reserved |
None
|
|
is_radian
|
if the angles are in radians or not, default is self.default_is_radian |
None
|
|
kwargs
|
reserved |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\move_cartesian.py
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | |
set_servo_cartesian(mvpose, speed=None, mvacc=None, mvtime=0, is_radian=None, is_tool_coord=False, **kwargs)
Set the servo to cartesian, execute only the last instruction, needs servo motion set to mode(self.set_mode(1))
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mvpose
|
cartesian position, [x(mm), y(mm), z(mm), roll(rad or °), pitch(rad or °), yaw(rad or °)] |
required | |
speed
|
move speed (mm/s), reserved |
None
|
|
mvacc
|
move acceleration (mm/s^2), reserved |
None
|
|
mvtime
|
0, reserved |
0
|
|
is_radian
|
if the roll/pitch/yaw of mvpose are in radians or not, default is self.default_is_radian |
None
|
|
is_tool_coord
|
is tool coordinate or not |
False
|
|
kwargs
|
reserved |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\move_cartesian.py
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | |
set_servo_cartesian_aa(axis_angle_pose, speed=None, mvacc=None, is_radian=None, is_tool_coord=False, relative=False, **kwargs)
Set the servo cartesian represented by the axis angle pose, execute only the last instruction, needs servo motion set to mode(self.set_mode(1))
Note
- only available if firmware_version >= 1.4.7
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
axis_angle_pose
|
the axis angle pose, [x(mm), y(mm), z(mm), rx(rad or °), ry(rad or °), rz(rad or °)] |
required | |
speed
|
move speed (mm/s), reserved |
None
|
|
mvacc
|
move acceleration (mm/s^2), reserved |
None
|
|
is_radian
|
if the rx/ry/rz of axis_angle_pose are in radians or not, default is self.default_is_radian |
None
|
|
is_tool_coord
|
is tool coordinate or not |
False
|
|
relative
|
relative move or not |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\move_cartesian.py
421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 | |
set_tool_position(x=0, y=0, z=0, roll=0, pitch=0, yaw=0, speed=None, mvacc=None, mvtime=None, is_radian=None, wait=False, timeout=None, radius=None, **kwargs)
Movement relative to the tool coordinate system
Note
- This interface is moving relative to the current tool coordinate system
- The tool coordinate system is not fixed and varies with position.
- This interface is only used in the tool coordinate system.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
the x coordinate relative to the current tool coordinate system, (unit: mm), default 0 |
0
|
|
y
|
the y coordinate relative to the current tool coordinate system, (unit: mm), default 0 |
0
|
|
z
|
the z coordinate relative to the current tool coordinate system, (unit: mm), default 0 |
0
|
|
roll
|
the rotation around the X axis relative to the current tool coordinate system, (unit: rad if is_radian is True else °), default is 0 |
0
|
|
pitch
|
the rotation around the Y axis relative to the current tool coordinate system, (unit: rad if is_radian is True else °), default is 0 |
0
|
|
yaw
|
the rotation around the Z axis relative to the current tool coordinate system, (unit: rad if is_radian is True else °), default is 0 |
0
|
|
speed
|
move speed (mm/s, rad/s), default is self.last_used_tcp_speed |
None
|
|
mvacc
|
move acceleration (mm/s^2, rad/s^2), default is self.last_used_tcp_acc |
None
|
|
mvtime
|
0, reserved |
None
|
|
is_radian
|
if the roll/pitch/yaw are in radians or not, default is self.default_is_radian |
None
|
|
wait
|
whether to wait for the arm to complete, default is False |
False
|
|
timeout
|
maximum waiting time(unit: second), default is None(no timeout), only valid if wait is True |
None
|
|
radius
|
move radius, if radius is None or radius less than 0, will MoveToolLine, else MoveToolArcLine only available if firmware_version >= 1.11.100 MoveToolLine: Linear motion
MoveToolArcLine: Linear arc motion with interpolation
|
None
|
|
kwargs
|
extra parameters motion_type: motion planning type, default is 0
Note:
|
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. code < 0: the last_used_tcp_speed/last_used_tcp_acc will not be modified code >= 0: the last_used_tcp_speed/last_used_tcp_acc will be modified |
Source code in actions\move_cartesian.py
758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 | |
set_world_offset(offset, is_radian=None, wait=True)
Set the base coordinate offset
Note
- This interface relies on Firmware 1.2.11 or above
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
offset
|
[x, y, z, roll, pitch, yaw] |
required | |
is_radian
|
if the roll/pitch/yaw are in radians or not, default is self.default_is_radian |
None
|
|
wait
|
whether to wait for the robotic arm to stop or all previous queue commands to be executed or cleared before setting |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\move_cartesian.py
906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 | |
vc_set_cartesian_velocity(speeds, is_radian=None, is_tool_coord=False, duration=-1, **kwargs)
Cartesian velocity control, need to be in cartesian velocity control mode(self.set_mode(5))
Note
- only available if firmware_version >= 1.6.9
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
speeds
|
[spd_x, spd_y, spd_z, spd_rx, spd_ry, spd_rz] |
required | |
is_radian
|
if the spd_rx/spd_ry/spd_rz are in radians or not, default is self.default_is_radian |
None
|
|
is_tool_coord
|
is tool coordinate or not, default is False |
False
|
|
duration
|
the maximum duration of the speed, over this time will automatically set the speed to 0 Note: only available if firmware_version >= 1.8.0 duration > 0: seconds, indicates the maximum number of seconds that this speed can be maintained duration == 0: Always effective, will not stop automatically duration < 0: default value, only used to be compatible with the old protocol, equivalent to 0 |
-1
|
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\move_cartesian.py
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 | |
vc_set_joint_velocity(speeds, is_radian=None, is_sync=True, duration=-1, **kwargs)
Joint velocity control, need to be in joint velocity control mode(self.set_mode(4))
Note
- only available if firmware_version >= 1.6.9
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
speeds
|
[spd_J1, spd_J2, ..., spd_J7] |
required | |
is_radian
|
if the spd_Jx is in radians or not, default is self.default_is_radian |
None
|
|
is_sync
|
whether all joints accelerate and decelerate synchronously, default is True |
True
|
|
duration
|
The duration of this speed command, over this time will automatically set the speed to 0 Note: only available if firmware_version >= 1.8.0 duration > 0: seconds duration == 0: Always effective, will not stop automatically duration < 0: default value, only used to be compatible with the old protocol, equivalent to 0 |
-1
|
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\move_cartesian.py
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |