ezgo 0.0.15__py3-none-any.whl → 0.0.16__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/go2.py +10 -7
- {ezgo-0.0.15.dist-info → ezgo-0.0.16.dist-info}/METADATA +12 -1
- {ezgo-0.0.15.dist-info → ezgo-0.0.16.dist-info}/RECORD +6 -6
- {ezgo-0.0.15.dist-info → ezgo-0.0.16.dist-info}/WHEEL +1 -1
- {ezgo-0.0.15.dist-info → ezgo-0.0.16.dist-info}/LICENSE +0 -0
- {ezgo-0.0.15.dist-info → ezgo-0.0.16.dist-info}/top_level.txt +0 -0
ezgo/go2.py
CHANGED
|
@@ -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.
|
|
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
|
- 🐛 移除所有模式函数的自动关闭逻辑,用户可以自主控制开启和关闭
|
|
@@ -2,12 +2,12 @@ ezgo/__init__.py,sha256=XdJGNtFRNZwouVByMsopJ7APB23zkdAa7v5NvLrcpLw,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=i1__a--bsrz1-Td2gWkGy5fv57WSI2JLizHPwgqNKRs,31389
|
|
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.16.dist-info/LICENSE,sha256=Zk4eZBT3KaBhqM3LB_xN7QquwnoWsEHAoA6eLdE6W5M,1060
|
|
10
|
+
ezgo-0.0.16.dist-info/METADATA,sha256=57RUGJh-9Y0lSQOOzA-r0YmpySVJhh2OVi6ZGQOtofg,17835
|
|
11
|
+
ezgo-0.0.16.dist-info/WHEEL,sha256=WnJ8fYhv8N4SYVK2lLYNI6N0kVATA7b0piVUNvqIIJE,91
|
|
12
|
+
ezgo-0.0.16.dist-info/top_level.txt,sha256=BdCFEVD5V_4FxUtvH0BVlZKgxYnp7EKNsYs5OyFxj-g,5
|
|
13
|
+
ezgo-0.0.16.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|