Skip to content

Commit c1a3037

Browse files
committed
feat: port update
* set_free_mode -> release_all_servos * add new port: - is_controller_connected - set_servo_data - get_servo_data - set_servo_calibration
1 parent c7b8be4 commit c1a3037

File tree

5 files changed

+109
-64
lines changed

5 files changed

+109
-64
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ dist/
33
pymycobot.egg-info/
44

55
log
6-
.vscode/
76
pymycobot/__pycache__/
87
tests/__pycache__/
98

@@ -12,3 +11,6 @@ record.txt
1211
test_test.py
1312

1413
.DS_Store
14+
15+
.vscode/.ropeproject/config.py
16+
.vscode/.ropeproject/objectdb

.vscode/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"cSpell.words": [
3+
"Cobot",
4+
"mesg",
5+
"mycobot",
6+
"pymycobot",
7+
"struct",
8+
"zhang"
9+
]
10+
}

pymycobot/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
__all__ = ["mycobot", "genre"]
44

5-
__version__ = "2.3.7"
5+
__version__ = "2.4.0"
66
__author__ = "Zachary zhang"
77
__email__ = "[email protected]"
88
__git_url__ = "https://github.com/elephantrobotics/pymycobot"
9+
10+
PI_PORT = "/dev/ttyAMA0"
11+
PI_BAUD = 1000000

pymycobot/common.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,18 @@ class Command:
66
HEADER = 0xFE
77
FOOTER = 0xFA
88

9-
# Overall status
9+
# System status
1010
VERSION = 0x00
11+
12+
# Overall status
1113
POWER_ON = 0x10
1214
POWER_OFF = 0x11
1315
IS_POWER_ON = 0x12
14-
SET_FREE_MODE = 0x13
16+
RELEASE_ALL_SERVOS = 0x13
17+
IS_CONTROLLER_CONNECTED = 0x14
18+
READ_NEXT_ERROR = 0x15
19+
SET_FREE_MODE = 0x1A
20+
IS_FREE_MODE = 0x1B
1521

1622
# MDI MODE AND OPERATION
1723
GET_ANGLES = 0x20
@@ -38,12 +44,17 @@ class Command:
3844
# RUNNING STATUS AND SETTINGS
3945
GET_SPEED = 0x40
4046
SET_SPEED = 0x41
47+
GET_FEED_OVERRIDE = 0x42
48+
GET_ACCELERATION = 0x44
4149
GET_JOINT_MIN_ANGLE = 0x4A
4250
GET_JOINT_MAX_ANGLE = 0x4B
4351

4452
# SERVO CONTROL
4553
IS_SERVO_ENABLE = 0x50
4654
IS_ALL_SERVO_ENABLE = 0x51
55+
SET_SERVO_DATA = 0x52
56+
GET_SERVO_DATA = 0x53
57+
SET_SERVO_CALIBRATION = 0x54
4758
RELEASE_SERVO = 0x56
4859
FOCUS_SERVO = 0x57
4960

@@ -60,7 +71,7 @@ class Command:
6071
IS_GRIPPER_MOVING = 0x69
6172
SET_COLOR = 0x6A
6273

63-
# Baisc
74+
# Basic
6475
SET_BASIC_OUTPUT = 0xA0
6576

6677

0 commit comments

Comments
 (0)