Skip to content

Commit

Permalink
release v3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
anla-xu committed Dec 9, 2022
1 parent fb0f602 commit df4dd44
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ChangeLog for pymycobot

## v3.0.0 (2022-12-9)

- release v3.0.0
- Fix MyBuddy interface problems: get_base_coords()、set_gripper_state()
- Add 7-axis myArm interface

## v2.9.9 (2022-11-29)

- release 2.9.9
Expand Down
7 changes: 4 additions & 3 deletions pymycobot/Interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,14 +716,15 @@ def get_gripper_value(self, id):
"""
return self._mesg(ProtocolCode.GET_GRIPPER_VALUE, id, has_reply=True)

def set_gripper_state(self, id, flag):
def set_gripper_state(self, id, flag, sp):
"""Set gripper switch state
Args:
id: 1/2 (L/R)
flag (int): 0 - close, 1 - open
flag (int): 0 - open, 1 - close
sp: int (1 - 100)
"""
return self._mesg(ProtocolCode.SET_GRIPPER_STATE, id, flag)
return self._mesg(ProtocolCode.SET_GRIPPER_STATE, id, flag, sp)

def set_gripper_value(self, id, value, speed):
"""Set gripper value
Expand Down
2 changes: 1 addition & 1 deletion pymycobot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
from pymycobot.mybuddyemoticon import MyBuddyEmoticon
__all__.append("MyBuddyEmoticon")

__version__ = "3.0.0b2"
__version__ = "3.0.0"
__author__ = "Elephantrobotics"
__email__ = "[email protected]"
__git_url__ = "https://github.com/elephantrobotics/pymycobot"
Expand Down
7 changes: 3 additions & 4 deletions pymycobot/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def is_power_on(self):
return self._mesg(ProtocolCode.IS_POWER_ON, has_reply=True)

def release_all_servos(self):
"""Relax all joints"""
return self._mesg(ProtocolCode.RELEASE_ALL_SERVOS)

def is_controller_connected(self):
Expand Down Expand Up @@ -653,10 +654,8 @@ def get_digital_input(self, pin_no):
"""singal value"""
return self._mesg(ProtocolCode.GET_DIGITAL_INPUT, pin_no, has_reply=True)

"""
def set_pwm_mode(self, pin_no, channel):
self._mesg(Command.SET_PWM_MODE, pin_no, channel)
"""
def set_pwm_mode(self, mode):
return self._mesg(ProtocolCode.SET_PWM_MODE, mode)

def set_pwm_output(self, channel, frequency, pin_val):
""" PWM control
Expand Down
31 changes: 30 additions & 1 deletion pymycobot/myarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ def _mesg(self, genre, *args, **kwargs):
ProtocolCode.GET_JOINT_MIN_ANGLE,
ProtocolCode.GET_JOINT_MAX_ANGLE,
ProtocolCode.GET_FRESH_MODE,
ProtocolCode.GET_GRIPPER_MODE
ProtocolCode.GET_GRIPPER_MODE,
ProtocolCode.SET_SSID_PWD
]:
return self._process_single(res)
elif genre in [ProtocolCode.GET_ANGLES]:
Expand Down Expand Up @@ -222,3 +223,31 @@ def set_solution_angles(self, angle, speed):
def get_solution_angles(self):
"""Get zero space deflection angle value"""
return self._mesg(ProtocolCode.GET_SOLUTION_ANGLES, has_reply=True)

def release_all_servos(self, data):
"""Relax all joints
Args:
data: 1 - Undamping (The default is damping)
"""
return self._mesg(ProtocolCode.RELEASE_ALL_SERVOS, data)

def get_transpoendr_mode(self):
"""Obtain the configuration information of serial transmission mode
Return:
mode: 0 - 1 - 2
"""
return self._mesg(ProtocolCode.SET_SSID_PWD, has_reply=True)

def set_transpoendr_mode(self, mode):
"""Set serial port transmission mode
Args:
mode:
0 - Turn off transparent transmission.\n
1 - Turn on transparent transmission. verify all data.\n
2 - Turn on transparent transmission, only verify the configuration information of communication forwarding mode (default is 0)
"""
return self._mesg(ProtocolCode.GET_SSID_PWD, mode)

2 changes: 1 addition & 1 deletion pymycobot/mybuddy.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def _mesg(self, genre, *args, **kwargs):
return self._int2coord(res[0]) if res else None
else:
return self._int2angle(res[0]) if res else None
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]:
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 = []
for idx in range(3):
Expand Down

0 comments on commit df4dd44

Please sign in to comment.