Skip to content

Commit 02a11c0

Browse files
committed
release v3.1.5
1 parent 8493ea8 commit 02a11c0

File tree

7 files changed

+48
-1
lines changed

7 files changed

+48
-1
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+
## v3.1.5 (2023-07-06)
4+
5+
- release v3.1.5
6+
- Add mycobot interface:get_basic_version(),set_communicate_mode()
7+
38
## v3.1.4 (2023-07-05)
49

510
- release v3.1.4

docs/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ We support Python2, Python3.5 or later.
9696
- [set\_plan\_speed](#set_plan_speed)
9797
- [set\_plan\_acceleration](#set_plan_acceleration)
9898
- [set\_gservo\_round](#set_gservo_round)
99+
- [get\_basic\_version](#get_basic_version)
100+
- [set\_communicate\_mode](#set_communicate_mode)
99101
- [get\_servo\_speeds](#get_servo_speeds)
100102
- [get\_servo\_currents](#get_servo_currents)
101103
- [get\_servo\_voltages](#get_servo_voltages)
@@ -1115,6 +1117,27 @@ Set the terminal atom io status
11151117
255 : Keep turning
11161118
1 ~ 254: Based on 30° (1->30°, 2->60°)
11171119

1120+
### get_basic_version
1121+
1122+
- **Prototype**: `get_basic_version()`
1123+
1124+
- **Description**: Get basic firmware version.
1125+
1126+
- **Return**
1127+
1128+
- `version` (`float`)
1129+
1130+
### set_communicate_mode
1131+
1132+
- **Prototype**: `set_communicate_mode(mode)`
1133+
1134+
- **Description**: Set basic communication mode.
1135+
1136+
- **Parameters**
1137+
1138+
- `mode` (`int`) 0 - Turn off transparent transmission. 1 - Open transparent transmission
1139+
1140+
11181141
### get_servo_speeds
11191142

11201143
- **Prototype**: `get_servo_speeds()`

pymycobot/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
from pymycobot.mybuddyemoticon import MyBuddyEmoticon
4545
__all__.append("MyBuddyEmoticon")
4646

47-
__version__ = "3.1.4"
47+
__version__ = "3.1.5"
4848
__author__ = "Elephantrobotics"
4949
__email__ = "[email protected]"
5050
__git_url__ = "https://github.com/elephantrobotics/pymycobot"

pymycobot/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ class ProtocolCode(object):
121121

122122
# Get the measured distance
123123
GET_TOF_DISTANCE = 0xC0
124+
GET_BASIC_VERSION = 0xC1
125+
SET_COMMUNICATE_MODE = 0xC2
124126

125127
# Coordinate transformation
126128
SET_TOOL_REFERENCE = 0x81

pymycobot/generate.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,3 +1041,16 @@ def set_gservo_round(self, angle):
10411041
1 ~ 254: Based on 30° (1->30°, 2->60°)
10421042
"""
10431043
return self._mesg(ProtocolCode.SET_GSERVO_ROUND, angle)
1044+
1045+
1046+
def get_basic_version(self):
1047+
"""Get basic firmware version"""
1048+
return self._mesg(ProtocolCode.GET_BASIC_VERSION, has_reply = True)
1049+
1050+
def set_communicate_mode(self, mode):
1051+
"""Set basic communication mode
1052+
1053+
Args:
1054+
mode: 0 - Turn off transparent transmission,1 - Open transparent transmission
1055+
"""
1056+
return self._mesg(ProtocolCode.SET_COMMUNICATE_MODE, mode)

pymycobot/mycobot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ def _mesg(self, genre, *args, **kwargs):
129129
return [self._int2coord(angle) for angle in res]
130130
elif genre in [ProtocolCode.GET_JOINT_MAX_ANGLE, ProtocolCode.GET_JOINT_MIN_ANGLE]:
131131
return self._int2coord(res[0])
132+
elif genre in [ProtocolCode.GET_BASIC_VERSION, ProtocolCode.SOFTWARE_VERSION]:
133+
return self._int2coord(self._process_single(res))
132134
else:
133135
return res
134136
return None

pymycobot/mypalletizer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ def _mesg(self, genre, *args, **kwargs):
163163
ProtocolCode.GET_JOINT_MAX_ANGLE,
164164
]:
165165
return self._int2angle(res[0]) if res else 0
166+
elif genre in [ProtocolCode.GET_BASIC_VERSION, ProtocolCode.SOFTWARE_VERSION]:
167+
return self._int2coord(self._process_single(res))
166168
else:
167169
return res
168170
return None

0 commit comments

Comments
 (0)