ezgo 0.0.14__tar.gz → 0.0.16__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.14
3
+ Version: 0.0.16
4
4
  Summary: 宇树Go2机器狗Python控制库
5
5
  Author-email: ezgo <noreply@example.com>
6
6
  License: MIT
@@ -417,6 +417,28 @@ pip install opencv-python numpy Pillow netifaces
417
417
 
418
418
  ## 更新日志
419
419
 
420
+ ### v0.0.16 (2026-02-04)
421
+ **修复**:
422
+ - 🐛 修复 MoveForDuration 函数在 duration 时间结束后未自动停止移动的问题
423
+ - 🐛 Forward、Backward、Left、Right、TurnLeft、TurnRight 等移动控制函数现在会在指定时间后准确停止
424
+ - 🐛 MoveForDuration 在循环结束后自动调用 StopMove() 确保机器狗停止移动
425
+ - 🐛 修复 Keyboard 中断时未停止移动的问题
426
+
427
+ **改进**:
428
+ - 🔧 移动控制函数的行为现在与文档描述一致,duration 参数真正控制移动时间
429
+ - 🔧 提升用户体验,无需手动调用 StopMove() 即可实现定时移动
430
+
431
+ ### v0.0.15 (2025-12-24)
432
+ **修复**:
433
+ - 🐛 移除所有模式函数的自动关闭逻辑,用户可以自主控制开启和关闭
434
+ - 🐛 修复FreeBound、FreeJump、FreeAvoid、WalkUpright、CrossStep、HandStand等函数的自动关闭问题
435
+ - 🐛 用户现在可以自由控制模式的持续时间,不再强制自动关闭
436
+
437
+ **改进**:
438
+ - 🔧 所有步态模式函数现在由用户完全控制,flag=1开启,flag=0关闭
439
+ - 🔧 FreeAvoid开启后可以配合Move函数进行真正的自动避障移动
440
+ - 🔧 更新所有相关函数的文档说明,明确参数含义
441
+
420
442
  ### v0.0.14 (2025-12-24)
421
443
  **修复**:
422
444
  - 🐛 彻底修复Move函数状态检查过严的问题
@@ -382,6 +382,28 @@ pip install opencv-python numpy Pillow netifaces
382
382
 
383
383
  ## 更新日志
384
384
 
385
+ ### v0.0.16 (2026-02-04)
386
+ **修复**:
387
+ - 🐛 修复 MoveForDuration 函数在 duration 时间结束后未自动停止移动的问题
388
+ - 🐛 Forward、Backward、Left、Right、TurnLeft、TurnRight 等移动控制函数现在会在指定时间后准确停止
389
+ - 🐛 MoveForDuration 在循环结束后自动调用 StopMove() 确保机器狗停止移动
390
+ - 🐛 修复 Keyboard 中断时未停止移动的问题
391
+
392
+ **改进**:
393
+ - 🔧 移动控制函数的行为现在与文档描述一致,duration 参数真正控制移动时间
394
+ - 🔧 提升用户体验,无需手动调用 StopMove() 即可实现定时移动
395
+
396
+ ### v0.0.15 (2025-12-24)
397
+ **修复**:
398
+ - 🐛 移除所有模式函数的自动关闭逻辑,用户可以自主控制开启和关闭
399
+ - 🐛 修复FreeBound、FreeJump、FreeAvoid、WalkUpright、CrossStep、HandStand等函数的自动关闭问题
400
+ - 🐛 用户现在可以自由控制模式的持续时间,不再强制自动关闭
401
+
402
+ **改进**:
403
+ - 🔧 所有步态模式函数现在由用户完全控制,flag=1开启,flag=0关闭
404
+ - 🔧 FreeAvoid开启后可以配合Move函数进行真正的自动避障移动
405
+ - 🔧 更新所有相关函数的文档说明,明确参数含义
406
+
385
407
  ### v0.0.14 (2025-12-24)
386
408
  **修复**:
387
409
  - 🐛 彻底修复Move函数状态检查过严的问题
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ezgo"
7
- version = "0.0.14"
7
+ version = "0.0.16"
8
8
  description = "宇树Go2机器狗Python控制库"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.7"
