This commit is contained in:
2025-12-18 14:40:00 +08:00
commit 449bee6cc7
378 changed files with 93265 additions and 0 deletions

BIN
StartService/bin/start Executable file

Binary file not shown.

14
StartService/bin/start.sh Normal file
View File

@@ -0,0 +1,14 @@
#开启pubimg.service,上传最新的照片至服务器
sudo systemctl start pubimg.service
# #开启虚拟设备
sudo modprobe v4l2loopback video_nr=10 card_label="VirtualCam10" exclusive_caps=1
# #开启YOLO检测,并写入视频流
python3 /opt/rknn-yolov11/src/yolov11_stereo_distance.py \
--enable-v4l2-out \
--v4l2-device /dev/video10 \
--v4l2-out-pix-fmt rgb24 > /dev/null 2>&1
# #开启fastapi
# sudo systemctl start fastApi.service

3
StartService/bin/stop.sh Normal file
View File

@@ -0,0 +1,3 @@
sudo systemctl stop fastApi.service
sudo systemctl stop pubimg.service

View File

@@ -0,0 +1,9 @@
all:start
start:
g++ -g -o start start.cpp
mv start ../bin
clean:
rm -rf start

View File

@@ -0,0 +1,62 @@
/*
本程序为BSD服务启动程序,主要用于进行BSD系统的服务启动
*/
#include <iostream>
using namespace std;
void StartDeep();
int main(int argc, char **argv)
{
if (argc != 2)
{
cout << "Using:./start start/stop" << endl;
return -1;
}
string commnd = "";
string action(argv[1]);
if (action == "start")
{
commnd = "echo 'orangepi' | sh /home/orangepi/RKApp/StartService/bin/start.sh";
}
else if (action == "stop")
{
commnd = "echo 'orangepi' | sh /home/orangepi/RKApp/StartService/bin/stop.sh";
}
else
{
cout << "Unknown action: " << action << "\nUsing: ./start start|stop" << endl;
return -1;
}
system(commnd.c_str());
// StartDeep();
return 0;
}
void StartDeep()
{
// string cmd = "/home/orangepi/miniconda3/bin/python3 /opt/rknn-yolov11/src/yolov11_stereo_distance.py \
// --enable-v4l2-out \
// --v4l2-device /dev/video10 \
// --v4l2-out-pix-fmt rgb24 > /dev/null 2>&1";
string cmd = "python3 /opt/rknn-yolov11/src/yolov11_stereo_distance.py \
--enable-v4l2-out \
--v4l2-device /dev/video10 \
--v4l2-out-pix-fmt rgb24 > /dev/null 2>&1";
try
{
system(cmd.c_str());
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
}