ezgo 0.0.17__tar.gz → 0.0.18__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ezgo
3
- Version: 0.0.17
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`)现在支持持续保持
@@ -402,6 +402,16 @@ pip install opencv-python numpy Pillow netifaces
402
402
 
403
403
  ## 更新日志
404
404
 
405
+ ### v0.0.18 (2026-02-04)
406
+ **修复**:
407
+ - 🐛 修复步态模式保持机制,确保在每次 Move 调用前都正确保持步态
408
+ - 🐛 在 MoveForDuration 和 StartMove 循环中添加步态模式保持逻辑
409
+ - 🐛 添加短暂延迟让步态模式生效后再执行 Move 指令
410
+
411
+ **改进**:
412
+ - 🔧 优化步态保持时序,确保步态模式在移动前完全生效
413
+ - 🔧 移除 Move 函数内部不必要的步态保持调用,避免重复
414
+
405
415
  ### v0.0.17 (2026-02-04)
406
416
  **新增功能**:
407
417
  - ✨ 常规运动模式(`TrotRun`、`StaticWalk`、`EconomicGait`)现在支持持续保持
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ezgo"
7
- version = "0.0.17"
7
+ version = "0.0.18"
8
8
  description = "宇树Go2机器狗Python控制库"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.7"
@@ -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.17
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`)现在支持持续保持
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