ezgo 0.0.2__py3-none-any.whl → 0.0.4__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/ui.py ADDED
@@ -0,0 +1,77 @@
1
+ import tkinter as tk
2
+ import platform
3
+ import os
4
+
5
+
6
+ if platform.system() == "Linux":
7
+ os.environ["DISPLAY"] = ":0"
8
+
9
+ class APP(tk.Tk):
10
+ def __init__(self, title="APP", width=480, height=800):
11
+ super().__init__()
12
+ self.title_text = title
13
+ self.title(self.title_text)
14
+ self.geometry(f"{width}x{height}")
15
+
16
+ if platform.system() == "Linux":
17
+ self.resizable(False, False) # 固定窗口大小
18
+ self.attributes('-fullscreen', True) # 全屏
19
+ self.config(cursor="none") # 隐藏鼠标
20
+ self.update_idletasks() # 强制立即应用全屏,避免闪烁/延迟
21
+
22
+ # 显示图像和文字的全局变量
23
+ self.image = None # 显示的图像
24
+ self.text = "" # 显示的文字
25
+
26
+ self.is_running = True # 程序运行状态
27
+
28
+ # 初始化组件
29
+ self.create_widgets()
30
+ # 绑定窗口关闭事件
31
+ self.protocol("WM_DELETE_WINDOW", self.on_close)
32
+
33
+ def create_widgets(self):
34
+ # 标题
35
+ title_label = tk.Label(self, text=self.title_text, font=("SimHei", 18))
36
+ title_label.pack(pady=5)
37
+
38
+ # 图像显示区域
39
+ self.frame1 = tk.LabelFrame(self, text="图像", width=480, height=480, font=("SimHei", 10))
40
+ self.frame1.pack_propagate(False)
41
+ self.frame1.pack(fill=tk.X, pady=5)
42
+ self.image_label = tk.Label(self.frame1)
43
+ self.image_label.pack(pady=5, fill=tk.BOTH, expand=True, anchor=tk.CENTER)
44
+
45
+ # 文字显示区域
46
+ self.frame2 = tk.LabelFrame(self, text="结果", width=480, height=200, font=("SimHei", 10))
47
+ self.frame2.pack_propagate(False)
48
+ self.frame2.pack(fill=tk.X, pady=5)
49
+ self.text_label = tk.Label(self.frame2,
50
+ text="文本显示",
51
+ font=("SimHei", 14),
52
+ wraplength=450,
53
+ justify=tk.CENTER,)
54
+ self.text_label.pack(pady=5, fill=tk.BOTH, expand=True, anchor=tk.CENTER)
55
+
56
+
57
+ # 退出按钮
58
+ self.exit_btn = tk.Button(self, text="退出", command=self.on_close, font=("SimHei", 16))
59
+ self.exit_btn.pack(pady=10)
60
+
61
+
62
+ def set_image(self, image):
63
+ """设置显示的图像"""
64
+ self.image = image
65
+ self.image_label.config(image=self.image)
66
+
67
+ def set_text(self, text):
68
+ """设置显示的文字"""
69
+ self.text = text
70
+ self.text_label.config(text=self.text)
71
+
72
+ def on_close(self):
73
+ """窗口关闭/退出按钮回调"""
74
+ self.is_running = False
75
+ self.quit() # 退出主循环
76
+ self.destroy() # 销毁窗口
77
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ezgo
3
- Version: 0.0.2
3
+ Version: 0.0.4
4
4
  Summary: 宇树Go2机器狗Python控制库
5
5
  Author-email: ezgo <noreply@example.com>
6
6
  License: MIT
@@ -52,21 +52,28 @@ Requires-Dist: unitree-sdk2py; extra == "full"
52
52
 
53
53
  ## 安装
54
54
 
55
- ### 基础安装
55
+ ### 基础安装(仅核心库,无强制依赖)
56
56
  ```bash
57
57
  pip install ezgo
58
58
  ```
59
59
 
60
- ### 完整功能安装
60
+ ### 完整功能安装(包含所有可选依赖)
61
61
  ```bash
62
62
  pip install ezgo[full]
63
- ```
63
+ n```
64
64
 
65
- ### 仅基础功能
65
+ ### 仅基础功能(图像处理相关依赖)
66
66
  ```bash
67
67
  pip install ezgo[basic]
68
68
  ```
69
69
 
70
+ > **注意**: `ezgo` 核心库本身没有任何强制依赖。所有依赖都是可选的,您可以根据需要手动安装:
71
+ > - `unitree-sdk2py`: 机器人通信必需
72
+ > - `opencv-python`: 摄像头功能必需
73
+ > - `numpy`: 数值计算支持
74
+ > - `Pillow`: 图像处理支持
75
+ > - `netifaces`: �络接口检测
76
+
70
77
  ## 快速开始
71
78
 
72
79
  ### 基本运动控制
@@ -0,0 +1,11 @@
1
+ ezgo/__init__.py,sha256=k2oP52F-SZ6VBDE33l8cTJbEDGxlJLL7S9rZBBtFdYc,1978
2
+ ezgo/camera.py,sha256=Vsr44vFtaop4LE0DlWyOHyvxF-jHnVO8iMPUwp5mbsE,2538
3
+ ezgo/go2.py,sha256=V0bZ6frGIArop-lOoN6ybMekf7qfWv4jb7aWLxEHdkQ,25845
4
+ ezgo/go2_camera.py,sha256=nawUSLyvqTNiVRQ2sM-UdoJzqwZcySltLbCfUb0G9Qc,8614
5
+ ezgo/go2_vui.py,sha256=52I4Y8uqGkW9muDEnDzQ236HqVVTIgNIN_2gW5RTC48,10161
6
+ ezgo/ui.py,sha256=jUik6maaoemI2vsBM92OLZfJfskg54W7hwMls_gxppg,2777
7
+ ezgo-0.0.4.dist-info/LICENSE,sha256=Zk4eZBT3KaBhqM3LB_xN7QquwnoWsEHAoA6eLdE6W5M,1060
8
+ ezgo-0.0.4.dist-info/METADATA,sha256=cOE5dut6FpLvbY3AUyYM8Y14PlicnuYZ9_RluuYXVWQ,6869
9
+ ezgo-0.0.4.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
10
+ ezgo-0.0.4.dist-info/top_level.txt,sha256=BdCFEVD5V_4FxUtvH0BVlZKgxYnp7EKNsYs5OyFxj-g,5
11
+ ezgo-0.0.4.dist-info/RECORD,,
@@ -0,0 +1 @@
1
+ ezgo
@@ -1,5 +0,0 @@
1
- ezgo-0.0.2.dist-info/LICENSE,sha256=Zk4eZBT3KaBhqM3LB_xN7QquwnoWsEHAoA6eLdE6W5M,1060
2
- ezgo-0.0.2.dist-info/METADATA,sha256=zEfRqyj0DMUzfOw4_A1uPcfHDaSbDPHXtgmOvFTb98Y,6444
3
- ezgo-0.0.2.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
4
- ezgo-0.0.2.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
5
- ezgo-0.0.2.dist-info/RECORD,,
@@ -1 +0,0 @@
1
-
File without changes
File without changes