Skip to content

Commit 5292578

Browse files
author
vinman
committed
release-1.2.2
1 parent a80cd1a commit 5292578

File tree

7 files changed

+34
-18
lines changed

7 files changed

+34
-18
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ Install is not necessary, you can run examples without installation.Only Python3
3131

3232
## Update Summary
3333

34+
- > ### 1.2.2
35+
36+
- Fix mechanical claw false positive error
37+
- Modify the wait logic of a motion instruction
38+
- Support for blocky code conversion and operation of xArmStudio1.2.2
39+
3440
- > ### 1.2.0
3541
3642
- Fix the parameters of the control box GPIO analog signal

doc/api/xarm_api.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ The three-point coordinates are (current starting point, pose1, pose2).
801801
:param mvtime: 0, reserved
802802
:param is_radian: roll/pitch/yaw value is radians or not, default is self.default_is_radian
803803
:param wait: whether to wait for the arm to complete, default is False
804-
:param timeout: maximum waiting time(unit: second), default is 10s, only valid if wait is True
804+
:param timeout: maximum waiting time(unit: second), default is None(no timeout), only valid if wait is True
805805
:param kwargs: reserved
806806
:return: code
807807
code: See the API code documentation for details.
@@ -826,7 +826,7 @@ Note:
826826
:param mvtime: reserved
827827
:param is_radian: the speed and acceleration are in radians or not, default is self.default_is_radian
828828
:param wait: whether to wait for the arm to complete, default is False
829-
:param timeout: maximum waiting time(unit: second), default is 10s, only valid if wait is True
829+
:param timeout: maximum waiting time(unit: second), default is None(no timeout), only valid if wait is True
830830
:return: code
831831
code: See the API code documentation for details.
832832
```
@@ -1062,7 +1062,7 @@ Note:
10621062
:param mvtime: reserved
10631063
:param is_radian: the speed and acceleration are in radians or not, default is self.default_is_radian
10641064
:param wait: whether to wait for the arm to complete, default is False
1065-
:param timeout: maximum waiting time(unit: second), default is 10s, only valid if wait is True
1065+
:param timeout: maximum waiting time(unit: second), default is None(no timeout), only valid if wait is True
10661066
```
10671067

10681068
#### def __run_blockly_app__(self, path, **kwargs):
@@ -1418,7 +1418,7 @@ Note:
14181418
:param relative: relative move or not
14191419
:param is_radian: the roll/pitch/yaw in radians or not, default is self.default_is_radian
14201420
:param wait: whether to wait for the arm to complete, default is False
1421-
:param timeout: maximum waiting time(unit: second), default is 10s, only valid if wait is True
1421+
:param timeout: maximum waiting time(unit: second), default is None(no timeout), only valid if wait is True
14221422
:param kwargs: reserved
14231423
:return: code
14241424
code: See the API code documentation for details.
@@ -1509,7 +1509,7 @@ Note:
15091509
:param relative: relative move or not
15101510
:param is_radian: the angle in radians or not, default is self.default_is_radian
15111511
:param wait: whether to wait for the arm to complete, default is False
1512-
:param timeout: maximum waiting time(unit: second), default is 10s, only valid if wait is True
1512+
:param timeout: maximum waiting time(unit: second), default is None(no timeout), only valid if wait is True
15131513
:param kwargs: reserved
15141514
:return: code
15151515
code: See the API code documentation for details.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
except ImportError:
1313
from distutils.core import setup
1414
def find_packages():
15-
return ['xarm', 'xarm.__version__', 'xarm.core', 'xarm.core.comm', 'xarm.core.utils', 'xarm.core.wrapper', 'xarm.wrapper']
15+
return ['xarm', 'xarm.x3', 'xarm.core', 'xarm.core.comm', 'xarm.core.utils', 'xarm.core.wrapper', 'xarm.wrapper']
1616
import os
1717
from distutils.util import convert_path
1818

xarm/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.2.0'
1+
__version__ = '1.2.2'

