Skip to content

Commit b029bbf

Browse files
committed
release v2.5.7
1 parent d75e68d commit b029bbf

File tree

6 files changed

+17
-13
lines changed

6 files changed

+17
-13
lines changed

CHANGELOG.md

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

3+
## v2.5.7 (2021-08-05)
4+
5+
- release v2.5.7
6+
- fix error. [#19](https://github.com/elephantrobotics/pymycobot/issues/19) [#20](https://github.com/elephantrobotics/pymycobot/issues/20)
7+
38
## v2.5.6 (2021-07-30)
49

510
- release v2.5.6

pymycobot/__init__.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
from __future__ import absolute_import
2-
import os
32

4-
if os.environ.get("_MYCOBOT_VERSION_ONLY") != "1":
5-
from pymycobot.mycobot import MyCobot
6-
from pymycobot.generate import MycobotCommandGenerater
7-
from pymycobot.genre import Angle, Coord
3+
from pymycobot.mycobot import MyCobot
4+
from pymycobot.generate import MycobotCommandGenerater
5+
from pymycobot.genre import Angle, Coord
86

9-
__all__ = ["MyCobot", "MycobotCommandGenerater", "Angle", "Coord", "utils"]
7+
__all__ = ["MyCobot", "MycobotCommandGenerater", "Angle", "Coord", "utils"]
108

11-
__version__ = "2.5.6"
9+
__version__ = "2.5.7"
1210
__author__ = "Zachary zhang"
1311
__email__ = "lijun.zhang@elephantrobotics.com"
1412
__git_url__ = "https://github.com/elephantrobotics/pymycobot"

pymycobot/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class Command(object):
7474

7575
# Basic
7676
SET_BASIC_OUTPUT = 0xA0
77-
GET_BASIC_OUTPUT = 0xA1
77+
GET_BASIC_INPUT = 0xA1
7878

7979

8080
class DataProcessor(object):

pymycobot/generate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def get_encoder(self, joint_id):
324324
def set_encoders(self, encoders, sp):
325325
return self._mesg(Command.SET_ENCODERS, encoders, sp)
326326

327-
def set_encoders(self):
327+
def get_encoders(self):
328328
return self._mesg(Command.GET_ENCODERS, has_reply=True)
329329

330330
# Running status and Settings
@@ -491,4 +491,4 @@ def get_basic_input(self, pin_no):
491491
Args:
492492
pin_no: pin port number.
493493
"""
494-
return self._mesg(Command.GET_BASIC_OUTPUT, pin_no, has_reply=True)
494+
return self._mesg(Command.GET_BASIC_INPUT, pin_no, has_reply=True)

pymycobot/mycobot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import time
22
import math
3-
import serial
43
import logging
54

65
from pymycobot.log import setup_logging
@@ -55,6 +54,8 @@ def __init__(self, port, baudrate="115200", timeout=0.1, debug=False):
5554
self.debug = debug
5655
setup_logging(self.debug)
5756
self.log = logging.getLogger(__name__)
57+
import serial
58+
5859
self._serial_port = serial.Serial(port, baudrate, timeout=timeout)
5960

6061
def _write(self, command):
@@ -104,6 +105,8 @@ def _mesg(self, genre, *args, **kwargs):
104105
Command.GET_GRIPPER_VALUE,
105106
Command.IS_GRIPPER_MOVING,
106107
Command.GET_SPEED,
108+
Command.GET_ENCODER,
109+
Command.GET_BASIC_INPUT,
107110
]:
108111
return self._process_single(res)
109112
elif genre in [Command.GET_ANGLES]:

setup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
import sys
32

43
PYTHON_VERSION = sys.version_info[:2]
@@ -8,7 +7,6 @@
87

98
import setuptools
109

11-
os.environ["_MYCOBOT_VERSION_ONLY"] = "1"
1210
import pymycobot
1311

1412
if PYTHON_VERSION == (2, 7):

0 commit comments

Comments
 (0)