Skip to content

Commit

Permalink
release v3.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
anla-xu committed Jul 6, 2023
1 parent 8493ea8 commit 02a11c0
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# ChangeLog for pymycobot

## v3.1.5 (2023-07-06)

- release v3.1.5
- Add mycobot interface:get_basic_version(),set_communicate_mode()

## v3.1.4 (2023-07-05)

- release v3.1.4
Expand Down
23 changes: 23 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ We support Python2, Python3.5 or later.
- [set\_plan\_speed](#set_plan_speed)
- [set\_plan\_acceleration](#set_plan_acceleration)
- [set\_gservo\_round](#set_gservo_round)
- [get\_basic\_version](#get_basic_version)
- [set\_communicate\_mode](#set_communicate_mode)
- [get\_servo\_speeds](#get_servo_speeds)
- [get\_servo\_currents](#get_servo_currents)
- [get\_servo\_voltages](#get_servo_voltages)
Expand Down Expand Up @@ -1115,6 +1117,27 @@ Set the terminal atom io status
255 : Keep turning
1 ~ 254: Based on 30° (1->30°, 2->60°)

### get_basic_version

- **Prototype**: `get_basic_version()`

- **Description**: Get basic firmware version.

- **Return**

- `version` (`float`)

### set_communicate_mode

- **Prototype**: `set_communicate_mode(mode)`

- **Description**: Set basic communication mode.

- **Parameters**

- `mode` (`int`) 0 - Turn off transparent transmission. 1 - Open transparent transmission


### get_servo_speeds

- **Prototype**: `get_servo_speeds()`
Expand Down
2 changes: 1 addition & 1 deletion pymycobot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
from pymycobot.mybuddyemoticon import MyBuddyEmoticon
__all__.append("MyBuddyEmoticon")

__version__ = "3.1.4"
__version__ = "3.1.5"
__author__ = "Elephantrobotics"
__email__ = "[email protected]"
__git_url__ = "https://github.com/elephantrobotics/pymycobot"
Expand Down
2 changes: 2 additions & 0 deletions pymycobot/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ class ProtocolCode(object):

# Get the measured distance
GET_TOF_DISTANCE = 0xC0
GET_BASIC_VERSION = 0xC1
SET_COMMUNICATE_MODE = 0xC2

# Coordinate transformation
SET_TOOL_REFERENCE = 0x81
Expand Down
13 changes: 13 additions & 0 deletions pymycobot/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,3 +1041,16 @@ def set_gservo_round(self, angle):
1 ~ 254: Based on 30° (1->30°, 2->60°)
"""
return self._mesg(ProtocolCode.SET_GSERVO_ROUND, angle)


def get_basic_version(self):
"""Get basic firmware version"""
return self._mesg(ProtocolCode.GET_BASIC_VERSION, has_reply = True)

def set_communicate_mode(self, mode):
"""Set basic communication mode
Args:
mode: 0 - Turn off transparent transmission,1 - Open transparent transmission
"""
return self._mesg(ProtocolCode.SET_COMMUNICATE_MODE, mode)
2 changes: 2 additions & 0 deletions pymycobot/mycobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ def _mesg(self, genre, *args, **kwargs):
return [self._int2coord(angle) for angle in res]
elif genre in [ProtocolCode.GET_JOINT_MAX_ANGLE, ProtocolCode.GET_JOINT_MIN_ANGLE]:
return self._int2coord(res[0])
elif genre in [ProtocolCode.GET_BASIC_VERSION, ProtocolCode.SOFTWARE_VERSION]:
return self._int2coord(self._process_single(res))
else:
return res
return None
Expand Down
2 changes: 2 additions & 0 deletions pymycobot/mypalletizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ def _mesg(self, genre, *args, **kwargs):
ProtocolCode.GET_JOINT_MAX_ANGLE,
]:
return self._int2angle(res[0]) if res else 0
elif genre in [ProtocolCode.GET_BASIC_VERSION, ProtocolCode.SOFTWARE_VERSION]:
return self._int2coord(self._process_single(res))
else:
return res
return None
Expand Down

0 comments on commit 02a11c0

Please sign in to comment.