From 1f4a29139868bc045fbb8208f1a34e3b6e2ed0d0 Mon Sep 17 00:00:00 2001 From: weiquan Date: Fri, 9 Dec 2022 17:14:27 +0800 Subject: [PATCH] release v3.0.1 --- CHANGELOG.md | 6 ++++++ pymycobot/__init__.py | 2 +- pymycobot/mybuddy.py | 10 +++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3af3a43..0ab7952 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # ChangeLog for pymycobot +## v3.0.1 (2022-12-9) + +- release v3.0.1 +- Fix MyBuddy interface problems: get_base_coords() +- Add mybuddy serial port to read logs + ## v3.0.0 (2022-12-9) - release v3.0.0 diff --git a/pymycobot/__init__.py b/pymycobot/__init__.py index 88f79a3..66e3aa7 100644 --- a/pymycobot/__init__.py +++ b/pymycobot/__init__.py @@ -43,7 +43,7 @@ from pymycobot.mybuddyemoticon import MyBuddyEmoticon __all__.append("MyBuddyEmoticon") -__version__ = "3.0.0" +__version__ = "3.0.1" __author__ = "Elephantrobotics" __email__ = "weiquan.xu@elephantrobotics.com" __git_url__ = "https://github.com/elephantrobotics/pymycobot" diff --git a/pymycobot/mybuddy.py b/pymycobot/mybuddy.py index 3061fe8..3bd704f 100644 --- a/pymycobot/mybuddy.py +++ b/pymycobot/mybuddy.py @@ -110,6 +110,7 @@ def _read(self): break else: datas = None + self.log.debug("_read: {}".format(datas)) return datas def _mesg(self, genre, *args, **kwargs): @@ -170,11 +171,18 @@ def _mesg(self, genre, *args, **kwargs): return self._int2angle(res[0]) if res else None elif genre in [ProtocolCode.GET_ALL_BASE_COORDS, ProtocolCode.GET_COORDS, ProtocolCode.GET_TOOL_REFERENCE, ProtocolCode.GET_WORLD_REFERENCE, ProtocolCode.GET_BASE_COORDS, ProtocolCode.GET_BASE_COORD, ProtocolCode.BASE_TO_SINGLE_COORDS]: if res: - r = [] + r = [] for idx in range(3): r.append(self._int2coord(res[idx])) for idx in range(3, 6): r.append(self._int2angle(res[idx])) + if len(res) == 12: + r1 = [] + for idx in range(6, 9): + r1.append(self._int2coord(res[idx])) + for idx in range(9, 12): + r1.append(self._int2angle(res[idx])) + return [r, r1] return r else: return res