@@ -8,7 +8,7 @@ ezgo - 宇树Go2机器狗Python控制库
8
8
  支持运动控制、视频流获取、UI界面等功能。
9
9
  """
10
10
 
11
- __version__ = "0.0.14"
11
+ __version__ = "0.0.15"
12
12
  __author__ = "ezgo"
13
13
  __email__ = ""
14
14
  __license__ = "MIT"
@@ -292,7 +292,7 @@ class Go2:
292
292
  def move_thread():
293
293
  ret = self.sport_client.Move(vx, vy, vyaw)
294
294
  success = ret == 0
295
- print(f"Move 执行结果: {ret}, 成功: {success}")
295
+ # print(f"Move 执行结果: {ret}, 成功: {success}")
296
296
  return success
297
297
 
298
298
  t = threading.Thread(target=move_thread)
@@ -303,30 +303,33 @@ class Go2:
303
303
  def MoveForDuration(self, vx, vy, vyaw, duration):
304
304
  """
305
305
  持续移动指定时间
306
-
306
+
307
307
  Args:
308
308
  vx (float): 前后速度 (-1.0 到 1.0)
309
- vy (float): 左右速度 (-1.0 到 1.0)
309
+ vy (float): 左右速度 (-1.0 到 1.0)
310
310
  vyaw (float): 转动速度 (-2.0 到 2.0)
311
311
  duration (float): 移动时间(秒)
312
-
312
+
313
313
  Returns:
314
314
  bool: 是否成功执行
