Skip to content

Commit df4dd44

Browse files
committed
release v3.0.0
1 parent fb0f602 commit df4dd44

File tree

6 files changed

+45
-10
lines changed

6 files changed

+45
-10
lines changed

CHANGELOG.md

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

3+
## v3.0.0 (2022-12-9)
4+
5+
- release v3.0.0
6+
- Fix MyBuddy interface problems: get_base_coords()、set_gripper_state()
7+
- Add 7-axis myArm interface
8+
39
## v2.9.9 (2022-11-29)
410

511
- release 2.9.9

pymycobot/Interface.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,14 +716,15 @@ def get_gripper_value(self, id):
716716
"""
717717
return self._mesg(ProtocolCode.GET_GRIPPER_VALUE, id, has_reply=True)
718718

719-
def set_gripper_state(self, id, flag):
719+
def set_gripper_state(self, id, flag, sp):
720720
"""Set gripper switch state
721721
722722
Args:
723723
id: 1/2 (L/R)
724-
flag (int): 0 - close, 1 - open
724+
flag (int): 0 - open, 1 - close
725+
sp: int (1 - 100)
725726
"""
726-
return self._mesg(ProtocolCode.SET_GRIPPER_STATE, id, flag)
727+
return self._mesg(ProtocolCode.SET_GRIPPER_STATE, id, flag, sp)
727728

728729
def set_gripper_value(self, id, value, speed):
729730
"""Set gripper value

pymycobot/__init__.py

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

46-
__version__ = "3.0.0b2"
46+
__version__ = "3.0.0"
4747
__author__ = "Elephantrobotics"
4848
__email__ = "[email protected]"
4949
__git_url__ = "https://github.com/elephantrobotics/pymycobot"

pymycobot/generate.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ def is_power_on(self):
175175
return self._mesg(ProtocolCode.IS_POWER_ON, has_reply=True)
176176

177177
def release_all_servos(self):
178+
"""Relax all joints"""
178179
return self._mesg(ProtocolCode.RELEASE_ALL_SERVOS)
179180

180181
def is_controller_connected(self):
@@ -653,10 +654,8 @@ def get_digital_input(self, pin_no):
653654
"""singal value"""
654655
return self._mesg(ProtocolCode.GET_DIGITAL_INPUT, pin_no, has_reply=True)
655656

656-
"""
657-
def set_pwm_mode(self, pin_no, channel):
658-
self._mesg(Command.SET_PWM_MODE, pin_no, channel)
659-
"""
657+
def set_pwm_mode(self, mode):
658+
return self._mesg(ProtocolCode.SET_PWM_MODE, mode)
660659

661660
def set_pwm_output(self, channel, frequency, pin_val):
662661
""" PWM control

pymycobot/myarm.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ def _mesg(self, genre, *args, **kwargs):
111111
ProtocolCode.GET_JOINT_MIN_ANGLE,
112112
ProtocolCode.GET_JOINT_MAX_ANGLE,
113113
ProtocolCode.GET_FRESH_MODE,
114-
ProtocolCode.GET_GRIPPER_MODE
114+
ProtocolCode.GET_GRIPPER_MODE,
115+
ProtocolCode.SET_SSID_PWD
115116
]:
116117
return self._process_single(res)
117118
elif genre in [ProtocolCode.GET_ANGLES]:
@@ -222,3 +223,31 @@ def set_solution_angles(self, angle, speed):
222223
def get_solution_angles(self):
223224
"""Get zero space deflection angle value"""
224225
return self._mesg(ProtocolCode.GET_SOLUTION_ANGLES, has_reply=True)
226+
227+
def release_all_servos(self, data):
228+
"""Relax all joints
229+
230+
Args:
231+
data: 1 - Undamping (The default is damping)
232+
"""
233+
return self._mesg(ProtocolCode.RELEASE_ALL_SERVOS, data)
234+
235+
def get_transpoendr_mode(self):
236+
"""Obtain the configuration information of serial transmission mode
237+
238+
Return:
239+
mode: 0 - 1 - 2
240+
"""
241+
return self._mesg(ProtocolCode.SET_SSID_PWD, has_reply=True)
242+
243+
def set_transpoendr_mode(self, mode):
244+
"""Set serial port transmission mode
245+
246+
Args:
247+
mode:
248+
0 - Turn off transparent transmission.\n
249+
1 - Turn on transparent transmission. verify all data.\n
250+
2 - Turn on transparent transmission, only verify the configuration information of communication forwarding mode (default is 0)
251+
"""
252+
return self._mesg(ProtocolCode.GET_SSID_PWD, mode)
253+

pymycobot/mybuddy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def _mesg(self, genre, *args, **kwargs):
168168
return self._int2coord(res[0]) if res else None
169169
else:
170170
return self._int2angle(res[0]) if res else None
171-
elif genre in [ProtocolCode.GET_COORDS, ProtocolCode.GET_TOOL_REFERENCE, ProtocolCode.GET_WORLD_REFERENCE, ProtocolCode.GET_BASE_COORDS, ProtocolCode.GET_BASE_COORD, ProtocolCode.BASE_TO_SINGLE_COORDS]:
171+
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]:
172172
if res:
173173
r = []
174174
for idx in range(3):

0 commit comments

Comments
 (0)