xarm/wrapper/xarm_api.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ def set_position(self, x=None, y=None, z=None, roll=None, pitch=None, yaw=None,
592592
:param relative: relative move or not
593593
:param is_radian: the roll/pitch/yaw in radians or not, default is self.default_is_radian
594594
:param wait: whether to wait for the arm to complete, default is False
595-
:param timeout: maximum waiting time(unit: second), default is 10s, only valid if wait is True
595+
:param timeout: maximum waiting time(unit: second), default is None(no timeout), only valid if wait is True
596596
:param kwargs: reserved
597597
:return: code
598598
code: See the API code documentation for details.
@@ -646,7 +646,7 @@ def set_servo_angle(self, servo_id=None, angle=None, speed=None, mvacc=None, mvt
646646
:param relative: relative move or not
647647
:param is_radian: the angle in radians or not, default is self.default_is_radian
648648
:param wait: whether to wait for the arm to complete, default is False
649-
:param timeout: maximum waiting time(unit: second), default is 10s, only valid if wait is True
649+
:param timeout: maximum waiting time(unit: second), default is None(no timeout), only valid if wait is True
650650
:param kwargs: reserved
651651
:return: code
652652
code: See the API code documentation for details.
@@ -686,7 +686,7 @@ def move_circle(self, pose1, pose2, percent, speed=None, mvacc=None, mvtime=None
686686
:param mvtime: 0, reserved
687687
:param is_radian: roll/pitch/yaw value is radians or not, default is self.default_is_radian
688688
:param wait: whether to wait for the arm to complete, default is False
689-
:param timeout: maximum waiting time(unit: second), default is 10s, only valid if wait is True
689+
:param timeout: maximum waiting time(unit: second), default is None(no timeout), only valid if wait is True
690690
:param kwargs: reserved
691691
:return: code
692692
code: See the API code documentation for details.
@@ -711,7 +711,7 @@ def move_gohome(self, speed=None, mvacc=None, mvtime=None, is_radian=None, wait=
711711
:param mvtime: reserved
712712
:param is_radian: the speed and acceleration are in radians or not, default is self.default_is_radian
713713
:param wait: whether to wait for the arm to complete, default is False
714-
:param timeout: maximum waiting time(unit: second), default is 10s, only valid if wait is True
714+
:param timeout: maximum waiting time(unit: second), default is None(no timeout), only valid if wait is True
715715
:return: code
716716
code: See the API code documentation for details.
717717
"""
@@ -1123,7 +1123,7 @@ def reset(self, speed=None, mvacc=None, mvtime=None, is_radian=None, wait=False,
11231123
:param mvtime: reserved
11241124
:param is_radian: the speed and acceleration are in radians or not, default is self.default_is_radian
11251125
:param wait: whether to wait for the arm to complete, default is False
1126-
:param timeout: maximum waiting time(unit: second), default is 10s, only valid if wait is True
1126+
:param timeout: maximum waiting time(unit: second), default is None(no timeout), only valid if wait is True
11271127
"""
11281128
return self._arm.reset(speed=speed, mvacc=mvacc, mvtime=mvtime, is_radian=is_radian, wait=wait, timeout=timeout)
11291129

xarm/x3/__init__.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,8 @@ def _sync(self):
10721072
class _WaitMove:
10731073
def __init__(self, owner, timeout):
10741074
self.owner = owner
1075-
self.timeout = timeout if timeout is not None else 10
1075+
# self.timeout = timeout if timeout is not None else 10
1076+
self.timeout = timeout if timeout is not None else -1
10761077
self.timer = None
10771078
self.is_timeout = False
10781079

@@ -1086,22 +1087,28 @@ def start(self):
10861087
self.check_stop_move()
10871088

10881089
def check_stop_move(self):
1089-
base_joint_pos = self.owner.angles.copy()
1090+
# base_joint_pos = self.owner.angles.copy()
10901091
time.sleep(0.1)
10911092
count = 0
10921093
while not self.is_timeout and not self.owner._is_stop and self.owner.connected and not self.owner.has_error:
10931094
if self.owner.state == 4:
10941095
self.owner._sleep_finish_time = 0
10951096
break
10961097
if time.time() < self.owner._sleep_finish_time:
1097-
time.sleep(0.01)
1098+
time.sleep(0.02)
1099+
count = 0
1100+
continue
1101+
if self.owner.state == 3:
1102+
time.sleep(0.02)
1103+
count = 0
10981104
continue
1099-
if self.owner.angles == base_joint_pos or self.owner.state != 1:
1105+
# if self.owner.angles == base_joint_pos or self.owner.state != 1:
1106+
if self.owner.state != 1:
11001107
count += 1
11011108
if count >= 10:
11021109
break
11031110
else:
1104-
base_joint_pos = self.owner._angles.copy()
1111+
# base_joint_pos = self.owner._angles.copy()
11051112
count = 0
11061113
time.sleep(0.05)
11071114
# if not self.is_timeout:

xarm/x3/gripper.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,10 @@ def _get_modbus_gripper_err_code(self):
313313
ret = self.arm_cmd.gripper_modbus_get_errcode()
314314
logger.info('API -> get_modbus_gripper_err_code -> ret={}'.format(ret))
315315
if ret[0] in [0, XCONF.UxbusState.ERR_CODE, XCONF.UxbusState.WAR_CODE]:
316-
self._gripper_error_code = ret[1]
316+
if ret[1] < 128:
317+
self._gripper_error_code = ret[1]
318+
# if ret[1] != 0:
319+
# logger.error('gripper error: {}'.format(ret[1]))
317320
if ret[0] == XCONF.UxbusState.ERR_CODE:
318321
self.get_err_warn_code()
319322
if self.error_code == 19 or self.error_code == 28:

0 commit comments

Comments
 (0)