ezgo 0.0.15__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.15
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,17 @@ 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
+
420
431
  ### v0.0.15 (2025-12-24)
421
432
  **修复**:
422
433
  - 🐛 移除所有模式函数的自动关闭逻辑,用户可以自主控制开启和关闭
@@ -382,6 +382,17 @@ 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
+
385
396
  ### v0.0.15 (2025-12-24)
386
397
  **修复**:
387
398
  - 🐛 移除所有模式函数的自动关闭逻辑,用户可以自主控制开启和关闭
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ezgo"
7
- version = "0.0.15"
7
+ version = "0.0.16"
8
8
  description = "宇树Go2机器狗Python控制库"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.7"
@@ -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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ezgo
3
- Version: 0.0.15
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,17 @@ 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
+
420
431
  ### v0.0.15 (2025-12-24)
421
432
  **修复**:
422
433
  - 🐛 移除所有模式函数的自动关闭逻辑,用户可以自主控制开启和关闭
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