315
315
  """
316
316
  print(f"开始移动: vx={vx}, vy={vy}, vyaw={vyaw}, 持续时间={duration}秒")
317
317
  start_time = time.time()
318
-
318
+
319
319
  try:
320
320
  while time.time() - start_time < duration:
321
321
  if not self.Move(vx, vy, vyaw):
322
322
  return False
323
323
  time.sleep(0.1) # 每100ms调用一次
324
-
324
+
325
+ # 时间到后,主动停止移动
326
+ self.StopMove()
325
327
  print("移动完成")
326
328
  return True
327
-
329
+
328
330
  except KeyboardInterrupt:
329
331
  print("移动被用户中断")
332
+ self.StopMove()
330
333
  return False
331
334
 
332
335
  def Forward(self, speed=0.3, duration=2.0):
@@ -615,12 +618,11 @@ class Go2:
615
618
  self._call(self.sport_client.Dance2)
616
619
 
617
620
  def HandStand(self, flag: int):
618
- """倒立行走。"""
621
+ """倒立行走。flag=1开启,flag=0关闭。"""
619
622
  # 执行指令
620
- self._call(lambda: self.sport_client.HandStand(bool(flag)))
621
- if flag:
622
- time.sleep(4)
623
- self._call(lambda: self.sport_client.HandStand(False))
623
+ result = self._call(lambda: self.sport_client.HandStand(bool(flag)))
624
+ success = result == 0 if result is not None else False
625
+ return success
624
626
 
625
627
  def LeftFlip(self):
626
628
  """左空翻。"""
@@ -651,68 +653,38 @@ class Go2:
651
653
  return result == 0 if result is not None else False
652
654
 
653
655
  def FreeBound(self, flag: int):
654
- """ 并腿跑模式。"""
656
+ """ 并腿跑模式。flag=1开启,flag=0关闭。"""
655
657
  # 执行指令
656
658
  result = self._call(lambda: self.sport_client.FreeBound(bool(flag)))
657
659
  success = result == 0 if result is not None else False
658
-
659
- if flag and success:
660
- # 如果成功开启,等待2秒后自动关闭(这是为了演示效果)
661
- time.sleep(2)
662
- self._call(lambda: self.sport_client.FreeBound(False))
663
-
664
660
  return success
665
661
 
666
662
  def FreeJump(self, flag: int):
667
- """ 跳跃模式。"""
663
+ """ 跳跃模式。flag=1开启,flag=0关闭。"""
668
664
  # 执行指令
669
665
  result = self._call(lambda: self.sport_client.FreeJump(bool(flag)))
670
666
  success = result == 0 if result is not None else False
671
-
672
- if flag and success:
673
- # 如果成功开启,等待4秒后自动关闭(这是为了演示效果)
674
- time.sleep(4)
675
- self._call(lambda: self.sport_client.FreeJump(False))
676
-
677
667
  return success
678
668
 
679
669
  def FreeAvoid(self, flag: int):
680
- """ 闪避模式。"""
670
+ """ 闪避模式。flag=1开启,flag=0关闭。开启后可配合Move函数进行自动避障移动。"""
681
671
  # 执行指令
682
672
  result = self._call(lambda: self.sport_client.FreeAvoid(bool(flag)))
683
673
  success = result == 0 if result is not None else False
684
-
685
- if flag and success:
686
- # 如果成功开启,等待2秒后自动关闭(这是为了演示效果)
687
- time.sleep(2)
688
- self._call(lambda: self.sport_client.FreeAvoid(False))
689
-
690
674
  return success
691
675
 
692
676
  def WalkUpright(self, flag: int):
693
- """ 后腿直立模式。"""
677
+ """ 后腿直立模式。flag=1开启,flag=0关闭。"""
694
678
  # 执行指令
695
679
  result = self._call(lambda: self.sport_client.WalkUpright(bool(flag)))
696
680
  success = result == 0 if result is not None else False
697
-
698
- if flag and success:
699
- # 如果成功开启,等待4秒后自动关闭(这是为了演示效果)
700
- time.sleep(4)
701
- self._call(lambda: self.sport_client.WalkUpright(False))
702
-
703
681
  return success
704
682
 
705
683
  def CrossStep(self, flag: int):
706
- """ 交叉步模式。"""
684
+ """ 交叉步模式。flag=1开启,flag=0关闭。"""
707
685
  # 执行指令
708
686
  result = self._call(lambda: self.sport_client.CrossStep(bool(flag)))
709
687
  success = result == 0 if result is not None else False
710
-
711
- if flag and success:
712
- # 如果成功开启,等待4秒后自动关闭(这是为了演示效果)
713
- time.sleep(4)
714
- self._call(lambda: self.sport_client.CrossStep(False))
715
-
716
688
  return success
717
689
 
718
690
  def AutoRecoverSet(self, flag: int):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ezgo
3
- Version: 0.0.14
3
+ Version: 0.0.16
4
4
  Summary: 宇树Go2机器狗Python控制库
5
5
  Author-email: ezgo <noreply@example.com>
6
6
  License: MIT
@@ -417,6 +417,28 @@ pip install opencv-python numpy Pillow netifaces
417
417
 
418
418
  ## 更新日志
419
419
 
420
+ ### v0.0.16 (2026-02-04)
421
+ **修复**:
422
+ - 🐛 修复 MoveForDuration 函数在 duration 时间结束后未自动停止移动的问题
423
+ - 🐛 Forward、Backward、Left、Right、TurnLeft、TurnRight 等移动控制函数现在会在指定时间后准确停止
424
+ - 🐛 MoveForDuration 在循环结束后自动调用 StopMove() 确保机器狗停止移动
425
+ - 🐛 修复 Keyboard 中断时未停止移动的问题
426
+
427
+ **改进**:
428
+ - 🔧 移动控制函数的行为现在与文档描述一致,duration 参数真正控制移动时间
429
+ - 🔧 提升用户体验,无需手动调用 StopMove() 即可实现定时移动
430
+
431
+ ### v0.0.15 (2025-12-24)
432
+ **修复**:
433
+ - 🐛 移除所有模式函数的自动关闭逻辑,用户可以自主控制开启和关闭
434
+ - 🐛 修复FreeBound、FreeJump、FreeAvoid、WalkUpright、CrossStep、HandStand等函数的自动关闭问题
435
+ - 🐛 用户现在可以自由控制模式的持续时间,不再强制自动关闭
436
+
437
+ **改进**:
438
+ - 🔧 所有步态模式函数现在由用户完全控制,flag=1开启,flag=0关闭
439
+ - 🔧 FreeAvoid开启后可以配合Move函数进行真正的自动避障移动
440
+ - 🔧 更新所有相关函数的文档说明,明确参数含义
441
+
420
442
  ### v0.0.14 (2025-12-24)
421
443
  **修复**:
422
444
  - 🐛 彻底修复Move函数状态检查过严的问题
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes