Skip to content

Commit 45a9521

Browse files
committed
[fix]1.Add bytes to int32 type;2.Importing Packages;3.Repair FX8500 joint limit
1 parent 6f69ef5 commit 45a9521

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

xarm/core/utils/convert.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,5 @@ def bytes_to_long_big(data):
120120
"""大端字节序"""
121121
return bytes_to_num32(data, '>l')
122122

123+
def bytes_to_int32(data):
124+
return int.from_bytes(data, byteorder='big', signed=True)

xarm/core/wrapper/uxbus_cmd.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
99

1010
import time
11+
import math
1112
import threading
1213
import functools
1314
from ..utils import convert

xarm/version.py

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

xarm/x3/xarm.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
88

99
import os
10+
import re
1011
import math
1112
import sys
1213
import time
1314
import uuid
15+
import socket
1416
import warnings
1517
from collections.abc import Iterable
1618
from ..core.config.x_config import XCONF
@@ -66,7 +68,7 @@ def _is_out_of_tcp_range(self, value, i):
6668
def _is_out_of_joint_range(self, angle, i):
6769
if not self._check_joint_limit or self._stream_type != 'socket' or not self._enable_report or angle == math.inf:
6870
return False
69-
device_type = int('{}1305'.format(self.axis)) if self.sn and int(self.sn[2:6]) >= 1305 else self.device_type
71+
device_type = int('{}1305'.format(self.axis)) if self.sn and int(self.sn[2:6]) >= 1305 and int(self.sn[2:6]) < 8500 else self.device_type
7072
joint_limit = XCONF.Robot.JOINT_LIMITS.get(self.axis).get(device_type, [])
7173
if i < len(joint_limit):
7274
angle_range = joint_limit[i]
@@ -767,7 +769,7 @@ def set_reduced_joint_range(self, joint_range, is_radian=None):
767769
# limits = list(map(lambda x: round(math.radians(x), 3), limits))
768770

769771
for i in range(self.axis):
770-
device_type = int('{}1305'.format(self.axis)) if self.sn and int(self.sn[2:6]) >= 1305 else self.device_type
772+
device_type = int('{}1305'.format(self.axis)) if self.sn and int(self.sn[2:6]) >= 1305 and int(self.sn[2:6]) < 8500 else self.device_type
771773
joint_limit = XCONF.Robot.JOINT_LIMITS.get(self.axis).get(device_type, [])
772774
if i < len(joint_limit):
773775
angle_range = joint_limit[i]

0 commit comments

Comments
 (0)