ezgo 0.0.12__tar.gz → 0.0.15__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.
- {ezgo-0.0.12/src/ezgo.egg-info → ezgo-0.0.15}/PKG-INFO +20 -6
- {ezgo-0.0.12 → ezgo-0.0.15}/README.md +19 -5
- {ezgo-0.0.12 → ezgo-0.0.15}/pyproject.toml +1 -1
- {ezgo-0.0.12 → ezgo-0.0.15}/src/ezgo/__init__.py +1 -1
- {ezgo-0.0.12 → ezgo-0.0.15}/src/ezgo/go2.py +33 -55
- {ezgo-0.0.12 → ezgo-0.0.15/src/ezgo.egg-info}/PKG-INFO +20 -6
- {ezgo-0.0.12 → ezgo-0.0.15}/LICENSE +0 -0
- {ezgo-0.0.12 → ezgo-0.0.15}/setup.cfg +0 -0
- {ezgo-0.0.12 → ezgo-0.0.15}/src/ezgo/camera.py +0 -0
- {ezgo-0.0.12 → ezgo-0.0.15}/src/ezgo/ezcamera.py +0 -0
- {ezgo-0.0.12 → ezgo-0.0.15}/src/ezgo/eztk.py +0 -0
- {ezgo-0.0.12 → ezgo-0.0.15}/src/ezgo/go2_camera.py +0 -0
- {ezgo-0.0.12 → ezgo-0.0.15}/src/ezgo/go2_vui.py +0 -0
- {ezgo-0.0.12 → ezgo-0.0.15}/src/ezgo/ui.py +0 -0
- {ezgo-0.0.12 → ezgo-0.0.15}/src/ezgo.egg-info/SOURCES.txt +0 -0
- {ezgo-0.0.12 → ezgo-0.0.15}/src/ezgo.egg-info/dependency_links.txt +0 -0
- {ezgo-0.0.12 → ezgo-0.0.15}/src/ezgo.egg-info/requires.txt +0 -0
- {ezgo-0.0.12 → ezgo-0.0.15}/src/ezgo.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ezgo
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.15
|
|
4
4
|
Summary: 宇树Go2机器狗Python控制库
|
|
5
5
|
Author-email: ezgo <noreply@example.com>
|
|
6
6
|
License: MIT
|
|
@@ -417,14 +417,28 @@ pip install opencv-python numpy Pillow netifaces
|
|
|
417
417
|
|
|
418
418
|
## 更新日志
|
|
419
419
|
|
|
420
|
-
### v0.0.
|
|
420
|
+
### v0.0.15 (2025-12-24)
|
|
421
421
|
**修复**:
|
|
422
|
-
- 🐛
|
|
423
|
-
- 🐛
|
|
422
|
+
- 🐛 移除所有模式函数的自动关闭逻辑,用户可以自主控制开启和关闭
|
|
423
|
+
- 🐛 修复FreeBound、FreeJump、FreeAvoid、WalkUpright、CrossStep、HandStand等函数的自动关闭问题
|
|
424
|
+
- 🐛 用户现在可以自由控制模式的持续时间,不再强制自动关闭
|
|
424
425
|
|
|
425
426
|
**改进**:
|
|
426
|
-
- 🔧
|
|
427
|
-
- 🔧
|
|
427
|
+
- 🔧 所有步态模式函数现在由用户完全控制,flag=1开启,flag=0关闭
|
|
428
|
+
- 🔧 FreeAvoid开启后可以配合Move函数进行真正的自动避障移动
|
|
429
|
+
- 🔧 更新所有相关函数的文档说明,明确参数含义
|
|
430
|
+
|
|
431
|
+
### v0.0.14 (2025-12-24)
|
|
432
|
+
**修复**:
|
|
433
|
+
- 🐛 彻底修复Move函数状态检查过严的问题
|
|
434
|
+
- 🐛 修复StartMove持续移动函数的状态检查
|
|
435
|
+
- 🐛 放宽移动控制允许的状态范围,支持在更多运动模式下移动
|
|
436
|
+
- 🐛 修复在闪避模式、并腿跑、跳跃跑、经典、倒立、交叉步、直立、牵引等特殊运动模式下无法移动的问题
|
|
437
|
+
|
|
438
|
+
**改进**:
|
|
439
|
+
- 🔧 Move和StartMove函数现在只禁止明显不能移动的状态(表演、坐下、空翻等)
|
|
440
|
+
- 🔧 允许在闪避(2007)、并腿跑(2008)、跳跃跑(2009)、经典(2010)、倒立(2011)、交叉步(2016)、直立(2017)、牵引(2019)等运动模式下进行移动控制
|
|
441
|
+
- 🔧 优化StartMove持续移动逻辑,减少不必要的状态检查
|
|
428
442
|
|
|
429
443
|
### v0.0.11 (2025-12-23)
|
|
430
444
|
**修复**:
|
|
@@ -382,14 +382,28 @@ pip install opencv-python numpy Pillow netifaces
|
|
|
382
382
|
|
|
383
383
|
## 更新日志
|
|
384
384
|
|
|
385
|
-
### v0.0.
|
|
385
|
+
### v0.0.15 (2025-12-24)
|
|
386
386
|
**修复**:
|
|
387
|
-
- 🐛
|
|
388
|
-
- 🐛
|
|
387
|
+
- 🐛 移除所有模式函数的自动关闭逻辑,用户可以自主控制开启和关闭
|
|
388
|
+
- 🐛 修复FreeBound、FreeJump、FreeAvoid、WalkUpright、CrossStep、HandStand等函数的自动关闭问题
|
|
389
|
+
- 🐛 用户现在可以自由控制模式的持续时间,不再强制自动关闭
|
|
389
390
|
|
|
390
391
|
**改进**:
|
|
391
|
-
- 🔧
|
|
392
|
-
- 🔧
|
|
392
|
+
- 🔧 所有步态模式函数现在由用户完全控制,flag=1开启,flag=0关闭
|
|
393
|
+
- 🔧 FreeAvoid开启后可以配合Move函数进行真正的自动避障移动
|
|
394
|
+
- 🔧 更新所有相关函数的文档说明,明确参数含义
|
|
395
|
+
|
|
396
|
+
### v0.0.14 (2025-12-24)
|
|
397
|
+
**修复**:
|
|
398
|
+
- 🐛 彻底修复Move函数状态检查过严的问题
|
|
399
|
+
- 🐛 修复StartMove持续移动函数的状态检查
|
|
400
|
+
- 🐛 放宽移动控制允许的状态范围,支持在更多运动模式下移动
|
|
401
|
+
- 🐛 修复在闪避模式、并腿跑、跳跃跑、经典、倒立、交叉步、直立、牵引等特殊运动模式下无法移动的问题
|
|
402
|
+
|
|
403
|
+
**改进**:
|
|
404
|
+
- 🔧 Move和StartMove函数现在只禁止明显不能移动的状态(表演、坐下、空翻等)
|
|
405
|
+
- 🔧 允许在闪避(2007)、并腿跑(2008)、跳跃跑(2009)、经典(2010)、倒立(2011)、交叉步(2016)、直立(2017)、牵引(2019)等运动模式下进行移动控制
|
|
406
|
+
- 🔧 优化StartMove持续移动逻辑,减少不必要的状态检查
|
|
393
407
|
|
|
394
408
|
### v0.0.11 (2025-12-23)
|
|
395
409
|
**修复**:
|
|
@@ -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()
|
|
@@ -606,12 +615,11 @@ class Go2:
|
|
|
606
615
|
self._call(self.sport_client.Dance2)
|
|
607
616
|
|
|
608
617
|
def HandStand(self, flag: int):
|
|
609
|
-
"""倒立行走。"""
|
|
618
|
+
"""倒立行走。flag=1开启,flag=0关闭。"""
|
|
610
619
|
# 执行指令
|
|
611
|
-
self._call(lambda: self.sport_client.HandStand(bool(flag)))
|
|
612
|
-
if
|
|
613
|
-
|
|
614
|
-
self._call(lambda: self.sport_client.HandStand(False))
|
|
620
|
+
result = self._call(lambda: self.sport_client.HandStand(bool(flag)))
|
|
621
|
+
success = result == 0 if result is not None else False
|
|
622
|
+
return success
|
|
615
623
|
|
|
616
624
|
def LeftFlip(self):
|
|
617
625
|
"""左空翻。"""
|
|
@@ -642,68 +650,38 @@ class Go2:
|
|
|
642
650
|
return result == 0 if result is not None else False
|
|
643
651
|
|
|
644
652
|
def FreeBound(self, flag: int):
|
|
645
|
-
""" 并腿跑模式。"""
|
|
653
|
+
""" 并腿跑模式。flag=1开启,flag=0关闭。"""
|
|
646
654
|
# 执行指令
|
|
647
655
|
result = self._call(lambda: self.sport_client.FreeBound(bool(flag)))
|
|
648
656
|
success = result == 0 if result is not None else False
|
|
649
|
-
|
|
650
|
-
if flag and success:
|
|
651
|
-
# 如果成功开启,等待2秒后自动关闭(这是为了演示效果)
|
|
652
|
-
time.sleep(2)
|
|
653
|
-
self._call(lambda: self.sport_client.FreeBound(False))
|
|
654
|
-
|
|
655
657
|
return success
|
|
656
658
|
|
|
657
659
|
def FreeJump(self, flag: int):
|
|
658
|
-
""" 跳跃模式。"""
|
|
660
|
+
""" 跳跃模式。flag=1开启,flag=0关闭。"""
|
|
659
661
|
# 执行指令
|
|
660
662
|
result = self._call(lambda: self.sport_client.FreeJump(bool(flag)))
|
|
661
663
|
success = result == 0 if result is not None else False
|
|
662
|
-
|
|
663
|
-
if flag and success:
|
|
664
|
-
# 如果成功开启,等待4秒后自动关闭(这是为了演示效果)
|
|
665
|
-
time.sleep(4)
|
|
666
|
-
self._call(lambda: self.sport_client.FreeJump(False))
|
|
667
|
-
|
|
668
664
|
return success
|
|
669
665
|
|
|
670
666
|
def FreeAvoid(self, flag: int):
|
|
671
|
-
""" 闪避模式。"""
|
|
667
|
+
""" 闪避模式。flag=1开启,flag=0关闭。开启后可配合Move函数进行自动避障移动。"""
|
|
672
668
|
# 执行指令
|
|
673
669
|
result = self._call(lambda: self.sport_client.FreeAvoid(bool(flag)))
|
|
674
670
|
success = result == 0 if result is not None else False
|
|
675
|
-
|
|
676
|
-
if flag and success:
|
|
677
|
-
# 如果成功开启,等待2秒后自动关闭(这是为了演示效果)
|
|
678
|
-
time.sleep(2)
|
|
679
|
-
self._call(lambda: self.sport_client.FreeAvoid(False))
|
|
680
|
-
|
|
681
671
|
return success
|
|
682
672
|
|
|
683
673
|
def WalkUpright(self, flag: int):
|
|
684
|
-
""" 后腿直立模式。"""
|
|
674
|
+
""" 后腿直立模式。flag=1开启,flag=0关闭。"""
|
|
685
675
|
# 执行指令
|
|
686
676
|
result = self._call(lambda: self.sport_client.WalkUpright(bool(flag)))
|
|
687
677
|
success = result == 0 if result is not None else False
|
|
688
|
-
|
|
689
|
-
if flag and success:
|
|
690
|
-
# 如果成功开启,等待4秒后自动关闭(这是为了演示效果)
|
|
691
|
-
time.sleep(4)
|
|
692
|
-
self._call(lambda: self.sport_client.WalkUpright(False))
|
|
693
|
-
|
|
694
678
|
return success
|
|
695
679
|
|
|
696
680
|
def CrossStep(self, flag: int):
|
|
697
|
-
""" 交叉步模式。"""
|
|
681
|
+
""" 交叉步模式。flag=1开启,flag=0关闭。"""
|
|
698
682
|
# 执行指令
|
|
699
683
|
result = self._call(lambda: self.sport_client.CrossStep(bool(flag)))
|
|
700
684
|
success = result == 0 if result is not None else False
|
|
701
|
-
|
|
702
|
-
if flag and success:
|
|
703
|
-
# 如果成功开启,等待4秒后自动关闭(这是为了演示效果)
|
|
704
|
-
time.sleep(4)
|
|
705
|
-
self._call(lambda: self.sport_client.CrossStep(False))
|
|
706
|
-
|
|
707
685
|
return success
|
|
708
686
|
|
|
709
687
|
def AutoRecoverSet(self, flag: int):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ezgo
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.15
|
|
4
4
|
Summary: 宇树Go2机器狗Python控制库
|
|
5
5
|
Author-email: ezgo <noreply@example.com>
|
|
6
6
|
License: MIT
|
|
@@ -417,14 +417,28 @@ pip install opencv-python numpy Pillow netifaces
|
|
|
417
417
|
|
|
418
418
|
## 更新日志
|
|
419
419
|
|
|
420
|
-
### v0.0.
|
|
420
|
+
### v0.0.15 (2025-12-24)
|
|
421
421
|
**修复**:
|
|
422
|
-
- 🐛
|
|
423
|
-
- 🐛
|
|
422
|
+
- 🐛 移除所有模式函数的自动关闭逻辑,用户可以自主控制开启和关闭
|
|
423
|
+
- 🐛 修复FreeBound、FreeJump、FreeAvoid、WalkUpright、CrossStep、HandStand等函数的自动关闭问题
|
|
424
|
+
- 🐛 用户现在可以自由控制模式的持续时间,不再强制自动关闭
|
|
424
425
|
|
|
425
426
|
**改进**:
|
|
426
|
-
- 🔧
|
|
427
|
-
- 🔧
|
|
427
|
+
- 🔧 所有步态模式函数现在由用户完全控制,flag=1开启,flag=0关闭
|
|
428
|
+
- 🔧 FreeAvoid开启后可以配合Move函数进行真正的自动避障移动
|
|
429
|
+
- 🔧 更新所有相关函数的文档说明,明确参数含义
|
|
430
|
+
|
|
431
|
+
### v0.0.14 (2025-12-24)
|
|
432
|
+
**修复**:
|
|
433
|
+
- 🐛 彻底修复Move函数状态检查过严的问题
|
|
434
|
+
- 🐛 修复StartMove持续移动函数的状态检查
|
|
435
|
+
- 🐛 放宽移动控制允许的状态范围,支持在更多运动模式下移动
|
|
436
|
+
- 🐛 修复在闪避模式、并腿跑、跳跃跑、经典、倒立、交叉步、直立、牵引等特殊运动模式下无法移动的问题
|
|
437
|
+
|
|
438
|
+
**改进**:
|
|
439
|
+
- 🔧 Move和StartMove函数现在只禁止明显不能移动的状态(表演、坐下、空翻等)
|
|
440
|
+
- 🔧 允许在闪避(2007)、并腿跑(2008)、跳跃跑(2009)、经典(2010)、倒立(2011)、交叉步(2016)、直立(2017)、牵引(2019)等运动模式下进行移动控制
|
|
441
|
+
- 🔧 优化StartMove持续移动逻辑,减少不必要的状态检查
|
|
428
442
|
|
|
429
443
|
### v0.0.11 (2025-12-23)
|
|
430
444
|
**修复**:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|