Skip to content

Commit 557f03a

Browse files
committed
fix bug
1 parent 0e5b535 commit 557f03a

File tree

6 files changed

+26
-19
lines changed

6 files changed

+26
-19
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.2.7 (2023-11-7)
4+
5+
- release v3.2.7
6+
- fix bug
7+
38
## v3.2.5 (2023-11-3)
49

510
- release v3.2.6

docs/myAGV_en.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
- [get\_firmware\_version](#get_firmware_version)
99
- [get\_motors\_current](#get_motors_current)
1010
- [get\_battery\_info](#get_battery_info)
11-
- [move\_control(direction\_1, direction\_2, direction\_3)](#move_controldirection_1-direction_2-direction_3)
1211
- [go\_ahead(go\_speed)](#go_aheadgo_speed)
1312
- [retreat(back\_speed)](#retreatback_speed)
1413
- [pan\_left(pan\_left\_speed)](#pan_leftpan_left_speed)
@@ -58,7 +57,7 @@ Read battery information
5857
`battery_1_voltage` : Battery 1 voltage in volts.
5958
`battery_2_voltage` : Battery 2 voltage in volts.
6059

61-
## move_control(direction_1, direction_2, direction_3)
60+
<!-- ## move_control(direction_1, direction_2, direction_3)
6261
6362
Control the car to rotate forward, backward, left, right and forward/counterclockwise.
6463
@@ -68,7 +67,7 @@ Control the car to rotate forward, backward, left, right and forward/countercloc
6867
6968
- **direction_2** – (int) control left and right movement: 0 ~ 127 is right, 129 ~ 255 is left, 128 is stop.
7069
71-
- **direction_3** – (int) control rotation: 0 ~ 127 is clockwise, 129 ~ 255 is counterclockwise, 128 is stop.
70+
- **direction_3** – (int) control rotation: 0 ~ 127 is clockwise, 129 ~ 255 is counterclockwise, 128 is stop. -->
7271

7372
## go_ahead(go_speed)
7473

docs/myAGV_zh.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
- [get\_firmware\_version](#get_firmware_version)
99
- [get\_motors\_current](#get_motors_current)
1010
- [get\_battery\_info](#get_battery_info)
11-
- [move\_control(direction\_1, direction\_2, direction\_3)](#move_controldirection_1-direction_2-direction_3)
1211
- [go\_ahead(go\_speed)](#go_aheadgo_speed)
1312
- [retreat(back\_speed)](#retreatback_speed)
1413
- [pan\_left(pan\_left\_speed)](#pan_leftpan_left_speed)
@@ -58,7 +57,7 @@
5857
`battery_1_voltage` : 电池1电压.
5958
`battery_2_voltage` : 电池2电压.
6059

61-
## move_control(direction_1, direction_2, direction_3)
60+
<!-- ## move_control(direction_1, direction_2, direction_3)
6261
6362
运动控制接口,控制小车前进、后退、平移、旋转.
6463
@@ -68,7 +67,7 @@
6867
6968
- **direction_2** – (int) 控制左右平移: 0 ~ 127 表示向右平移, 129 ~ 255 表示向左平移, 128 表示停止.
7069
71-
- **direction_3** – (int) 控制旋转: 0 ~ 127 表示顺时针旋转, 129 ~ 255 表示逆时针旋转, 128 表示停止.
70+
- **direction_3** – (int) 控制旋转: 0 ~ 127 表示顺时针旋转, 129 ~ 255 表示逆时针旋转, 128 表示停止. -->
7271

7372
## go_ahead(go_speed)
7473

pymycobot/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
from pymycobot.mybuddyemoticon import MyBuddyEmoticon
5353
__all__.append("MyBuddyEmoticon")
5454

55-
__version__ = "3.2.6"
55+
__version__ = "3.2.7"
5656
__author__ = "Elephantrobotics"
5757
__email__ = "weiquan.xu@elephantrobotics.com"
5858
__git_url__ = "https://github.com/elephantrobotics/pymycobot"

pymycobot/generate.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ def set_gripper_state(self, flag, speed, _type=None):
728728
return self._mesg(ProtocolCode.SET_GRIPPER_STATE, flag, speed, _type)
729729

730730

731-
def set_gripper_value(self, gripper_value, speed, gripper_type):
731+
def set_gripper_value(self, gripper_value, speed, gripper_type=None):
732732
"""Set gripper value
733733
734734
Args:
@@ -738,8 +738,12 @@ def set_gripper_value(self, gripper_value, speed, gripper_type):
738738
1 - Adaptive gripper\n
739739
3 - Parallel gripper, this parameter can be omitted, default to adaptive gripper
740740
"""
741-
self.calibration_parameters(class_name = self.__class__.__name__, gripper_value=gripper_value, speed=speed, gripper_type=gripper_type)
742-
return self._mesg(ProtocolCode.SET_GRIPPER_VALUE, gripper_value, speed, gripper_type)
741+
if gripper_type is not None:
742+
self.calibration_parameters(class_name = self.__class__.__name__, gripper_value=gripper_value, speed=speed, gripper_type=gripper_type)
743+
return self._mesg(ProtocolCode.SET_GRIPPER_VALUE, gripper_value, speed, gripper_type)
744+
else:
745+
return self._mesg(ProtocolCode.SET_GRIPPER_VALUE, gripper_value, speed)
746+
743747

744748
def set_gripper_calibration(self):
745749
"""Set the current position to zero, set current position value is `2048`."""

pymycobot/myagv.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -191,16 +191,16 @@ def get_battery_info(self):
191191
"""
192192
return self._mesg(ProtocolCode.GET_BATTERY_INFO.value, has_reply = True)
193193

194-
def move_control(self, direction_1, direction_2, direction_3):
195-
"""Control the car to rotate forward, backward, left, right and forward/counterclockwise
194+
# def move_control(self, direction_1, direction_2, direction_3):
195+
# """Control the car to rotate forward, backward, left, right and forward/counterclockwise
196196

197-
Args:
198-
direction_1 (int): Control forward or backward: 0 ~ 127 is backward, 129 ~ 255 is forward, 128 is stop.
199-
direction_2 (int): control left and right movement: 0 ~ 127 is right, 129 ~ 255 is left, 128 is stop.
200-
direction_3 (int): control rotation: 0 ~ 127 is clockwise, 129 ~ 255 is counterclockwise, 128 is stop.
201-
"""
202-
calibration_parameters(class_name = self.__class__.__name__, direction_1=direction_1, direction_2=direction_2,direction_3=direction_3)
203-
return self._mesg(direction_1, direction_2, direction_3)
197+
# Args:
198+
# direction_1 (int): Control forward or backward: 0 ~ 127 is backward, 129 ~ 255 is forward, 128 is stop.
199+
# direction_2 (int): control left and right movement: 0 ~ 127 is right, 129 ~ 255 is left, 128 is stop.
200+
# direction_3 (int): control rotation: 0 ~ 127 is clockwise, 129 ~ 255 is counterclockwise, 128 is stop.
201+
# """
202+
# calibration_parameters(class_name = self.__class__.__name__, direction_1=direction_1, direction_2=direction_2,direction_3=direction_3)
203+
# return self._mesg(direction_1, direction_2, direction_3)
204204

205205
def go_ahead(self, go_speed, timeout=5):
206206
"""Control the car to move forward. Send control commands every 100ms. with a default motion time of 5 seconds.

0 commit comments

Comments
 (0)