ezgo 0.0.17__py3-none-any.whl → 0.0.18__py3-none-any.whl
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.
- ezgo/go2.py +13 -5
- {ezgo-0.0.17.dist-info → ezgo-0.0.18.dist-info}/METADATA +11 -1
- {ezgo-0.0.17.dist-info → ezgo-0.0.18.dist-info}/RECORD +6 -6
- {ezgo-0.0.17.dist-info → ezgo-0.0.18.dist-info}/LICENSE +0 -0
- {ezgo-0.0.17.dist-info → ezgo-0.0.18.dist-info}/WHEEL +0 -0
- {ezgo-0.0.17.dist-info → ezgo-0.0.18.dist-info}/top_level.txt +0 -0
ezgo/go2.py
CHANGED
|
@@ -293,11 +293,6 @@ class Go2:
|
|
|
293
293
|
vy = max(-1.0, min(1.0, vy)) # 左右速度限制在-1到1之间
|
|
294
294
|
vyaw = max(-2.0, min(2.0, vyaw)) # 转动速度限制在-2到2之间
|
|
295
295
|
|
|
296
|
-
# 如果设置了步态模式,在移动前保持该模式
|
|
297
|
-
with self._gait_mode_lock:
|
|
298
|
-
if self._gait_mode is not None:
|
|
299
|
-
self._maintain_gait_mode()
|
|
300
|
-
|
|
301
296
|
def move_thread():
|
|
302
297
|
ret = self.sport_client.Move(vx, vy, vyaw)
|
|
303
298
|
success = ret == 0
|
|
@@ -327,6 +322,14 @@ class Go2:
|
|
|
327
322
|
|
|
328
323
|
try:
|
|
329
324
|
while time.time() - start_time < duration:
|
|
325
|
+
# 如果设置了步态模式,先保持该模式
|
|
326
|
+
with self._gait_mode_lock:
|
|
327
|
+
if self._gait_mode is not None:
|
|
328
|
+
self._maintain_gait_mode()
|
|
329
|
+
|
|
330
|
+
# 短暂延迟,让步态模式生效
|
|
331
|
+
time.sleep(0.02)
|
|
332
|
+
|
|
330
333
|
if not self.Move(vx, vy, vyaw):
|
|
331
334
|
return False
|
|
332
335
|
time.sleep(0.1) # 每100ms调用一次
|
|
@@ -395,6 +398,10 @@ class Go2:
|
|
|
395
398
|
with self._gait_mode_lock:
|
|
396
399
|
if self._gait_mode is not None:
|
|
397
400
|
self._maintain_gait_mode()
|
|
401
|
+
|
|
402
|
+
# 短暂延迟,让步态模式生效
|
|
403
|
+
time.sleep(0.02)
|
|
404
|
+
|
|
398
405
|
try:
|
|
399
406
|
ret = self.sport_client.Move(vx, vy, vyaw)
|
|
400
407
|
success = ret == 0
|
|
@@ -737,6 +744,7 @@ class Go2:
|
|
|
737
744
|
"""保持当前的步态模式(内部函数)"""
|
|
738
745
|
if self._gait_mode == 'trot':
|
|
739
746
|
try:
|
|
747
|
+
# 使用_call确保同步执行
|
|
740
748
|
self.sport_client.TrotRun()
|
|
741
749
|
except:
|
|
742
750
|
pass
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ezgo
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.18
|
|
4
4
|
Summary: 宇树Go2机器狗Python控制库
|
|
5
5
|
Author-email: ezgo <noreply@example.com>
|
|
6
6
|
License: MIT
|
|
@@ -437,6 +437,16 @@ pip install opencv-python numpy Pillow netifaces
|
|
|
437
437
|
|
|
438
438
|
## 更新日志
|
|
439
439
|
|
|
440
|
+
### v0.0.18 (2026-02-04)
|
|
441
|
+
**修复**:
|
|
442
|
+
- 🐛 修复步态模式保持机制,确保在每次 Move 调用前都正确保持步态
|
|
443
|
+
- 🐛 在 MoveForDuration 和 StartMove 循环中添加步态模式保持逻辑
|
|
444
|
+
- 🐛 添加短暂延迟让步态模式生效后再执行 Move 指令
|
|
445
|
+
|
|
446
|
+
**改进**:
|
|
447
|
+
- 🔧 优化步态保持时序,确保步态模式在移动前完全生效
|
|
448
|
+
- 🔧 移除 Move 函数内部不必要的步态保持调用,避免重复
|
|
449
|
+
|
|
440
450
|
### v0.0.17 (2026-02-04)
|
|
441
451
|
**新增功能**:
|
|
442
452
|
- ✨ 常规运动模式(`TrotRun`、`StaticWalk`、`EconomicGait`)现在支持持续保持
|
|
@@ -2,12 +2,12 @@ ezgo/__init__.py,sha256=XdJGNtFRNZwouVByMsopJ7APB23zkdAa7v5NvLrcpLw,2268
|
|
|
2
2
|
ezgo/camera.py,sha256=Vsr44vFtaop4LE0DlWyOHyvxF-jHnVO8iMPUwp5mbsE,2538
|
|
3
3
|
ezgo/ezcamera.py,sha256=6-3y-1X_L60QsWdsd5-caLoj7Quy9rpyHdp3Tq3JFbU,6536
|
|
4
4
|
ezgo/eztk.py,sha256=MHWkkZYIL1AFjUXFu2Qq8U9idJV_E1VxFUBe82dvbyA,10463
|
|
5
|
-
ezgo/go2.py,sha256=
|
|
5
|
+
ezgo/go2.py,sha256=Ccx4WKFre7kjtADTUDz8ky1YRuOkSRjutBGxz7fOPHE,33770
|
|
6
6
|
ezgo/go2_camera.py,sha256=nawUSLyvqTNiVRQ2sM-UdoJzqwZcySltLbCfUb0G9Qc,8614
|
|
7
7
|
ezgo/go2_vui.py,sha256=52I4Y8uqGkW9muDEnDzQ236HqVVTIgNIN_2gW5RTC48,10161
|
|
8
8
|
ezgo/ui.py,sha256=jUik6maaoemI2vsBM92OLZfJfskg54W7hwMls_gxppg,2777
|
|
9
|
-
ezgo-0.0.
|
|
10
|
-
ezgo-0.0.
|
|
11
|
-
ezgo-0.0.
|
|
12
|
-
ezgo-0.0.
|
|
13
|
-
ezgo-0.0.
|
|
9
|
+
ezgo-0.0.18.dist-info/LICENSE,sha256=Zk4eZBT3KaBhqM3LB_xN7QquwnoWsEHAoA6eLdE6W5M,1060
|
|
10
|
+
ezgo-0.0.18.dist-info/METADATA,sha256=DnPe457ryYE6uMjnfqvUWW8TWCuBRZa3RTfJI198JY0,20360
|
|
11
|
+
ezgo-0.0.18.dist-info/WHEEL,sha256=WnJ8fYhv8N4SYVK2lLYNI6N0kVATA7b0piVUNvqIIJE,91
|
|
12
|
+
ezgo-0.0.18.dist-info/top_level.txt,sha256=BdCFEVD5V_4FxUtvH0BVlZKgxYnp7EKNsYs5OyFxj-g,5
|
|
13
|
+
ezgo-0.0.18.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|