diff --git a/components/camera.py b/components/camera.py index 343503b..610ed6b 100644 --- a/components/camera.py +++ b/components/camera.py @@ -74,7 +74,7 @@ class CameraSignals(QObject): # pyqt的相机管理类 -@device("camera", auto_start=True) +@device("camera", auto_start=False) class Camera(EdgeComponent): signals = CameraSignals() diff --git a/components/lidar.py b/components/lidar.py index b9d24db..cb6aa3e 100644 --- a/components/lidar.py +++ b/components/lidar.py @@ -175,7 +175,7 @@ class LidarSignals(QObject): on_device_data = pyqtSignal(object) -@device("lidar", auto_start=True) +@device("lidar", auto_start=False) class LidarDevice(EdgeComponent): signals = LidarSignals() diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..a02ae6c --- /dev/null +++ b/start.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# 1. 检查并杀掉 ss928_fb_tool 进程 +process_name="ss928_fb_tool" +pid=$(pgrep "$process_name") +if [ -n "$pid" ]; then + echo "Killing existing process: $process_name (PID: $pid)" + kill -9 "$pid" + sleep 1 +fi + +# 启动 ss928_fb_tool 并等待 3 秒 +echo "Starting $process_name..." +$process_name & +sleep 3 + +# 2. 切换到工作目录 +work_dir="/root/app/detect-gui" +echo "Switching to work directory: $work_dir" +cd "$work_dir" || { echo "Failed to switch to directory: $work_dir"; exit 1; } + +# 3. 定义 Python 解释器路径 +python_path="/root/miniconda3/envs/pyqt5/bin/python" + +# 4. 使用 Python 解释器运行 main.py +echo "Running main.py with Python interpreter: $python_path" +"$python_path" main.py