Skip to content

Commit a273393

Browse files
committed
fix bug
1 parent cf03720 commit a273393

File tree

6 files changed

+90
-10
lines changed

6 files changed

+90
-10
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# ChangeLog for pymycobot
22

3-
## v3.3.4 (2023-12-121)
3+
## v3.3.5 (2023-12-29)
4+
5+
- release v3.3.5
6+
- fix bug
7+
8+
## v3.3.4 (2023-12-21)
49

510
- release v3.3.4
611
- fix bug

docs/Mercury_API.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
### power_on()
2+
控制机器人上电
3+
4+
### power_off()
5+
控制机器人下电
6+
7+
### get_angles()
8+
获取机器人全关节角度信息
9+
10+
* **返回**
11+
长度为6的列表
12+
13+
### get_angle(joint_id)
14+
获取机器人单个关节的角度信息
15+
16+
* **参数**
17+
18+
**joint_id** – 关节ID号。
19+
20+
* **返回**
21+
指定关节的角度信息
22+
23+
### send_angles(angles, speed)
24+
控制机器人全角度运动
25+
26+
* **参数**
27+
28+
**angles** – 长度为6的列表。
29+
**speed** – 机器人运动的速度。
30+
31+
### get_coords()
32+
获取机器人的坐标位置
33+
34+
* **返回**
35+
长度为6的列表,[x, y, z, rx, ry, rz]
36+
37+
### send_coords(coords, speed)
38+
控制机器人坐标运动
39+
40+
* **参数**
41+
42+
**coords** – 长度为6的列表。
43+
**speed** – 机器人运动的速度。
44+
<!--
45+
#### 未完待续...
46+
47+
## 案例
48+
49+
```python
50+
from pymycobot import Mercury
51+
import time
52+
mc = Mercury("/dev/ttyAMA1", 115200)
53+
54+
print(mc.get_angles())
55+
56+
mc.send_angles([0, 0, 0, 0, 90, 0, 0], 40)
57+
time.sleep(5)
58+
mc.send_coords([100, 0, 300, 0, 0, 0], 40)
59+
``` -->

pymycobot/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
from pymycobot.mybuddyemoticon import MyBuddyEmoticon
5555
__all__.append("MyBuddyEmoticon")
5656

57-
__version__ = "3.3.4"
57+
__version__ = "3.3.5"
5858
__author__ = "Elephantrobotics"
5959
__email__ = "weiquan.xu@elephantrobotics.com"
6060
__git_url__ = "https://github.com/elephantrobotics/pymycobot"

pymycobot/myagv.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,4 +322,12 @@ def get_mcu_info(self):
322322
def restore(self):
323323
"""Motor stall recovery"""
324324
self._mesg(ProtocolCode.RESTORE.value, 1)
325-
325+
326+
# def get_battery_voltage(self, num=1):
327+
# """Get battery voltage
328+
329+
# Args:
330+
# num (int, optional): Battery ID number. Defaults to 1.
331+
# """
332+
# mcu_data = self.get_mcu_info()
333+
# return self._mesg(ProtocolCode.GET_BATTERY_INFO.value, has_reply = True)

pymycobot/robot_limit.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
},
1616
"MyCobot":{
1717
"id":[1,2,3,4,5,6, 7],
18-
"angles_min":[-170, -135, -150, -145, -170, -180],
19-
"angles_max":[170, 140, 150, 135, 170, 180],
18+
"angles_min":[-168, -135, -150, -145, -165, -180],
19+
"angles_max":[168, 135, 150, 145, 165, 180],
2020
"coords_min":[-350, -350, -70, -180, -180, -180],
2121
"coords_max":[350, 350, 523.9, 180, 180, 180]
2222
},
2323
"MyCobotSocket":{
2424
"id":[1,2,3,4,5,6, 7],
25-
"angles_min":[-170, -135, -150, -145, -170, -180],
26-
"angles_max":[170, 140, 150, 135, 170, 180],
25+
"angles_min":[-168, -135, -150, -145, -165, -180],
26+
"angles_max":[168, 135, 150, 145, 165, 180],
2727
"coords_min":[-350, -350, -70, -180, -180, -180],
2828
"coords_max":[350, 350, 523.9, 180, 180, 180]
2929
},

pymycobot/ultraArm.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,24 @@ def _request(self, flag=""):
122122
qsize = int(q[qstart + 1 : qend])
123123
return qsize
124124
except Exception as e:
125-
print(e)
126125
count += 1
127126
continue
128127
elif flag == 'isStop':
129128
if "Moving end" in data:
130129
return 1
131130
else:
132131
return 0
133-
elif flag in ['gripper', 'system']:
134-
return int(data[data.find("[")+1:-1])
132+
elif flag == 'gripper':
133+
header = "GRIPPERANGLE["
134+
read = data.find(header)+len(header)
135+
# print(data[read:])
136+
end = data[read:].find(']')
137+
return data[read:read+end]
138+
elif flag == 'system':
139+
header = "ReadSYS["
140+
read = data.find(header)+len(header)
141+
end = data[read:].find(']')
142+
return data[read:read+end]
135143
elif flag == None:
136144
return 0
137145

0 commit comments

Comments
 (0)