diff --git a/src/YOLOv6/imgdir/x.jpg b/src/YOLOv6/imgdir/x.jpg new file mode 100644 index 0000000..1e3396e Binary files /dev/null and b/src/YOLOv6/imgdir/x.jpg differ diff --git a/src/YOLOv6/runs/inference/exp/x.jpg b/src/YOLOv6/runs/inference/exp/x.jpg new file mode 100644 index 0000000..a7c6937 Binary files /dev/null and b/src/YOLOv6/runs/inference/exp/x.jpg differ diff --git a/src/YOLOv6/yolov6/core/__pycache__/inferer.cpython-38.pyc b/src/YOLOv6/yolov6/core/__pycache__/inferer.cpython-38.pyc new file mode 100644 index 0000000..a68b092 Binary files /dev/null and b/src/YOLOv6/yolov6/core/__pycache__/inferer.cpython-38.pyc differ diff --git a/src/YOLOv6/yolov6/data/__pycache__/data_augment.cpython-38.pyc b/src/YOLOv6/yolov6/data/__pycache__/data_augment.cpython-38.pyc new file mode 100644 index 0000000..b330d39 Binary files /dev/null and b/src/YOLOv6/yolov6/data/__pycache__/data_augment.cpython-38.pyc differ diff --git a/src/YOLOv6/yolov6/data/__pycache__/datasets.cpython-38.pyc b/src/YOLOv6/yolov6/data/__pycache__/datasets.cpython-38.pyc new file mode 100644 index 0000000..f17fc12 Binary files /dev/null and b/src/YOLOv6/yolov6/data/__pycache__/datasets.cpython-38.pyc differ diff --git a/src/YOLOv6/yolov6/layers/__pycache__/common.cpython-38.pyc b/src/YOLOv6/yolov6/layers/__pycache__/common.cpython-38.pyc new file mode 100644 index 0000000..affffde Binary files /dev/null and b/src/YOLOv6/yolov6/layers/__pycache__/common.cpython-38.pyc differ diff --git a/src/YOLOv6/yolov6/layers/__pycache__/dbb_transforms.cpython-38.pyc b/src/YOLOv6/yolov6/layers/__pycache__/dbb_transforms.cpython-38.pyc new file mode 100644 index 0000000..bb8f75d Binary files /dev/null and b/src/YOLOv6/yolov6/layers/__pycache__/dbb_transforms.cpython-38.pyc differ diff --git a/src/YOLOv6/yolov6/models/__pycache__/efficientrep.cpython-38.pyc b/src/YOLOv6/yolov6/models/__pycache__/efficientrep.cpython-38.pyc new file mode 100644 index 0000000..c23b875 Binary files /dev/null and b/src/YOLOv6/yolov6/models/__pycache__/efficientrep.cpython-38.pyc differ diff --git a/src/YOLOv6/yolov6/models/__pycache__/effidehead.cpython-38.pyc b/src/YOLOv6/yolov6/models/__pycache__/effidehead.cpython-38.pyc new file mode 100644 index 0000000..b955705 Binary files /dev/null and b/src/YOLOv6/yolov6/models/__pycache__/effidehead.cpython-38.pyc differ diff --git a/src/YOLOv6/yolov6/models/__pycache__/reppan.cpython-38.pyc b/src/YOLOv6/yolov6/models/__pycache__/reppan.cpython-38.pyc new file mode 100644 index 0000000..3807f1e Binary files /dev/null and b/src/YOLOv6/yolov6/models/__pycache__/reppan.cpython-38.pyc differ diff --git a/src/YOLOv6/yolov6/models/__pycache__/yolo.cpython-38.pyc b/src/YOLOv6/yolov6/models/__pycache__/yolo.cpython-38.pyc new file mode 100644 index 0000000..f4c24f9 Binary files /dev/null and b/src/YOLOv6/yolov6/models/__pycache__/yolo.cpython-38.pyc differ diff --git a/src/YOLOv6/yolov6/utils/__pycache__/checkpoint.cpython-38.pyc b/src/YOLOv6/yolov6/utils/__pycache__/checkpoint.cpython-38.pyc new file mode 100644 index 0000000..e4e5d45 Binary files /dev/null and b/src/YOLOv6/yolov6/utils/__pycache__/checkpoint.cpython-38.pyc differ diff --git a/src/YOLOv6/yolov6/utils/__pycache__/events.cpython-38.pyc b/src/YOLOv6/yolov6/utils/__pycache__/events.cpython-38.pyc new file mode 100644 index 0000000..bb894af Binary files /dev/null and b/src/YOLOv6/yolov6/utils/__pycache__/events.cpython-38.pyc differ diff --git a/src/YOLOv6/yolov6/utils/__pycache__/nms.cpython-38.pyc b/src/YOLOv6/yolov6/utils/__pycache__/nms.cpython-38.pyc new file mode 100644 index 0000000..667a893 Binary files /dev/null and b/src/YOLOv6/yolov6/utils/__pycache__/nms.cpython-38.pyc differ diff --git a/src/YOLOv6/yolov6/utils/__pycache__/torch_utils.cpython-38.pyc b/src/YOLOv6/yolov6/utils/__pycache__/torch_utils.cpython-38.pyc new file mode 100644 index 0000000..b66a979 Binary files /dev/null and b/src/YOLOv6/yolov6/utils/__pycache__/torch_utils.cpython-38.pyc differ diff --git a/src/include/Air_Ground_CEC/atr.h b/src/include/Air_Ground_CEC/atr.h new file mode 100644 index 0000000..43dba87 --- /dev/null +++ b/src/include/Air_Ground_CEC/atr.h @@ -0,0 +1,29 @@ +#ifndef ATR_H +#define ATR_H +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class ATR : public QThread{ + Q_OBJECT + +public: + ATR(); + void runCommand(); + void getSolvedPic(); + + cv::Mat SolvedImg; + +Q_SIGNALS: + void show_solvedImage(QImage solvedImage); +}; + +#endif // ATR_H diff --git a/src/include/Air_Ground_CEC/mainwindow.hpp b/src/include/Air_Ground_CEC/mainwindow.hpp index 23ff0e4..febdcb4 100644 --- a/src/include/Air_Ground_CEC/mainwindow.hpp +++ b/src/include/Air_Ground_CEC/mainwindow.hpp @@ -11,6 +11,7 @@ #include "qnode.hpp" #include "dashboard.h" #include +#include "atr.h" using namespace cv; namespace Ui { @@ -49,7 +50,8 @@ public slots: void Slider_linear_valueChanged(int v); void importFrame();//read video void slot_show_image(const QImage& image);//added - + void slot_show_solvedImage(const QImage& solvedImage); + void slot_get_slovedImage(); private slots: void on_Stop_receive_clicked(); @@ -60,6 +62,7 @@ private slots: private: Ui::MainWindow *ui; QNode qnode; + ATR atr; JoyStick *rock_widget; DashBoard *m_DashBoard_x; DashBoard *m_DashBoard_th; diff --git a/src/main/atr.cpp b/src/main/atr.cpp new file mode 100644 index 0000000..6332524 --- /dev/null +++ b/src/main/atr.cpp @@ -0,0 +1,29 @@ +#include "../include/Air_Ground_CEC/atr.h" +using namespace std; +#include "stdlib.h" +char filename[100]; + +ATR::ATR() +{ +} + +void ATR::runCommand(){ + string ws = "cd /home/cyber/Study/Codes/catkin_ws/src/Air_Ground_CEC/src/YOLOv6"; + string CMD = "python3 ../YOLOv6/tools/infer.py --weights ../YOLOv6/yolov6n.pt --source ../YOLOv6/imgdir/"; + string Pic = "x.jpg"; + string Command = ws + "&&" + CMD + Pic; + std::cout<getimage, SIGNAL(clicked()), this, SLOT(slot_get_slovedImage())); + //绑定slider的函数 connect(ui->horizontalSlider_raw, SIGNAL(valueChanged(int)), this, SLOT(Slider_raw_valueChanged(int))); @@ -198,10 +200,17 @@ void MainWindow::connections(){ //电源的信号 connect(&qnode, SIGNAL(batteryState(sensor_msgs::BatteryState)), this, SLOT(slot_batteryState(sensor_msgs::BatteryState))); - + // image connect(&qnode, SIGNAL(show_image(QImage)), this, SLOT(slot_show_image(QImage))); + + // solvedimage + connect(&atr, SIGNAL(show_solvedImage(QImage)), this, SLOT(slot_show_solvedImage(QImage))); } +void MainWindow::slot_get_slovedImage(){ + atr.runCommand(); + atr.getSolvedPic(); +} void MainWindow::slot_speed_x(double x) { m_DashBoard_x->set_speed(abs(x * 100)); @@ -254,6 +263,10 @@ void MainWindow::slot_show_image(const QImage& image) //qimage_mutex_.unlock(); } +void MainWindow::slot_show_solvedImage(const QImage& solvedImage){ + ui->label_2->setPixmap(QPixmap::fromImage(solvedImage)); + ui->label_2->resize(ui->label_2->pixmap()->size()); +} void MainWindow::setBtnStyles(){ /* diff --git a/src/main/qnode.cpp b/src/main/qnode.cpp index 016c879..58b6cb3 100644 --- a/src/main/qnode.cpp +++ b/src/main/qnode.cpp @@ -31,7 +31,6 @@ bool QNode::init() { SubAndPubTopic(); }); - return true; } diff --git a/src/ui/mainwindow.ui b/src/ui/mainwindow.ui index 91c85f2..be5f123 100644 --- a/src/ui/mainwindow.ui +++ b/src/ui/mainwindow.ui @@ -203,16 +203,16 @@ margin:0px 0px 0px 0px; - 2 + 0 - 780 - 200 - 311 - 151 + 240 + 10 + 851 + 491 @@ -564,7 +564,7 @@ QProgressBar::chunk - + 270 @@ -572,7 +572,7 @@ QProgressBar::chunk - map + target @@ -590,15 +590,15 @@ QProgressBar::chunk - + - 270 - 200 + 180 + 40 - target + PushButton @@ -648,7 +648,7 @@ QProgressBar::chunk - 0 + 1