Skip to content

Commit cd6f175

Browse files
committed
release v2.9.7
1 parent ff30c40 commit cd6f175

File tree

7 files changed

+40
-15
lines changed

7 files changed

+40
-15
lines changed

CHANGELOG.md

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

3+
## v2.9.7 (2022-11-14)
4+
5+
- release v2.9.7
6+
- Add MechArm class: Separate mecharm from mycobot
7+
- Fix known bug
8+
39
## v2.9.6 (2022-9-13)
410

511
- release v2.9.6

docs/README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ We support Python2, Python3.5 or later.
1010
<!-- vim-markdown-toc GFM -->
1111

1212
- [pymycobot](#pymycobot)
13-
- [MyCobot / Mypalletizer](#mycobot--mypalletizer)
13+
- [MyCobot / Mypalletizer / MechArm](#mycobot--mypalletizer--mecharm)
1414
- [Overall status](#overall-status)
1515
- [power_on](#power_on)
1616
- [power_off](#power_off)
@@ -229,7 +229,7 @@ We support Python2, Python3.5 or later.
229229
<!-- vim-markdown-toc -->
230230
</details>
231231

232-
# MyCobot / Mypalletizer
232+
# MyCobot / Mypalletizer / MechArm
233233

234234
**Import to your project**:
235235

@@ -239,6 +239,15 @@ from pymycobot import MyCobot
239239

240240
# for mypalletizer
241241
# from pymycobot import MyPalletizer
242+
243+
# for MechArm
244+
# from pymycobot import MechArm
245+
246+
mc = MyCobot("com10",115200)
247+
# mc = MyPalletizer("com10",115200)
248+
# mc = MechArm("com10",115200)
249+
250+
print(mc.get_angles())
242251
```
243252

244253
> Note: If no parameter is given, there is no parameter; if no return value is given, there is no return value
@@ -381,7 +390,7 @@ Set command refresh mode
381390

382391
- **Parameters**:
383392

384-
- `radians`: a list of radian value(`List[float]`), length 6.
393+
- `radians`: a list of radian value(`List[float]`).
385394
- `speed`: (`int`) 0 ~ 100
386395

387396
- **Example**
@@ -434,7 +443,7 @@ Set command refresh mode
434443

435444
- **Parameters**
436445

437-
- `coords`: a list of coords value(`List[float]`), length 6.
446+
- `coords`: a list of coords value(`List[float]`).
438447
- `speed`: (`int`) 0 ~ 100
439448
- `mode`: (`int`): `0` - angular, `1` - linear
440449

@@ -457,7 +466,7 @@ Set command refresh mode
457466

458467
- **Parameters**
459468

460-
- `degrees`: a list of degree value(`List[float]`), length 6.
469+
- `degrees`: a list of degree value(`List[float]`).
461470
- `speed`: (`int`) 0 ~ 100
462471
- `timeout`: default 7s.
463472

@@ -482,7 +491,7 @@ Set command refresh mode
482491

483492
- **Parameters**
484493

485-
- `data`: A data list, angles or coords, length 6.
494+
- `data`: A data list, angles or coords.
486495
- `flag`: Tag the data type, `0` - angles, `1` - coords.
487496

488497
- **Returns**
@@ -593,7 +602,7 @@ Set command refresh mode
593602
- **Description**: Set the six joints of the manipulator to execute synchronously to the specified position.
594603

595604
- **Parameters**:
596-
- `encoders`: A encoder list, length 6.
605+
- `encoders`: A encoder list.
597606
- `sp`: speed 0 - 100
598607

599608
### get_encoders

pymycobot/Interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ def set_gripper_value(self, id, value, speed):
742742
value (int): 0 ~ 100
743743
speed (int): 0 - 100
744744
"""
745-
return self._mesg(ProtocolCode.SET_GRIPPER_VALUE, id, value)
745+
return self._mesg(ProtocolCode.SET_GRIPPER_VALUE, id, value, speed)
746746

747747
def set_gripper_calibration(self, id):
748748
"""Set the current position to zero, set current position value is `2048`.

pymycobot/__init__.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22

33
from __future__ import absolute_import
44
import datetime
5+
import sys
56

67
from pymycobot.generate import MyCobotCommandGenerator
78
from pymycobot.Interface import MyBuddyCommandGenerator
89
from pymycobot.mycobot import MyCobot
910
from pymycobot.mybuddy import MyBuddy
11+
from pymycobot.mecharm import MechArm
1012
from pymycobot.mypalletizer import MyPalletizer
1113
from pymycobot.mycobotsocket import MyCobotSocket
1214
from pymycobot.genre import Angle, Coord
1315
from pymycobot import utils
1416
from pymycobot.mybuddysocket import MyBuddySocket
1517
from pymycobot.mira import Mira
1618
from pymycobot.mybuddybluetooth import MyBuddyBlueTooth
17-
from pymycobot.mybuddyemoticon import MyBuddyEmoticon
1819
from pymycobot.mypalletizersocket import MyPalletizerSocket
20+
1921

2022
__all__ = [
2123
"MyCobot",
@@ -30,11 +32,16 @@
3032
"MyBuddySocket",
3133
"MyBuddyBlueTooth",
3234
"Mira",
33-
"MyBuddyEmoticon",
34-
"MyPalletizerSocket"
35+
"MyPalletizerSocket",
36+
"MechArm"
3537
]
3638

37-
__version__ = "2.9.7b3"
39+
40+
if sys.platform == "linux":
41+
from pymycobot.mybuddyemoticon import MyBuddyEmoticon
42+
__all__.append("MyBuddyEmoticon")
43+
44+
__version__ = "2.9.7"
3845
__author__ = "Elephantrobotics"
3946
__email__ = "[email protected]"
4047
__git_url__ = "https://github.com/elephantrobotics/pymycobot"

pymycobot/common.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@ def read(self, genre):
383383
wait_time = 1
384384
while True and time.time() - t < wait_time:
385385
data = self._serial_port.read()
386-
# print("1:",data)
387386
k += 1
388387
if data_len == 1 and data == b"\xfa":
389388
datas += data

pymycobot/mecharm.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# coding=utf-8
2+
from pymycobot import MyCobot
3+
4+
class MechArm(MyCobot):
5+
def __init__(self, port, baudrate="115200", timeout=0.1, debug=False):
6+
super().__init__(port, baudrate, timeout, debug)

pymycobot/mira.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# coding: utf-8
2-
from ctypes.wintypes import SIZE
32
import time
4-
from tkinter import E
53
from pymycobot.common import ProtocolCode
64
import math
75

0 commit comments

Comments
 (0)