Skip to content

Commit

Permalink
release v2.9.7
Browse files Browse the repository at this point in the history
  • Loading branch information
anla-xu committed Nov 14, 2022
1 parent ff30c40 commit cd6f175
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 15 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ChangeLog for pymycobot

## v2.9.7 (2022-11-14)

- release v2.9.7
- Add MechArm class: Separate mecharm from mycobot
- Fix known bug

## v2.9.6 (2022-9-13)

- release v2.9.6
Expand Down
23 changes: 16 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ We support Python2, Python3.5 or later.
<!-- vim-markdown-toc GFM -->

- [pymycobot](#pymycobot)
- [MyCobot / Mypalletizer](#mycobot--mypalletizer)
- [MyCobot / Mypalletizer / MechArm](#mycobot--mypalletizer--mecharm)
- [Overall status](#overall-status)
- [power_on](#power_on)
- [power_off](#power_off)
Expand Down Expand Up @@ -229,7 +229,7 @@ We support Python2, Python3.5 or later.
<!-- vim-markdown-toc -->
</details>

# MyCobot / Mypalletizer
# MyCobot / Mypalletizer / MechArm

**Import to your project**:

Expand All @@ -239,6 +239,15 @@ from pymycobot import MyCobot

# for mypalletizer
# from pymycobot import MyPalletizer

# for MechArm
# from pymycobot import MechArm

mc = MyCobot("com10",115200)
# mc = MyPalletizer("com10",115200)
# mc = MechArm("com10",115200)

print(mc.get_angles())
```

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

- **Parameters**:

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

- **Example**
Expand Down Expand Up @@ -434,7 +443,7 @@ Set command refresh mode

- **Parameters**

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

Expand All @@ -457,7 +466,7 @@ Set command refresh mode

- **Parameters**

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

Expand All @@ -482,7 +491,7 @@ Set command refresh mode

- **Parameters**

- `data`: A data list, angles or coords, length 6.
- `data`: A data list, angles or coords.
- `flag`: Tag the data type, `0` - angles, `1` - coords.

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

- **Parameters**:
- `encoders`: A encoder list, length 6.
- `encoders`: A encoder list.
- `sp`: speed 0 - 100

### get_encoders
Expand Down
2 changes: 1 addition & 1 deletion pymycobot/Interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ def set_gripper_value(self, id, value, speed):
value (int): 0 ~ 100
speed (int): 0 - 100
"""
return self._mesg(ProtocolCode.SET_GRIPPER_VALUE, id, value)
return self._mesg(ProtocolCode.SET_GRIPPER_VALUE, id, value, speed)

def set_gripper_calibration(self, id):
"""Set the current position to zero, set current position value is `2048`.
Expand Down
15 changes: 11 additions & 4 deletions pymycobot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@

from __future__ import absolute_import
import datetime
import sys

from pymycobot.generate import MyCobotCommandGenerator
from pymycobot.Interface import MyBuddyCommandGenerator
from pymycobot.mycobot import MyCobot
from pymycobot.mybuddy import MyBuddy
from pymycobot.mecharm import MechArm
from pymycobot.mypalletizer import MyPalletizer
from pymycobot.mycobotsocket import MyCobotSocket
from pymycobot.genre import Angle, Coord
from pymycobot import utils
from pymycobot.mybuddysocket import MyBuddySocket
from pymycobot.mira import Mira
from pymycobot.mybuddybluetooth import MyBuddyBlueTooth
from pymycobot.mybuddyemoticon import MyBuddyEmoticon
from pymycobot.mypalletizersocket import MyPalletizerSocket


__all__ = [
"MyCobot",
Expand All @@ -30,11 +32,16 @@
"MyBuddySocket",
"MyBuddyBlueTooth",
"Mira",
"MyBuddyEmoticon",
"MyPalletizerSocket"
"MyPalletizerSocket",
"MechArm"
]

__version__ = "2.9.7b3"

if sys.platform == "linux":
from pymycobot.mybuddyemoticon import MyBuddyEmoticon
__all__.append("MyBuddyEmoticon")

__version__ = "2.9.7"
__author__ = "Elephantrobotics"
__email__ = "[email protected]"
__git_url__ = "https://github.com/elephantrobotics/pymycobot"
Expand Down
1 change: 0 additions & 1 deletion pymycobot/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ def read(self, genre):
wait_time = 1
while True and time.time() - t < wait_time:
data = self._serial_port.read()
# print("1:",data)
k += 1
if data_len == 1 and data == b"\xfa":
datas += data
Expand Down
6 changes: 6 additions & 0 deletions pymycobot/mecharm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# coding=utf-8
from pymycobot import MyCobot

class MechArm(MyCobot):
def __init__(self, port, baudrate="115200", timeout=0.1, debug=False):
super().__init__(port, baudrate, timeout, debug)
2 changes: 0 additions & 2 deletions pymycobot/mira.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# coding: utf-8
from ctypes.wintypes import SIZE
import time
from tkinter import E
from pymycobot.common import ProtocolCode
import math

Expand Down

0 comments on commit cd6f175

Please sign in to comment.