dobotkit 0.1.1__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dobotkit-0.1.1 → dobotkit-0.2.2}/CHANGELOG.md +270 -187
- {dobotkit-0.1.1 → dobotkit-0.2.2}/PKG-INFO +2 -2
- dobotkit-0.2.2/src/dobotkit/_version.py +1 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/src/dobotkit/arm/commands/_base.py +29 -19
- dobotkit-0.2.2/src/dobotkit/arm/commands/connection.py +60 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/src/dobotkit/arm/commands/effector_io.py +8 -2
- {dobotkit-0.1.1 → dobotkit-0.2.2}/src/dobotkit/arm/groups.py +16 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/src/dobotkit/arm/magicianlite.py +329 -203
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/arm/test_arm_groups.py +25 -2
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/arm/test_commands_effector_io.py +4 -2
- dobotkit-0.2.2/tests/arm/test_magicianlite.py +217 -0
- dobotkit-0.1.1/src/dobotkit/_version.py +0 -1
- dobotkit-0.1.1/src/dobotkit/arm/commands/connection.py +0 -32
- dobotkit-0.1.1/tests/arm/test_magicianlite.py +0 -60
- {dobotkit-0.1.1 → dobotkit-0.2.2}/.gitignore +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/.superpowers/sdd/.gitignore +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/.superpowers/sdd/motion-wait-fix-report.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/.superpowers/sdd/progress.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/.superpowers/sdd/review-c203329..376ec44.diff +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/.superpowers/sdd/review-c203329..674ed9a.diff +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/.superpowers/sdd/review-fixes-report.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/.superpowers/sdd/task-1-brief.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/.superpowers/sdd/task-1-report.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/.superpowers/sdd/task-2-brief.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/.superpowers/sdd/task-2-report.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/.superpowers/sdd/task-3-brief.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/.superpowers/sdd/task-4-brief.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/.superpowers/sdd/task-5-brief.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/.superpowers/sdd/task-6-brief.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/.superpowers/sdd/task-7-brief.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/.superpowers/sdd/task-8-brief.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/CONTEXT.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/LICENSE +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/README.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/docs/GO_SDK_/354/273/244/353/262/204/353/246/254/354/247/200_/353/246/254/355/217/254/355/212/270.docx" +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/docs/GO_/352/262/200/354/246/235/355/225/204/354/232/224/355/225/255/353/252/251_/353/246/254/355/217/254/355/212/270.docx" +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/docs/VERIFICATION_NEEDED_ko.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/docs/api/arm.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/docs/api/go.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/docs/cheatsheet_go.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/docs/quickstart-ko.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/docs/superpowers/plans/2026-06-30-dobotkit-implementation.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/docs/superpowers/plans/2026-07-16-magicianlite-dobotlink-rewrite.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/docs/superpowers/specs/2026-06-30-dobotkit-design.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/docs/superpowers/specs/2026-07-16-magicbox-absent-graceful-handling-design.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/docs/superpowers/specs/2026-07-16-magicianlite-dobotlink-rewrite-design.md +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/examples/arm_magicianlite.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/examples/go_discover.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/examples/go_magicbox_sensor.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/examples/go_teleop.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/pyproject.toml +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/src/dobotkit/__init__.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/src/dobotkit/arm/__init__.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/src/dobotkit/arm/commands/__init__.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/src/dobotkit/arm/commands/motion.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/src/dobotkit/arm/commands/sensors.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/src/dobotkit/enums.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/src/dobotkit/exceptions.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/src/dobotkit/go/__init__.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/src/dobotkit/go/geometry.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/src/dobotkit/go/groups.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/src/dobotkit/go/magiciango.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/src/dobotkit/go/navigation.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/src/dobotkit/link.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/src/dobotkit/py.typed +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/__init__.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/arm/__init__.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/arm/test_commands_connection.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/arm/test_commands_motion.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/arm/test_commands_sensors.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/conftest.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/go/__init__.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/go/conftest.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/go/test_client.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/go/test_geometry.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/go/test_groups.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/go/test_magiciango.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/go/test_magiciango_extended.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/go/test_navigation.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/test_enums.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/test_exceptions.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/test_integration.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/test_smoke.py +0 -0
- {dobotkit-0.1.1 → dobotkit-0.2.2}/tests/test_subpackage_api.py +0 -0
|
@@ -1,187 +1,270 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project are documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
## [0.
|
|
9
|
-
|
|
10
|
-
###
|
|
11
|
-
|
|
12
|
-
- **`
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
###
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
`
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
`
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
`
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
(`
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
`
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
`
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
`
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
`
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
-
|
|
137
|
-
|
|
138
|
-
`
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
- **
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
`
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
- **
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.2.2] - 2026-11-05
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **`home()` 이 홈 설정을 매번 덮어쓰던 문제.** x/y/z/r 기본값이 `200, 0, 0, 0` 이라
|
|
13
|
+
`home()` 을 부를 때마다 `SetHOMEParams` 로 홈을 그 좌표로 다시 썼다. 그래서 선생님이
|
|
14
|
+
코디니에서 초기 위치를 따로 지정해도 **수업 중 첫 `home()` 한 번에 풀렸다**
|
|
15
|
+
(현장 메모 2026-11-01: "초기 위치를 특정 좌표로 재지정하려 했으나 설정이 유지되지 않고 풀림.
|
|
16
|
+
두봇 키트가 시작 시 공장 초기 위치를 강제 호출하는 것으로 추정").
|
|
17
|
+
|
|
18
|
+
- 좌표를 **하나도 주지 않으면** 홈 설정을 건드리지 않고 원점복귀만 한다 →
|
|
19
|
+
컨트롤러에 저장된(선생님이 지정한) 홈이 그대로 유지된다.
|
|
20
|
+
- 좌표를 주면 그때만 홈을 바꾼다. 값은 컨트롤러에 남아 다음 `home()` 부터 적용된다.
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- **`MagicianLite.set_home(x=None, y=None, z=None, r=None)`** — 원점복귀가 찾아갈 홈
|
|
25
|
+
좌표를 바꾼다. 주지 않은 축은 **지금 자리 값**으로 채운다(0 으로 덮이지 않게).
|
|
26
|
+
공장 기본값으로 되돌리려면 `set_home(200, 0, 0, 0)`.
|
|
27
|
+
|
|
28
|
+
## [0.2.1] - 2026-11-01
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- **큐에 넣은 동작이 잘려 나가는 문제 — "집게가 작동 안 함" 의 정체.**
|
|
33
|
+
`move_to` / `suck` / `grip` 은 모두 명령을 모션 큐에 넣고 **즉시 반환**한다
|
|
34
|
+
(`home` 만 예외로 기다렸다). 그래서
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
팔.grip(True)
|
|
38
|
+
팔.grip(False)
|
|
39
|
+
팔.pump_off()
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
같은 코드는 세 명령이 큐에 들어간 채 스크립트가 끝나고, 뒷정리(`__exit__` →
|
|
43
|
+
`queue_stop()`, `disconnect()` → `pump_off(queued=False)`)가 아직 실행되지 않은
|
|
44
|
+
동작을 **잘라 먹었다**. 집게가 아예 움직이지 않는 것처럼 보였다.
|
|
45
|
+
0.2.0 의 `pump_off()` 문서가 "큐에 올라가 pending suck/grip 뒤에 실행된다"고
|
|
46
|
+
적어 둔 것과 실제 동작이 어긋나 있었다.
|
|
47
|
+
|
|
48
|
+
- `MagicianLite.pump_off(*, wait=True)` — 기본값이 **큐가 빌 때까지 기다린 뒤**
|
|
49
|
+
펌프를 끈다. 수업 코드는 모두 `pump_off()` 로 끝나므로, 학생 코드를 한 글자도
|
|
50
|
+
고치지 않고 이 부류의 버그가 사라진다. 비상정지처럼 즉시 멈춰야 하는 경로는
|
|
51
|
+
`pump_off(wait=False)`.
|
|
52
|
+
- `MagicianLite.wait(timeout=30.0)` / `ArmCommands.wait_until_idle()` — 큐에 넣은
|
|
53
|
+
동작이 실제로 실행될 때까지 기다린다(타임아웃이 있어 영원히 매달리지 않는다).
|
|
54
|
+
- `suck(on, *, wait=False)` · `grip(on, *, wait=False)` — 필요할 때 명시적으로 기다릴 수 있다.
|
|
55
|
+
- `__exit__` 은 **정상 종료일 때만** 큐를 비운 뒤 멈춘다. 예외로 빠져나갈 때는
|
|
56
|
+
기다리지 않고 즉시 멈춘다(그게 안전하다).
|
|
57
|
+
|
|
58
|
+
- **`port="auto"` 가 아무 포트나 집던 문제.** `search()` 결과의 `ports[0]` 을 그냥
|
|
59
|
+
썼다. 교실 PC 에는 팔 외에 Magic Box · Magician Go 같은 장치가 함께 꽂혀 있어서
|
|
60
|
+
첫 번째가 팔이 아니면 엉뚱한 포트로 연결을 시도했다. 이제 장치 이름으로
|
|
61
|
+
Magician(Lite) 을 먼저 고르고, 가릴 수 없을 때만 예전처럼 첫 번째를 쓴다.
|
|
62
|
+
|
|
63
|
+
### Internal
|
|
64
|
+
|
|
65
|
+
- `_Base._call()` 이 응답의 `queuedCmdIndex` 를 한곳에서 추적한다(`_last_queued`).
|
|
66
|
+
`wait_until_idle()` 이 `GetQueuedCmdCurrentIndex` 와 비교하는 기준값이다.
|
|
67
|
+
|
|
68
|
+
## [0.2.0] - 2026-07-24
|
|
69
|
+
|
|
70
|
+
### Added
|
|
71
|
+
|
|
72
|
+
- **`pump_off()` on the arm** — `MagicianLite.pump_off()` (and
|
|
73
|
+
`effector.pump_off()`). Cuts power to the shared air pump (`enable=False` on
|
|
74
|
+
both the suction cup and the gripper) so it stops running and goes quiet.
|
|
75
|
+
`suck(False)` / `grip(False)` only flip the valve to *release* and leave the
|
|
76
|
+
pump running (so a re-grab is instant); `pump_off()` powers it down. It runs
|
|
77
|
+
on the motion queue, so it sequences after any pending `suck`/`grip`.
|
|
78
|
+
`disconnect()` / `with`-block teardown now calls it automatically
|
|
79
|
+
(immediately, bypassing the queue), so the pump never keeps running after a
|
|
80
|
+
program ends.
|
|
81
|
+
|
|
82
|
+
### Changed (BREAKING)
|
|
83
|
+
|
|
84
|
+
- **The arm is rewritten on DobotLink; the serial stack is gone.**
|
|
85
|
+
`dobotkit.Magician` (`pyserial`-based) is replaced by
|
|
86
|
+
`dobotkit.arm.magicianlite.MagicianLite` (exported as `dobotkit.MagicianLite`),
|
|
87
|
+
which speaks the arm's `Magician.*` RPC surface through the same DobotLink
|
|
88
|
+
JSON-RPC bridge (`ws://localhost:9090`) already used by the GO. **DobotLink.exe
|
|
89
|
+
is now required to drive the arm** — there is no more direct serial
|
|
90
|
+
connection. `pyserial` is dropped from `dependencies`; `websockets` is now
|
|
91
|
+
the library's only runtime dependency.
|
|
92
|
+
|
|
93
|
+
The old serial-only surface is gone entirely: `arm.lowlevel` / `LowLevelArm`,
|
|
94
|
+
`arm/protocol.py`, `arm/ids.py`, `arm/structures/`, `arm/transport.py`,
|
|
95
|
+
`arm/queue.py`, and `arm/alarms.py` no longer exist, and neither does the
|
|
96
|
+
`check_alarms=` motion-call argument. The now-dead serial test
|
|
97
|
+
infrastructure (`tests/conftest.py`'s `oracle` fixture/`_load_oracle` helper
|
|
98
|
+
and the `FakeSerial` double, plus the tests that exercised them) is removed.
|
|
99
|
+
|
|
100
|
+
`MagicianLite`'s high-level surface keeps the same shape as before:
|
|
101
|
+
`connect`/`disconnect`, context-manager teardown, `home`, `move_to`,
|
|
102
|
+
`move_relative`, `pick_and_place`, `set_speed`, `get_pose`, `suck`, `grip`,
|
|
103
|
+
and the `effector` / `sensors` / `io` device groups (see `groups.py`).
|
|
104
|
+
|
|
105
|
+
- **MagicBox-routed peripheral calls degrade gracefully when the MagicBox is
|
|
106
|
+
absent.** `sensors.adc/di/color/infrared/distance/temp/light/rgb` and
|
|
107
|
+
`io.get_di`/`io.get_adc` catch a missing MagicBox (or its attached sensor)
|
|
108
|
+
answering with `DobotTimeoutError` / `DobotProtocolError`, emit a
|
|
109
|
+
`RuntimeWarning`, and return `None` instead of crashing teaching code.
|
|
110
|
+
Arm-native calls (motion, `effector.suck`/`grip`/`servo`,
|
|
111
|
+
`io.set_do`/`set_pwm`/`set_multiplexing`) and a genuine
|
|
112
|
+
`DobotConnectionError` are **not** swallowed.
|
|
113
|
+
|
|
114
|
+
- **The Magician GO stack is trimmed to a clean core and now reads its MagicBox
|
|
115
|
+
peripherals.** `MagicianGO` keeps continuous drive (`move`/`forward`/
|
|
116
|
+
`backward`/`strafe`/`spin`/`stop`/`drive_for`/`emergency_stop`),
|
|
117
|
+
`clearance_ok`, native sensors (`ultrasonic`/`ultrasonic_raw`/`odometer`/
|
|
118
|
+
`set_odometer`/`battery`/`imu_angle`), `rgb`/`buzzer`, alarms/state
|
|
119
|
+
(`get_alarm_info`/`clean_alarm_info`/`stall_protection`/`off_ground`), and
|
|
120
|
+
`magic_box_mode`/`magic_box_num`. **New:** `go.sensors`
|
|
121
|
+
(`GoSensorGroup`) and `go.io` (`GoIOGroup`) read the GO's MagicBox on the
|
|
122
|
+
DobotLink `MagicBox.*` namespace over the *same* `MagicianGO` connection —
|
|
123
|
+
ADC/DI/DO/PWM address an **EIO pin (1..26)**, color/infrared/Seeed address a
|
|
124
|
+
**Grove connector (1..6)** — and every `go.sensors` read degrades to `None` +
|
|
125
|
+
a `RuntimeWarning` when the MagicBox/sensor is absent (hardware-verified
|
|
126
|
+
2026-07-16: the teaching-kit potentiometer on Grove connector 4 reads on EIO
|
|
127
|
+
pin 22 via `go.sensors.adc(22)`).
|
|
128
|
+
|
|
129
|
+
Removed (BREAKING): all firmware closed-loop / queued motion
|
|
130
|
+
(`rotate`/`move_dist`/`arc_rad`/`arc_cent`/`coord_closed_loop`/
|
|
131
|
+
`increment_closed_loop` and their `unsafe_` variants, `unsafe_move_pos`,
|
|
132
|
+
`move_speed_time`, `set_origin_point`, `move_direct`, `set_running_mode`);
|
|
133
|
+
line-tracing (`auto_trace`/`trace_speed`/`trace_pid`/`trace_angle`/
|
|
134
|
+
`line_error`/`firmware_trace_angle`/`set_trace_line_info`); cameras
|
|
135
|
+
(`car_camera_*`/`arm_camera_*`/`camera_calibration_data`); firmware
|
|
136
|
+
command-queue internals; MagicBox stop-point RPCs; device-management RPCs
|
|
137
|
+
(`product_name`, fw versions, `device_id`, name/SN, `device_time`,
|
|
138
|
+
`device_reboot`, `heartbeat`); `set_running_state`; `set_light_prompt`;
|
|
139
|
+
`imu_speed`; `get_move_speed`; `get_running_mode`. The `WaypointNav`
|
|
140
|
+
navigation class is removed — `PreciseMover` (continuous move + odometer/IMU
|
|
141
|
+
feedback) remains for precise motion. `MagicianGO.__exit__` teardown is
|
|
142
|
+
simplified to `emergency_stop` + a confirming `stop` (+ socket close when it
|
|
143
|
+
owns the client). Examples `go_line_trace.py`/`go_waypoint_nav.py` are
|
|
144
|
+
removed; `go_magicbox_sensor.py` is added.
|
|
145
|
+
|
|
146
|
+
### Fixed
|
|
147
|
+
|
|
148
|
+
- **The suction cup and gripper now actually actuate.** The DobotLink parameter
|
|
149
|
+
for pump power is `enable` (bool), not the Dobot SDK's `enableCtrl` — DobotLink
|
|
150
|
+
silently ignores the unknown key (the RPC returns success but the pump never
|
|
151
|
+
powers), so `suck`/`grip` did nothing on hardware. `set_suction_cup` /
|
|
152
|
+
`set_gripper` now send `enable`, so `arm.suck(True)` / `arm.grip(True)` grip as
|
|
153
|
+
expected (the `on` state key was already correct). Verified live via the
|
|
154
|
+
`GetEndEffectorSuctionCup` / `GetEndEffectorGripper` readback
|
|
155
|
+
(`enable=True, on=True → {isEnabled: True, isOn: True}`). The FakeClient unit
|
|
156
|
+
tests only asserted the *sent* params, so they could not catch a key that
|
|
157
|
+
DobotLink does not accept.
|
|
158
|
+
- **`home()` always queues `SetHOMEParams`/`SetHOMECmd`.** Previously
|
|
159
|
+
`queued=wait` meant `wait=False` sent them unqueued, which could desync the
|
|
160
|
+
on-device queue index; `wait` now only controls whether `home()` blocks
|
|
161
|
+
until the queue catches up, matching `move_to`'s always-queued behavior.
|
|
162
|
+
- **Motion blocks on DobotLink's `isWaitForFinish`, not client-side polling.**
|
|
163
|
+
`move_to` / `move_relative` / `home` / `pick_and_place` with `wait=True` send
|
|
164
|
+
`isWaitForFinish=true` (with a generous per-call timeout) so DobotLink blocks
|
|
165
|
+
until the move physically completes — matching DobotLab. This replaced an
|
|
166
|
+
unreliable queued-command-index poll that returned before the move finished,
|
|
167
|
+
which let moves overlap and made DobotLink report `action timeout` (verified
|
|
168
|
+
on hardware). `pick_and_place` now runs its eight steps sequentially this way.
|
|
169
|
+
- **Context-manager teardown (`__exit__`) no longer lets a `disconnect()`
|
|
170
|
+
failure escape.** Both `queue_stop()` and `disconnect()` are now
|
|
171
|
+
independently best-effort during teardown, so neither can mask the `with`
|
|
172
|
+
body's original exception.
|
|
173
|
+
- **`DobotTimeoutError` messages are device-neutral.** They used to say "GO
|
|
174
|
+
power/wireless link may be down" even when raised for the arm; the shared
|
|
175
|
+
`DobotLinkClient` now says the device may be unresponsive or DobotLink lost
|
|
176
|
+
the link.
|
|
177
|
+
|
|
178
|
+
### Known limitations
|
|
179
|
+
|
|
180
|
+
- **A controller alarm silently blocks arm motion.** If the Magician Lite
|
|
181
|
+
controller has an active alarm (`GetAlarmsState` non-zero — observed as a
|
|
182
|
+
recurring `byte12` fault on the test unit), DobotLink accepts motion commands
|
|
183
|
+
(returns success) but the arm does not move; sensors / IO / effector still
|
|
184
|
+
work. The alarm is **not reliably clearable in software** (issuing
|
|
185
|
+
`ClearAllAlarmsState` was observed to *trigger* it on the test unit), so the
|
|
186
|
+
library does not call it automatically. **Power-cycle the arm to clear it.**
|
|
187
|
+
Motion is reliable once the controller is alarm-free and targets stay within
|
|
188
|
+
the workspace (a target that drives a joint near its travel limit can fault).
|
|
189
|
+
|
|
190
|
+
- **A GO left powered on for a long time drops its wireless link.**
|
|
191
|
+
`ConnectDobot` then returns a *false success* (`{firmwareName: "Dobot",
|
|
192
|
+
firmwareVersion: "", productName: ""}` — the empty version/name is the tell)
|
|
193
|
+
and every subsequent read times out. `MagicianGO.open`/`connect`'s built-in
|
|
194
|
+
battery read-back surfaces this immediately. **Power-cycle the car to
|
|
195
|
+
recover.**
|
|
196
|
+
|
|
197
|
+
## [0.1.1] - 2026-07-19
|
|
198
|
+
|
|
199
|
+
### Removed
|
|
200
|
+
|
|
201
|
+
- **`MagicianGO.running_state()` (`GetRunningState`).** The GO firmware never
|
|
202
|
+
answers this call — a reproducible ~10 s `DobotTimeoutError` on the test unit
|
|
203
|
+
— while every neighbouring read (`battery`, `ultrasonic`, `imu_angle`,
|
|
204
|
+
`odometer`, `off_ground`, `stall_protection`, `magic_box_mode`/`num`,
|
|
205
|
+
`get_alarm_info`) works. A method that only ever hangs has no place in the
|
|
206
|
+
clean core, so it was dropped (hardware-verified 2026-07-19). Use
|
|
207
|
+
`get_alarm_info()` / `stall_protection()` / `off_ground()` for GO status.
|
|
208
|
+
|
|
209
|
+
## [0.1.0] - 2026-06-30
|
|
210
|
+
|
|
211
|
+
Initial release of `dobotkit` — a complete, pure-Python control library for the
|
|
212
|
+
Dobot Magician Lite robotic arm (serial) and the Dobot Magician GO mobile robot
|
|
213
|
+
(DobotLink WebSocket). No DLLs, no native binaries: `pip install` and run on
|
|
214
|
+
Windows, macOS, or Linux.
|
|
215
|
+
|
|
216
|
+
### Added
|
|
217
|
+
|
|
218
|
+
- **Full arm SDK coverage** — all **203/203** official Dobot arm SDK functions
|
|
219
|
+
are mapped 1:1 to a `LowLevelArm` method, proven by
|
|
220
|
+
`tests/arm/test_coverage.py`. The arm speaks the Dobot serial framing
|
|
221
|
+
(`[0xAA 0xAA][len][id][ctrl][params][checksum]`) directly over `pyserial`;
|
|
222
|
+
there is no dependency on `DobotDll`, `DobotRPC`, or any native code.
|
|
223
|
+
- **High-level `Magician` API** — ergonomic arm control: `connect`/`disconnect`
|
|
224
|
+
and context-manager teardown, `home`, `move_to`, `move_relative`,
|
|
225
|
+
`pick_and_place`, `set_speed`, pose access, and `.io` / `.sensors` /
|
|
226
|
+
`.effector` / `.lowlevel` groups. Includes pydobot-compatible aliases
|
|
227
|
+
(`suck`, `grip`, `speed`, `wait`, `pose`, `get_eio`, `set_eio`, `move_to`) so
|
|
228
|
+
existing pydobot scripts port with minimal changes. Optional alarm guards on
|
|
229
|
+
motion raise `DobotAlarmError`.
|
|
230
|
+
- **Full Magician GO support** — the complete DobotLink `MagicianGO.*` surface
|
|
231
|
+
via a JSON-RPC `DobotLinkClient` over `websockets`, wrapped by a high-level
|
|
232
|
+
`MagicianGO` API: continuous drive (forward/backward/strafe/spin/move),
|
|
233
|
+
closed-loop commands, ultrasonic / IMU / odometer sensors, RGB LEDs, buzzer,
|
|
234
|
+
line-tracing, and camera object/tag detection.
|
|
235
|
+
- **GO sensor-feedback navigation** — `PreciseMover` and `WaypointNav` provide
|
|
236
|
+
closed-loop motion built on odometer/IMU feedback with absolute wall-clock
|
|
237
|
+
timeouts and pre-move clearance checks, as a safer alternative to the
|
|
238
|
+
hang-prone built-in closed-loop commands.
|
|
239
|
+
- **Golden-oracle struct verification** — every wire structure's packed
|
|
240
|
+
byte-layout is byte-compared against the official `DobotDllType` ctypes
|
|
241
|
+
structs (loaded offline in tests only, never at runtime), guaranteeing the
|
|
242
|
+
little-endian packed encodings match the vendor SDK exactly.
|
|
243
|
+
- **Shared foundation** — a `DobotError` exception hierarchy, an `enums` module
|
|
244
|
+
(`PTPMode`, `JOGMode`, `ContinuousPathMode`, `GPIOType`, `EndEffectorType`,
|
|
245
|
+
`ColorPort`, `LEDChannel`), full type hints, and a shipped `py.typed` marker.
|
|
246
|
+
- **Lazy device imports** — `import dobotkit` pulls in neither `pyserial` nor
|
|
247
|
+
`websockets`; each device's dependencies load only when that device class is
|
|
248
|
+
first accessed.
|
|
249
|
+
- Runnable `examples/` for both devices: arm (pick-and-place, sensors, full API
|
|
250
|
+
tour) and GO (`go_teleop`, `go_waypoint_nav`, `go_line_trace`), plus
|
|
251
|
+
`README.md` and `docs/api/` reference (`arm.md`, `go.md`).
|
|
252
|
+
|
|
253
|
+
### Known limitations / caveats
|
|
254
|
+
|
|
255
|
+
- **A few protocol command IDs remain unverified.** 14 remain tagged
|
|
256
|
+
`# unverified`: DLL-name-only calls with no public wire ID
|
|
257
|
+
(motor-mode, speed-ratio, restart-magic-box, fw-ready) and the MagicBox/Seeed
|
|
258
|
+
Grove sensor extensions. Confirm these on hardware or against MagicBox-specific
|
|
259
|
+
docs before relying on them. (Struct **byte-layouts** are independently
|
|
260
|
+
verified offline against `DobotDllType` by the golden-oracle tests — this
|
|
261
|
+
caveat applies to *command-ID values*, not to packing.)
|
|
262
|
+
- **GO built-in closed-loop commands can hang.** The device-side closed-loop
|
|
263
|
+
commands (`rotate`, `move_dist`, `arc_*`, `*_closed_loop`) may block
|
|
264
|
+
indefinitely; prefer `PreciseMover` / `WaypointNav`, which close the loop in
|
|
265
|
+
software with timeouts.
|
|
266
|
+
- **GO closed-loop turn direction (yaw sign) needs on-hardware confirmation.**
|
|
267
|
+
|
|
268
|
+
[0.2.0]: https://example.com/dobotkit/compare/v0.1.1...v0.2.0
|
|
269
|
+
[0.1.1]: https://example.com/dobotkit/compare/v0.1.0...v0.1.1
|
|
270
|
+
[0.1.0]: https://example.com/dobotkit/releases/tag/v0.1.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: dobotkit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Complete pure-Python control library for Dobot Magician Lite (arm) and Magician GO (car) over DobotLink
|
|
5
5
|
Project-URL: Homepage, https://github.com/mslopgk/dobotkit
|
|
6
6
|
Project-URL: Repository, https://github.com/mslopgk/dobotkit
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.2"
|
|
@@ -1,19 +1,29 @@
|
|
|
1
|
-
"""Shared base for the arm's DobotLink RPC command mixins."""
|
|
2
|
-
from __future__ import annotations
|
|
3
|
-
from typing import Any, Optional
|
|
4
|
-
from dobotkit.link import DobotLinkClient
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class _Base:
|
|
8
|
-
"""Connection state and the shared ``_call`` / ``_queued_index`` primitives."""
|
|
9
|
-
|
|
10
|
-
def __init__(self, client: DobotLinkClient, port_name: str) -> None:
|
|
11
|
-
self._client = client
|
|
12
|
-
self.port_name = port_name
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
"""Shared base for the arm's DobotLink RPC command mixins."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
from typing import Any, Optional
|
|
4
|
+
from dobotkit.link import DobotLinkClient
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class _Base:
|
|
8
|
+
"""Connection state and the shared ``_call`` / ``_queued_index`` primitives."""
|
|
9
|
+
|
|
10
|
+
def __init__(self, client: DobotLinkClient, port_name: str) -> None:
|
|
11
|
+
self._client = client
|
|
12
|
+
self.port_name = port_name
|
|
13
|
+
# 마지막으로 큐에 들어간 명령의 인덱스. 큐가 어디까지 실행됐는지 비교하는 기준이다
|
|
14
|
+
# (wait_until_idle). 큐에 올라간 명령은 응답에 queuedCmdIndex 를 담아 준다.
|
|
15
|
+
self._last_queued = 0
|
|
16
|
+
|
|
17
|
+
def _call(self, func: str, *, call_timeout: Optional[float] = None, **params: Any) -> Any:
|
|
18
|
+
params["portName"] = self.port_name
|
|
19
|
+
resp = self._client.call(f"Magician.{func}", call_timeout=call_timeout, **params)
|
|
20
|
+
# 큐에 올라간 명령이면 인덱스를 기억해 둔다. 한 곳에서 잡아야 빠짐이 없다.
|
|
21
|
+
if isinstance(resp, dict) and "queuedCmdIndex" in resp:
|
|
22
|
+
try:
|
|
23
|
+
self._last_queued = max(self._last_queued, int(resp["queuedCmdIndex"]))
|
|
24
|
+
except (TypeError, ValueError):
|
|
25
|
+
pass
|
|
26
|
+
return resp
|
|
27
|
+
|
|
28
|
+
def _queued_index(self, resp: Any) -> int:
|
|
29
|
+
return int(resp.get("queuedCmdIndex", 0)) if isinstance(resp, dict) else int(resp or 0)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"""Connection and on-device command-queue RPC wrappers."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
from typing import Any, List, cast
|
|
4
|
+
from dobotkit.arm.commands._base import _Base
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ConnectionMixin(_Base):
|
|
8
|
+
"""Connect/disconnect the arm and control its queued-command queue."""
|
|
9
|
+
|
|
10
|
+
# -- connection --
|
|
11
|
+
def search(self) -> List[Any]:
|
|
12
|
+
return cast(List[Any], self._client.call("Magician.SearchDobot"))
|
|
13
|
+
|
|
14
|
+
def connect(self) -> Any:
|
|
15
|
+
return self._call("ConnectDobot")
|
|
16
|
+
|
|
17
|
+
def disconnect(self) -> Any:
|
|
18
|
+
return self._call("DisconnectDobot")
|
|
19
|
+
|
|
20
|
+
# -- queue --
|
|
21
|
+
def queue_clear(self) -> Any:
|
|
22
|
+
return self._call("QueuedCmdClear")
|
|
23
|
+
|
|
24
|
+
def queue_start(self) -> Any:
|
|
25
|
+
return self._call("QueuedCmdStart")
|
|
26
|
+
|
|
27
|
+
def queue_stop(self) -> Any:
|
|
28
|
+
return self._call("QueuedCmdStop")
|
|
29
|
+
|
|
30
|
+
def current_index(self) -> int:
|
|
31
|
+
resp = self._call("GetQueuedCmdCurrentIndex")
|
|
32
|
+
return self._queued_index(resp)
|
|
33
|
+
|
|
34
|
+
def wait_until_idle(self, timeout: float = 30.0, poll: float = 0.05) -> bool:
|
|
35
|
+
"""큐에 넣은 명령이 **실제로 다 실행될 때까지** 기다린다. 다 됐으면 True.
|
|
36
|
+
|
|
37
|
+
왜 필요한가 (2026-11-01 실측)
|
|
38
|
+
-----------------------------
|
|
39
|
+
``move_to``/``grip``/``suck``/``pump_off`` 는 모두 **큐에 넣고 즉시 반환**한다
|
|
40
|
+
(``home`` 만 예외로 기다린다). 그래서 학생 코드가
|
|
41
|
+
|
|
42
|
+
arm.grip(True); arm.grip(False); arm.pump_off()
|
|
43
|
+
|
|
44
|
+
처럼 끝나면 세 명령이 큐에 들어간 채로 스크립트가 끝나 버리고, 뒷정리가
|
|
45
|
+
큐를 비우면서 **집게가 아예 움직이지 않는다**. "프로그램이 안 돈다"로 보였던 것의 정체다.
|
|
46
|
+
"""
|
|
47
|
+
import time
|
|
48
|
+
|
|
49
|
+
target = self._last_queued
|
|
50
|
+
if target <= 0:
|
|
51
|
+
return True
|
|
52
|
+
deadline = time.time() + timeout
|
|
53
|
+
while time.time() < deadline:
|
|
54
|
+
try:
|
|
55
|
+
if self.current_index() >= target:
|
|
56
|
+
return True
|
|
57
|
+
except Exception:
|
|
58
|
+
return False # 연결이 끊겼으면 더 기다릴 의미가 없다
|
|
59
|
+
time.sleep(poll)
|
|
60
|
+
return False
|