ezgo 0.0.12__py3-none-any.whl → 0.0.14__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/__init__.py +1 -1
- ezgo/go2.py +24 -15
- {ezgo-0.0.12.dist-info → ezgo-0.0.14.dist-info}/METADATA +9 -6
- {ezgo-0.0.12.dist-info → ezgo-0.0.14.dist-info}/RECORD +7 -7
- {ezgo-0.0.12.dist-info → ezgo-0.0.14.dist-info}/LICENSE +0 -0
- {ezgo-0.0.12.dist-info → ezgo-0.0.14.dist-info}/WHEEL +0 -0
- {ezgo-0.0.12.dist-info → ezgo-0.0.14.dist-info}/top_level.txt +0 -0
ezgo/__init__.py
CHANGED
ezgo/go2.py
CHANGED
|
@@ -277,9 +277,10 @@ class Go2:
|
|
|
277
277
|
|
|
278
278
|
def Move(self, vx, vy, vyaw):
|
|
279
279
|
"""移动。"""
|
|
280
|
-
# 检查状态是否允许移动 -
|
|
281
|
-
#
|
|
282
|
-
|
|
280
|
+
# 检查状态是否允许移动 - 只禁止明显不能移动的状态
|
|
281
|
+
# 禁止移动的状态:表演(1006)、坐下(1007)、前跳(1008)、扑人(1009)、空翻(2012-2014)
|
|
282
|
+
forbidden_move_states = [1006, 1007, 1008, 1009, 2012, 2013, 2014]
|
|
283
|
+
if self.error_code in forbidden_move_states:
|
|
283
284
|
print(f"当前状态不允许移动: {self.error_code} - {error_code.get(self.error_code, '未知状态')}")
|
|
284
285
|
return False
|
|
285
286
|
|
|
@@ -355,32 +356,40 @@ class Go2:
|
|
|
355
356
|
def StartMove(self, vx, vy, vyaw):
|
|
356
357
|
"""
|
|
357
358
|
开始持续移动,需要调用StopMove来停止
|
|
358
|
-
|
|
359
|
+
|
|
359
360
|
Args:
|
|
360
361
|
vx (float): 前后速度 (-1.0 到 1.0)
|
|
361
|
-
vy (float): 左右速度 (-1.0 到 1.0)
|
|
362
|
+
vy (float): 左右速度 (-1.0 到 1.0)
|
|
362
363
|
vyaw (float): 转动速度 (-2.0 到 2.0)
|
|
363
|
-
|
|
364
|
+
|
|
364
365
|
Returns:
|
|
365
366
|
bool: 是否成功开始移动
|
|
366
367
|
"""
|
|
367
368
|
print(f"开始持续移动: vx={vx}, vy={vy}, vyaw={vyaw}")
|
|
368
|
-
|
|
369
|
-
#
|
|
370
|
-
|
|
371
|
-
|
|
369
|
+
|
|
370
|
+
# 检查状态是否允许移动 - 只禁止明显不能移动的状态
|
|
371
|
+
forbidden_move_states = [1006, 1007, 1008, 1009, 2012, 2013, 2014]
|
|
372
|
+
if self.error_code in forbidden_move_states:
|
|
373
|
+
print(f"无法开始持续移动:当前状态不允许移动 - {self.error_code} - {error_code.get(self.error_code, '未知状态')}")
|
|
372
374
|
return False
|
|
373
|
-
|
|
375
|
+
|
|
374
376
|
self._moving = True
|
|
375
377
|
self._move_params = (vx, vy, vyaw)
|
|
376
|
-
|
|
378
|
+
|
|
377
379
|
def continuous_move():
|
|
378
380
|
while self._moving:
|
|
379
|
-
|
|
380
|
-
|
|
381
|
+
# 持续移动不需要每次都检查状态,因为已经在开始时检查过
|
|
382
|
+
try:
|
|
383
|
+
ret = self.sport_client.Move(vx, vy, vyaw)
|
|
384
|
+
success = ret == 0
|
|
385
|
+
if not success:
|
|
386
|
+
print(f"持续移动失败: ret={ret}")
|
|
387
|
+
break
|
|
388
|
+
except Exception as e:
|
|
389
|
+
print(f"持续移动异常: {e}")
|
|
381
390
|
break
|
|
382
391
|
time.sleep(0.1)
|
|
383
|
-
|
|
392
|
+
|
|
384
393
|
self._move_thread = threading.Thread(target=continuous_move)
|
|
385
394
|
self._move_thread.daemon = True # 设置为守护线程
|
|
386
395
|
self._move_thread.start()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ezgo
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.14
|
|
4
4
|
Summary: 宇树Go2机器狗Python控制库
|
|
5
5
|
Author-email: ezgo <noreply@example.com>
|
|
6
6
|
License: MIT
|
|
@@ -417,14 +417,17 @@ pip install opencv-python numpy Pillow netifaces
|
|
|
417
417
|
|
|
418
418
|
## 更新日志
|
|
419
419
|
|
|
420
|
-
### v0.0.
|
|
420
|
+
### v0.0.14 (2025-12-24)
|
|
421
421
|
**修复**:
|
|
422
|
-
- 🐛
|
|
423
|
-
- 🐛
|
|
422
|
+
- 🐛 彻底修复Move函数状态检查过严的问题
|
|
423
|
+
- 🐛 修复StartMove持续移动函数的状态检查
|
|
424
|
+
- 🐛 放宽移动控制允许的状态范围,支持在更多运动模式下移动
|
|
425
|
+
- 🐛 修复在闪避模式、并腿跑、跳跃跑、经典、倒立、交叉步、直立、牵引等特殊运动模式下无法移动的问题
|
|
424
426
|
|
|
425
427
|
**改进**:
|
|
426
|
-
- 🔧
|
|
427
|
-
- 🔧
|
|
428
|
+
- 🔧 Move和StartMove函数现在只禁止明显不能移动的状态(表演、坐下、空翻等)
|
|
429
|
+
- 🔧 允许在闪避(2007)、并腿跑(2008)、跳跃跑(2009)、经典(2010)、倒立(2011)、交叉步(2016)、直立(2017)、牵引(2019)等运动模式下进行移动控制
|
|
430
|
+
- 🔧 优化StartMove持续移动逻辑,减少不必要的状态检查
|
|
428
431
|
|
|
429
432
|
### v0.0.11 (2025-12-23)
|
|
430
433
|
**修复**:
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
ezgo/__init__.py,sha256=
|
|
1
|
+
ezgo/__init__.py,sha256=vfoGvwd73-GD2RWRrJJW0oU66o10LiAAhs2TKmDud2k,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=_Ej8Dl3GsP6KOpJzorZZbwVi6G44mJrRlhHANN95Tck,32301
|
|
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.14.dist-info/LICENSE,sha256=Zk4eZBT3KaBhqM3LB_xN7QquwnoWsEHAoA6eLdE6W5M,1060
|
|
10
|
+
ezgo-0.0.14.dist-info/METADATA,sha256=IJcOtTr6bNc0nXZOQOhWYuLDTw3tZ2bRQmIDxjdoaRg,16621
|
|
11
|
+
ezgo-0.0.14.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
|
12
|
+
ezgo-0.0.14.dist-info/top_level.txt,sha256=BdCFEVD5V_4FxUtvH0BVlZKgxYnp7EKNsYs5OyFxj-g,5
|
|
13
|
+
ezgo-0.0.14.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|