From 675c7357a950c39114e9807bc5ff60f5aeb10366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E7=8E=AE?= Date: Thu, 21 Nov 2024 16:46:11 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=B7=BB=E5=8A=A0=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/camera.py | 2 +- components/lidar.py | 2 +- start.sh | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 start.sh 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