diff --git a/src/UAV_UI_new/Setting.cpp b/src/UAV_UI_new/Setting.cpp new file mode 100644 index 0000000..b5f5f3e --- /dev/null +++ b/src/UAV_UI_new/Setting.cpp @@ -0,0 +1,51 @@ +#include "Setting.h" +#include +#include +#include +#include +#include + +Setting::Setting(QWidget *parent) + : QMainWindow(parent) +{ + ui.setupUi(this); + /*float longitude = ui.longitude->text().toFloat(); + float latitude = ui.latitude->text().toFloat(); + int hours = ui.hours->text().toInt(); + int minutes = ui.minutes->text().toInt(); + int seconds = ui.seconds->text().toInt();*/ + tcpsocket = new QTcpSocket(this); + tcpsocket->connectToHost("192.168.8.100", 9090); + connect(ui.finished, &QPushButton::clicked, this, &Setting::on_finished_button); +} + +Setting::~Setting() +{ +} +void Setting::on_finished_button() { + float longitude = ui.longitude->text().toFloat(); + float latitude = ui.latitude->text().toFloat(); + int hours = ui.hours->text().toInt(); + int minutes = ui.minutes->text().toInt(); + int seconds = ui.seconds->text().toInt(); + int x = ui.x->text().toInt(); + int y = ui.y->text().toInt(); + int z = ui.z->text().toInt(); + QJsonObject msg; + msg.insert("type", "Set"); + msg.insert("lon", longitude); + msg.insert("lat", latitude); + msg.insert("hours", hours); + msg.insert("minutes", minutes); + msg.insert("seconds", seconds); + msg.insert("x", x); + msg.insert("y", y); + msg.insert("z", z); + QJsonDocument jsonDocument; + jsonDocument.setObject(msg); + QByteArray dataArray = jsonDocument.toJson(); + if (tcpsocket->write(dataArray) == -1) { + qDebug() << "send TCP data package failed!"; + } + qDebug() << "sent!"; +} diff --git a/src/UAV_UI_new/Setting.h b/src/UAV_UI_new/Setting.h new file mode 100644 index 0000000..037eb43 --- /dev/null +++ b/src/UAV_UI_new/Setting.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include "ui_Setting.h" +#include +#include + +class Setting : public QMainWindow +{ + Q_OBJECT + +public: + Setting(QWidget *parent = nullptr); + ~Setting(); + QTcpServer* tcpserver; + QTcpSocket* tcpsocket; + +private: + Ui::SettingClass ui; +private slots: + void on_finished_button(); + +}; diff --git a/src/UAV_UI_new/Setting.ui b/src/UAV_UI_new/Setting.ui new file mode 100644 index 0000000..a1af477 --- /dev/null +++ b/src/UAV_UI_new/Setting.ui @@ -0,0 +1,203 @@ + + + SettingClass + + + + 0 + 0 + 871 + 571 + + + + Setting + + + + + + 20 + 20 + 451 + 241 + + + + + + + 出发时间: + + + + + + + + 150 + 16777215 + + + + + + + + + + + + 150 + 16777215 + + + + + + + + + + + + 150 + 16777215 + + + + 经度 + + + + + + + + 150 + 16777215 + + + + + + + + + + + + 150 + 16777215 + + + + 纬度 + + + + + + + + 80 + 16777215 + + + + 目的地 + + + + + + + + 16777215 + 20 + + + + x,y,z + + + + + + + + 150 + 16777215 + + + + 0 + + + + + + + + 150 + 16777215 + + + + 0 + + + + + + + + 150 + 16777215 + + + + 0 + + + + + + + + + 180 + 290 + 93 + 29 + + + + 完成 + + + + + + + 0 + 0 + 871 + 26 + + + + + + TopToolBarArea + + + false + + + + + + + + diff --git a/src/UAV_UI_new/UAV_UI_new.aps b/src/UAV_UI_new/UAV_UI_new.aps new file mode 100644 index 0000000..964179b Binary files /dev/null and b/src/UAV_UI_new/UAV_UI_new.aps differ diff --git a/src/UAV_UI_new/UAV_UI_new.cpp b/src/UAV_UI_new/UAV_UI_new.cpp new file mode 100644 index 0000000..2e865ba --- /dev/null +++ b/src/UAV_UI_new/UAV_UI_new.cpp @@ -0,0 +1,83 @@ +#include "UAV_UI_new.h" +#include "Setting.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace cv; +using namespace std; +VideoCapture cap; +//const string VideoCaptureAdress = "http://admin:admin@192.168.8.126:8081"; +const string VideoCaptureAdress = "rtsp://192.168.144.108:8000/375897"; //ȳ +//const string VideoCaptureAdress = "rtsp://192.168.144.108:8000/165506"; //nomal +//const string VideoCaptureAdress = "C:\\Users\\87334\\Videos\\Captures\\Fast_sent.mp4"; +UAV_UI_new::UAV_UI_new(QWidget* parent) + : QMainWindow(parent) +{ + ui.setupUi(this); + timer = new QTimer(this); + ui.display->setStyleSheet("border:1px solid black "); + ui.play_tag->setStyleSheet("background-color:white"); + connect(ui.Settings, &QPushButton::clicked, this, &UAV_UI_new::onclick_Setting_button); + connect(ui.connection, &QPushButton::clicked, this, &UAV_UI_new::on_connection_button); + connect(ui.stop, &QPushButton::clicked, this, &UAV_UI_new::on_stop_button); + connect(ui.action, &QPushButton::clicked, this, &UAV_UI_new::on_action_button); + connect(timer, SIGNAL(timeout()), this, SLOT(importImage())); + tcpsocket = new QTcpSocket(this); + tcpsocket->connectToHost("192.168.8.100", 9090); + connect(tcpsocket, &QTcpSocket::connected, [=]() { + QMessageBox *tip = new QMessageBox(this); + //QLabel *tip = new QLabel(this); + tip->setText("ӳɹ"); + tip->setInformativeText("connected successfully"); + tip->setStandardButtons(QMessageBox::Ok); + tip->show(); + }); + connect(tcpsocket, &QTcpSocket::readyRead, [=]() { + QByteArray jsonData = tcpsocket->readAll(); // JSON + QJsonDocument jsonDocument = QJsonDocument::fromJson(jsonData); + QJsonObject jsonObject = jsonDocument.object(); + QString type = jsonObject.value("type").toString(); + if (type == "Alarming") { + QMessageBox msgBox; + msgBox.setWindowTitle("Alarming"); + msgBox.setText("Fire and Fire"); + msgBox.show(); + } + }); +} + +UAV_UI_new::~UAV_UI_new() +{} +void UAV_UI_new::on_connection_button() { + cap.open(VideoCaptureAdress); + timer->start(100); +}; +void UAV_UI_new::onclick_Setting_button() { + Settings_UI.show(); +} +void UAV_UI_new::importImage() { + Mat image; + cap >> image; + cvtColor(image, image, COLOR_BGR2RGB); + cv::resize(image, image, Size(640, 480)); + QPixmap showimage = QPixmap::fromImage(QImage((const uchar*)(image.data), + image.cols, + image.rows, + image.step, + QImage::Format_RGB888)); + ui.display->setPixmap(showimage); +} +void UAV_UI_new::on_stop_button() { + timer->stop(); + cap.release(); + ui.display->clear(); +} +void UAV_UI_new::on_action_button() { + //ž +} diff --git a/src/UAV_UI_new/UAV_UI_new.h b/src/UAV_UI_new/UAV_UI_new.h new file mode 100644 index 0000000..0a029c1 --- /dev/null +++ b/src/UAV_UI_new/UAV_UI_new.h @@ -0,0 +1,35 @@ +#pragma once + +#include +#include "ui_UAV_UI_new.h" +#include "Setting.h" +#include +#include +#include +#include +#include +#include + +class UAV_UI_new : public QMainWindow +{ + Q_OBJECT + +public: + UAV_UI_new(QWidget *parent = nullptr); + ~UAV_UI_new(); + +private: + Ui::UAV_UI_newClass ui; + QTimer* timer; + double rate; + QTcpServer* tcpserver; + QTcpSocket* tcpsocket; + Setting Settings_UI; + +private slots: + void on_connection_button(); + void on_stop_button(); + void importImage(); + void onclick_Setting_button(); + void on_action_button(); +}; diff --git a/src/UAV_UI_new/UAV_UI_new.qrc b/src/UAV_UI_new/UAV_UI_new.qrc new file mode 100644 index 0000000..d2572c5 --- /dev/null +++ b/src/UAV_UI_new/UAV_UI_new.qrc @@ -0,0 +1,4 @@ + + + + diff --git a/src/UAV_UI_new/UAV_UI_new.rc b/src/UAV_UI_new/UAV_UI_new.rc new file mode 100644 index 0000000..ae1f3fe Binary files /dev/null and b/src/UAV_UI_new/UAV_UI_new.rc differ diff --git a/src/UAV_UI_new/UAV_UI_new.ui b/src/UAV_UI_new/UAV_UI_new.ui new file mode 100644 index 0000000..0559558 --- /dev/null +++ b/src/UAV_UI_new/UAV_UI_new.ui @@ -0,0 +1,148 @@ + + + UAV_UI_newClass + + + + 0 + 0 + 1159 + 682 + + + + UAV_UI_new + + + + + + 90 + 60 + 642 + 509 + + + + + 640 + 480 + + + + + + + true + + + + 640 + 480 + + + + + 640 + 480 + + + + + + + + + + + + + 820 + 140 + 93 + 29 + + + + stop + + + + + + 820 + 70 + 93 + 29 + + + + connection + + + + + + 100 + 40 + 81 + 31 + + + + 图像播放处 + + + + + + 1060 + 0 + 93 + 29 + + + + Settings + + + + + + 820 + 200 + 93 + 29 + + + + 出警 + + + + + + + 0 + 0 + 1159 + 26 + + + + + + TopToolBarArea + + + false + + + + + + + + + + diff --git a/src/UAV_UI_new/UAV_UI_new.vcxproj b/src/UAV_UI_new/UAV_UI_new.vcxproj new file mode 100644 index 0000000..3e38d8b --- /dev/null +++ b/src/UAV_UI_new/UAV_UI_new.vcxproj @@ -0,0 +1,120 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {FB496CF3-A3CE-4A50-BAC4-A9F43A71A5F9} + QtVS_v304 + 10.0.22000.0 + 10.0.22000.0 + $(MSBuildProjectDirectory)\QtMsBuild + + + + Application + v143 + + + Application + v143 + + + + + + + 6.2.4 + core;gui;network;widgets + debug + + + 6.2.4 + core;gui;widgets + release + + + + + + + + + + + + + + + + + D:\OpenCV\opencv\build\include\opencv2;D:\OpenCV\opencv\build\include;$(IncludePath) + D:\OpenCV\opencv\build\x64\vc15\lib;$(LibraryPath) + + + + + + D:\OpenCV\opencv\build\x64\vc15\lib;%(AdditionalLibraryDirectories) + opencv_world455d.lib;%(AdditionalDependencies) + + + + + true + true + ProgramDatabase + Disabled + + + Windows + true + + + + + true + true + None + MaxSpeed + + + Windows + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/UAV_UI_new/UAV_UI_new.vcxproj.filters b/src/UAV_UI_new/UAV_UI_new.vcxproj.filters new file mode 100644 index 0000000..8d90fdc --- /dev/null +++ b/src/UAV_UI_new/UAV_UI_new.vcxproj.filters @@ -0,0 +1,76 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {99349809-55BA-4b9d-BF79-8FDBB0286EB3} + ui + + + {639EADAA-A684-42e4-A9AD-28FC9BCB8F7C} + ts + + + + + Resource Files + + + Form Files + + + Header Files + + + Source Files + + + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + + + Form Files + + + Form Files + + + + + Header Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/src/UAV_UI_new/UAV_UI_new.vcxproj.user b/src/UAV_UI_new/UAV_UI_new.vcxproj.user new file mode 100644 index 0000000..fee5cdc --- /dev/null +++ b/src/UAV_UI_new/UAV_UI_new.vcxproj.user @@ -0,0 +1,10 @@ + + + + + 2023-05-21T16:36:10.6302989Z + + + 2023-05-21T16:36:10.6837787Z + + \ No newline at end of file diff --git a/src/UAV_UI_new/UAV_UI_new1.aps b/src/UAV_UI_new/UAV_UI_new1.aps new file mode 100644 index 0000000..a29db6b Binary files /dev/null and b/src/UAV_UI_new/UAV_UI_new1.aps differ diff --git a/src/UAV_UI_new/UAV_UI_new1.rc b/src/UAV_UI_new/UAV_UI_new1.rc new file mode 100644 index 0000000..677befe Binary files /dev/null and b/src/UAV_UI_new/UAV_UI_new1.rc differ diff --git a/src/UAV_UI_new/main.cpp b/src/UAV_UI_new/main.cpp new file mode 100644 index 0000000..285b360 --- /dev/null +++ b/src/UAV_UI_new/main.cpp @@ -0,0 +1,17 @@ +#include "UAV_UI_new.h" +#include +#include +#include +using namespace std; +using namespace cv; + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + UAV_UI_new w; + w.show(); + /*VideoCapture cap; + const string VideoCaptureAdress = "rtsp://192.168.144.108:8000/165506"; + cap.open(VideoCaptureAdress);*/ + return a.exec(); +} diff --git a/src/UAV_UI_new/resource.h b/src/UAV_UI_new/resource.h new file mode 100644 index 0000000..c373af6 --- /dev/null +++ b/src/UAV_UI_new/resource.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by UAV_UI_new.rc + +// ¶һĬֵ +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/src/UAV_UI_new/resource1.h b/src/UAV_UI_new/resource1.h new file mode 100644 index 0000000..eb2ce79 --- /dev/null +++ b/src/UAV_UI_new/resource1.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by UAV_UI_new1.rc + +// ¶һĬֵ +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/src/UAV_UI_new/tips.cpp b/src/UAV_UI_new/tips.cpp new file mode 100644 index 0000000..0fba930 --- /dev/null +++ b/src/UAV_UI_new/tips.cpp @@ -0,0 +1,10 @@ +#include "tips.h" + +tips::tips(QWidget *parent) + : QMainWindow(parent) +{ + ui.setupUi(this); +} + +tips::~tips() +{} diff --git a/src/UAV_UI_new/tips.h b/src/UAV_UI_new/tips.h new file mode 100644 index 0000000..d9ae8ec --- /dev/null +++ b/src/UAV_UI_new/tips.h @@ -0,0 +1,16 @@ +#pragma once + +#include +#include "ui_tips.h" + +class tips : public QMainWindow +{ + Q_OBJECT + +public: + tips(QWidget *parent = nullptr); + ~tips(); + +private: + Ui::tipsClass ui; +}; diff --git a/src/UAV_UI_new/tips.ui b/src/UAV_UI_new/tips.ui new file mode 100644 index 0000000..cec4907 --- /dev/null +++ b/src/UAV_UI_new/tips.ui @@ -0,0 +1,22 @@ + + tipsClass + + + tipsClass + + + + 0 + 0 + 600 + 400 + + + + tips + + + + + + diff --git a/src/UAV_UI_new/x64/Debug/Setting.obj b/src/UAV_UI_new/x64/Debug/Setting.obj new file mode 100644 index 0000000..b2f5de5 Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/Setting.obj differ diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.Build.CppClean.log b/src/UAV_UI_new/x64/Debug/UAV_UI_new.Build.CppClean.log new file mode 100644 index 0000000..0397d7c --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/UAV_UI_new.Build.CppClean.log @@ -0,0 +1,19 @@ +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\moc\moc_uav_ui_new.cpp +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\moc\moc_tips.cpp +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\moc\moc_setting.cpp +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\rcc\qrc_uav_ui_new.cpp +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\uic\ui_setting.h +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\uic\ui_tips.h +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\uic\ui_uav_ui_new.h +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\main.obj +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\tips.obj +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\uav_ui_new.obj +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\vc143.pdb +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\uav_ui_new.tlog\cl.command.1.tlog +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\uav_ui_new.tlog\moc.read.1u.tlog +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\uav_ui_new.tlog\moc.write.1u.tlog +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\uav_ui_new.tlog\rcc.read.1u.tlog +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\uav_ui_new.tlog\rcc.write.1u.tlog +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\uav_ui_new.tlog\uav_ui_new.write.1u.tlog +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\uav_ui_new.tlog\uic.read.1u.tlog +d:\software\uav_ui\uav_ui_new\uav_ui_new\x64\debug\uav_ui_new.tlog\uic.write.1u.tlog diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.exe.recipe b/src/UAV_UI_new/x64/Debug/UAV_UI_new.exe.recipe new file mode 100644 index 0000000..79ffc89 --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/UAV_UI_new.exe.recipe @@ -0,0 +1,11 @@ + + + + + D:\software\UAV_UI\UAV_UI_new\x64\Debug\UAV_UI_new.exe + + + + + + \ No newline at end of file diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.log b/src/UAV_UI_new/x64/Debug/UAV_UI_new.log new file mode 100644 index 0000000..3dad2b4 --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/UAV_UI_new.log @@ -0,0 +1,25 @@ + uic Setting.ui + Setting.cpp + UAV_UI_new.cpp + main.cpp +D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x1db 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。 +D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x1dd 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。 +D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x1de 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。 +D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x1e0 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。 +D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x630 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。 +D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x631 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。 +D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x632 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。 +D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x637 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。 +D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x73e 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。 +D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x73f 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。 +D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x741 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。 +D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x748 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。 +D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x74a 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。 +D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0x74b 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。 +D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0xbcb 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。 +D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0xbce 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。 +D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0xbcf 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。 +D:\software\UAV_UI\UAV_UI_new\UAV_UI_new\UAV_UI_new.cpp(1,1): warning C4828: 文件包含在偏移 0xbd0 处开始的字符,该字符在当前源字符集中无效(代码页 65001)。 + moc_Setting.cpp + moc_UAV_UI_new.cpp + UAV_UI_new.vcxproj -> D:\software\UAV_UI\UAV_UI_new\x64\Debug\UAV_UI_new.exe diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.obj b/src/UAV_UI_new/x64/Debug/UAV_UI_new.obj new file mode 100644 index 0000000..9f466a6 Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/UAV_UI_new.obj differ diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/CL.command.1.tlog b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/CL.command.1.tlog new file mode 100644 index 0000000..e97be9f Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/CL.command.1.tlog differ diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/CL.read.1.tlog b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/CL.read.1.tlog new file mode 100644 index 0000000..881c6bb Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/CL.read.1.tlog differ diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/CL.write.1.tlog b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/CL.write.1.tlog new file mode 100644 index 0000000..d49d6d4 Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/CL.write.1.tlog differ diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/UAV_UI_new.lastbuildstate b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/UAV_UI_new.lastbuildstate new file mode 100644 index 0000000..f65e5b7 --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/UAV_UI_new.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.35.32215:TargetPlatformVersion=10.0.22000.0: +Debug|x64|D:\software\UAV_UI\UAV_UI_new\| diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/UAV_UI_new.write.1u.tlog b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/UAV_UI_new.write.1u.tlog new file mode 100644 index 0000000..1a141a6 Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/UAV_UI_new.write.1u.tlog differ diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/link.command.1.tlog b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/link.command.1.tlog new file mode 100644 index 0000000..6d41591 Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/link.command.1.tlog differ diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/link.read.1.tlog b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/link.read.1.tlog new file mode 100644 index 0000000..1bf600d Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/link.read.1.tlog differ diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/link.write.1.tlog b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/link.write.1.tlog new file mode 100644 index 0000000..2ad725f Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/link.write.1.tlog differ diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/moc.read.1u.tlog b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/moc.read.1u.tlog new file mode 100644 index 0000000..312dafb Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/moc.read.1u.tlog differ diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/moc.write.1u.tlog b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/moc.write.1u.tlog new file mode 100644 index 0000000..30e11a1 Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/moc.write.1u.tlog differ diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/rc.command.1.tlog b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/rc.command.1.tlog new file mode 100644 index 0000000..307e42d Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/rc.command.1.tlog differ diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/rc.read.1.tlog b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/rc.read.1.tlog new file mode 100644 index 0000000..8faf967 Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/rc.read.1.tlog differ diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/rc.write.1.tlog b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/rc.write.1.tlog new file mode 100644 index 0000000..0be9912 Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/rc.write.1.tlog differ diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/rcc.read.1u.tlog b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/rcc.read.1u.tlog new file mode 100644 index 0000000..5353ee1 Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/rcc.read.1u.tlog differ diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/rcc.write.1u.tlog b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/rcc.write.1u.tlog new file mode 100644 index 0000000..678d686 Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/rcc.write.1u.tlog differ diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/uic.read.1u.tlog b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/uic.read.1u.tlog new file mode 100644 index 0000000..afa22ab Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/uic.read.1u.tlog differ diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/uic.write.1u.tlog b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/uic.write.1u.tlog new file mode 100644 index 0000000..fcbeb9d Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/UAV_UI_new.tlog/uic.write.1u.tlog differ diff --git a/doc/try.txt b/src/UAV_UI_new/x64/Debug/UAV_UI_new.vcxproj.FileListAbsolute.txt similarity index 100% rename from doc/try.txt rename to src/UAV_UI_new/x64/Debug/UAV_UI_new.vcxproj.FileListAbsolute.txt diff --git a/src/UAV_UI_new/x64/Debug/UAV_UI_new1.res b/src/UAV_UI_new/x64/Debug/UAV_UI_new1.res new file mode 100644 index 0000000..36f26e2 Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/UAV_UI_new1.res differ diff --git a/src/UAV_UI_new/x64/Debug/main.obj b/src/UAV_UI_new/x64/Debug/main.obj new file mode 100644 index 0000000..17ba47c Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/main.obj differ diff --git a/src/UAV_UI_new/x64/Debug/moc/moc_Setting.cpp b/src/UAV_UI_new/x64/Debug/moc/moc_Setting.cpp new file mode 100644 index 0000000..883888d --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/moc/moc_Setting.cpp @@ -0,0 +1,123 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'Setting.h' +** +** Created by: The Qt Meta Object Compiler version 68 (Qt 6.2.4) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include +#include "../../../Setting.h" +#include +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'Setting.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 68 +#error "This file was generated using the moc from 6.2.4. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_Setting_t { + const uint offsetsAndSize[6]; + char stringdata0[28]; +}; +#define QT_MOC_LITERAL(ofs, len) \ + uint(offsetof(qt_meta_stringdata_Setting_t, stringdata0) + ofs), len +static const qt_meta_stringdata_Setting_t qt_meta_stringdata_Setting = { + { +QT_MOC_LITERAL(0, 7), // "Setting" +QT_MOC_LITERAL(8, 18), // "on_finished_button" +QT_MOC_LITERAL(27, 0) // "" + + }, + "Setting\0on_finished_button\0" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_Setting[] = { + + // content: + 10, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: name, argc, parameters, tag, flags, initial metatype offsets + 1, 0, 20, 2, 0x08, 1 /* Private */, + + // slots: parameters + QMetaType::Void, + + 0 // eod +}; + +void Setting::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + (void)_t; + switch (_id) { + case 0: _t->on_finished_button(); break; + default: ; + } + } + (void)_a; +} + +const QMetaObject Setting::staticMetaObject = { { + QMetaObject::SuperData::link(), + qt_meta_stringdata_Setting.offsetsAndSize, + qt_meta_data_Setting, + qt_static_metacall, + nullptr, +qt_incomplete_metaTypeArray +, QtPrivate::TypeAndForceComplete + + +>, + nullptr +} }; + + +const QMetaObject *Setting::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *Setting::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_Setting.stringdata0)) + return static_cast(this); + return QMainWindow::qt_metacast(_clname); +} + +int Setting::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QMainWindow::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = QMetaType(); + _id -= 1; + } + return _id; +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/src/UAV_UI_new/x64/Debug/moc/moc_UAV_UI_new.cpp b/src/UAV_UI_new/x64/Debug/moc/moc_UAV_UI_new.cpp new file mode 100644 index 0000000..f40463d --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/moc/moc_UAV_UI_new.cpp @@ -0,0 +1,141 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'UAV_UI_new.h' +** +** Created by: The Qt Meta Object Compiler version 68 (Qt 6.2.4) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include +#include "../../../UAV_UI_new.h" +#include +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'UAV_UI_new.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 68 +#error "This file was generated using the moc from 6.2.4. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_UAV_UI_new_t { + const uint offsetsAndSize[14]; + char stringdata0[100]; +}; +#define QT_MOC_LITERAL(ofs, len) \ + uint(offsetof(qt_meta_stringdata_UAV_UI_new_t, stringdata0) + ofs), len +static const qt_meta_stringdata_UAV_UI_new_t qt_meta_stringdata_UAV_UI_new = { + { +QT_MOC_LITERAL(0, 10), // "UAV_UI_new" +QT_MOC_LITERAL(11, 20), // "on_connection_button" +QT_MOC_LITERAL(32, 0), // "" +QT_MOC_LITERAL(33, 14), // "on_stop_button" +QT_MOC_LITERAL(48, 11), // "importImage" +QT_MOC_LITERAL(60, 22), // "onclick_Setting_button" +QT_MOC_LITERAL(83, 16) // "on_action_button" + + }, + "UAV_UI_new\0on_connection_button\0\0" + "on_stop_button\0importImage\0" + "onclick_Setting_button\0on_action_button" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_UAV_UI_new[] = { + + // content: + 10, // revision + 0, // classname + 0, 0, // classinfo + 5, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: name, argc, parameters, tag, flags, initial metatype offsets + 1, 0, 44, 2, 0x08, 1 /* Private */, + 3, 0, 45, 2, 0x08, 2 /* Private */, + 4, 0, 46, 2, 0x08, 3 /* Private */, + 5, 0, 47, 2, 0x08, 4 /* Private */, + 6, 0, 48, 2, 0x08, 5 /* Private */, + + // slots: parameters + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + + 0 // eod +}; + +void UAV_UI_new::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + auto *_t = static_cast(_o); + (void)_t; + switch (_id) { + case 0: _t->on_connection_button(); break; + case 1: _t->on_stop_button(); break; + case 2: _t->importImage(); break; + case 3: _t->onclick_Setting_button(); break; + case 4: _t->on_action_button(); break; + default: ; + } + } + (void)_a; +} + +const QMetaObject UAV_UI_new::staticMetaObject = { { + QMetaObject::SuperData::link(), + qt_meta_stringdata_UAV_UI_new.offsetsAndSize, + qt_meta_data_UAV_UI_new, + qt_static_metacall, + nullptr, +qt_incomplete_metaTypeArray +, QtPrivate::TypeAndForceComplete, QtPrivate::TypeAndForceComplete, QtPrivate::TypeAndForceComplete, QtPrivate::TypeAndForceComplete, QtPrivate::TypeAndForceComplete + + +>, + nullptr +} }; + + +const QMetaObject *UAV_UI_new::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *UAV_UI_new::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_UAV_UI_new.stringdata0)) + return static_cast(this); + return QMainWindow::qt_metacast(_clname); +} + +int UAV_UI_new::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QMainWindow::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 5) + qt_static_metacall(this, _c, _id, _a); + _id -= 5; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 5) + *reinterpret_cast(_a[0]) = QMetaType(); + _id -= 5; + } + return _id; +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/src/UAV_UI_new/x64/Debug/moc/moc_tips.cpp b/src/UAV_UI_new/x64/Debug/moc/moc_tips.cpp new file mode 100644 index 0000000..f742264 --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/moc/moc_tips.cpp @@ -0,0 +1,98 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'tips.h' +** +** Created by: The Qt Meta Object Compiler version 68 (Qt 6.2.4) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include +#include "../../../tips.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'tips.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 68 +#error "This file was generated using the moc from 6.2.4. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_tips_t { + const uint offsetsAndSize[2]; + char stringdata0[5]; +}; +#define QT_MOC_LITERAL(ofs, len) \ + uint(offsetof(qt_meta_stringdata_tips_t, stringdata0) + ofs), len +static const qt_meta_stringdata_tips_t qt_meta_stringdata_tips = { + { +QT_MOC_LITERAL(0, 4) // "tips" + + }, + "tips" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_tips[] = { + + // content: + 10, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void tips::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + (void)_o; + (void)_id; + (void)_c; + (void)_a; +} + +const QMetaObject tips::staticMetaObject = { { + QMetaObject::SuperData::link(), + qt_meta_stringdata_tips.offsetsAndSize, + qt_meta_data_tips, + qt_static_metacall, + nullptr, +qt_incomplete_metaTypeArray + + + +>, + nullptr +} }; + + +const QMetaObject *tips::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *tips::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_tips.stringdata0)) + return static_cast(this); + return QMainWindow::qt_metacast(_clname); +} + +int tips::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QMainWindow::qt_metacall(_c, _id, _a); + return _id; +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/src/UAV_UI_new/x64/Debug/moc_Setting.obj b/src/UAV_UI_new/x64/Debug/moc_Setting.obj new file mode 100644 index 0000000..d06391e Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/moc_Setting.obj differ diff --git a/src/UAV_UI_new/x64/Debug/moc_UAV_UI_new.obj b/src/UAV_UI_new/x64/Debug/moc_UAV_UI_new.obj new file mode 100644 index 0000000..8ace37d Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/moc_UAV_UI_new.obj differ diff --git a/src/UAV_UI_new/x64/Debug/moc_tips.obj b/src/UAV_UI_new/x64/Debug/moc_tips.obj new file mode 100644 index 0000000..95b1f6c Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/moc_tips.obj differ diff --git a/src/UAV_UI_new/x64/Debug/qmake/qtvars_x64_Debug.props b/src/UAV_UI_new/x64/Debug/qmake/qtvars_x64_Debug.props new file mode 100644 index 0000000..4fa74e1 --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/qmake/qtvars_x64_Debug.props @@ -0,0 +1,60 @@ + + +_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;QT_WIDGETS_LIB;QT_GUI_LIB;QT_NETWORK_LIB;QT_CORE_LIB +C:\Users\87334\AppData\Local\Temp\uu20lcg5.zbl;D:\QT111\6.2.4\msvc2019_64\include;D:\QT111\6.2.4\msvc2019_64\include\QtWidgets;D:\QT111\6.2.4\msvc2019_64\include\QtGui;D:\QT111\6.2.4\msvc2019_64\include\QtNetwork;D:\QT111\6.2.4\msvc2019_64\include\QtCore;C:\Users\87334\AppData\Local\Temp\uu20lcg5.zbl;/include;D:\QT111\6.2.4\msvc2019_64\mkspecs\win32-msvc +stdcpp17 +MultiThreadedDebugDLL +-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -utf-8 +D:\QT111\6.2.4\msvc2019_64\lib\Qt6Widgetsd.lib;D:\QT111\6.2.4\msvc2019_64\lib\Qt6Guid.lib;D:\QT111\6.2.4\msvc2019_64\lib\Qt6Networkd.lib;D:\QT111\6.2.4\msvc2019_64\lib\Qt6Cored.lib;D:\QT111\6.2.4\msvc2019_64\lib\Qt6EntryPointd.lib;shell32.lib +"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" + +D:/QT111/6.2.4/msvc2019_64 +D:/QT111/6.2.4/msvc2019_64 +D:/QT111/6.2.4/msvc2019_64 +D:/QT111/Docs/Qt-6.2.4 +D:/QT111/6.2.4/msvc2019_64/include +D:/QT111/6.2.4/msvc2019_64/lib +D:/QT111/6.2.4/msvc2019_64/bin +D:/QT111/6.2.4/msvc2019_64/bin +D:/QT111/6.2.4/msvc2019_64/tests +D:/QT111/6.2.4/msvc2019_64/plugins +D:/QT111/6.2.4/msvc2019_64/qml +D:/QT111/6.2.4/msvc2019_64/translations + +D:/QT111/Examples/Qt-6.2.4 +D:/QT111/Examples/Qt-6.2.4 +D:/QT111/6.2.4/msvc2019_64 +D:/QT111/6.2.4/msvc2019_64 +D:/QT111/6.2.4/msvc2019_64/bin +D:/QT111/6.2.4/msvc2019_64/bin +D:/QT111/6.2.4/msvc2019_64/lib +win32-msvc +win32-msvc +3.1 +6.2.4 +$(Qt_INCLUDEPATH_);x64\Debug\moc;x64\Debug\uic + 6.2.4 + core;gui;network;widgets + bin + bin + + + DEFINES=/Project/ItemDefinitionGroup/ClCompile/PreprocessorDefinitions;INCLUDEPATH=/Project/ItemDefinitionGroup/ClCompile/AdditionalIncludeDirectories;STDCPP=/Project/ItemDefinitionGroup/ClCompile/LanguageStandard;RUNTIME=/Project/ItemDefinitionGroup/ClCompile/RuntimeLibrary;CL_OPTIONS=/Project/ItemDefinitionGroup/ClCompile/AdditionalOptions;LIBS=/Project/ItemDefinitionGroup/Link/AdditionalDependencies;LINK_OPTIONS=/Project/ItemDefinitionGroup/Link/AdditionalOptions + + debug + 6.2.4 + 6 + 2 + 4 + + diff --git a/src/UAV_UI_new/x64/Debug/qmake/temp/.qmake.stash b/src/UAV_UI_new/x64/Debug/qmake/temp/.qmake.stash new file mode 100644 index 0000000..bf32b6a --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/qmake/temp/.qmake.stash @@ -0,0 +1,7 @@ +QMAKE_CXX.QT_COMPILER_STDCXX = 199711L +QMAKE_CXX.QMAKE_MSC_VER = 1935 +QMAKE_CXX.QMAKE_MSC_FULL_VER = 193532216 +QMAKE_CXX.COMPILER_MACROS = \ + QT_COMPILER_STDCXX \ + QMAKE_MSC_VER \ + QMAKE_MSC_FULL_VER diff --git a/src/UAV_UI_new/x64/Debug/qmake/temp/FB496CF3-A3CE-4A50-BAC4-A9F43A71A5F9.UAV_UI_new.designtime.idx b/src/UAV_UI_new/x64/Debug/qmake/temp/FB496CF3-A3CE-4A50-BAC4-A9F43A71A5F9.UAV_UI_new.designtime.idx new file mode 100644 index 0000000..1ae58f7 --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/qmake/temp/FB496CF3-A3CE-4A50-BAC4-A9F43A71A5F9.UAV_UI_new.designtime.idx @@ -0,0 +1 @@ +C:\Users\87334\AppData\Local\Temp\iu4xqqk1.ygq.designtime.props diff --git a/src/UAV_UI_new/x64/Debug/qmake/temp/moc_predefs.h.cbt b/src/UAV_UI_new/x64/Debug/qmake/temp/moc_predefs.h.cbt new file mode 100644 index 0000000..693383c --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/qmake/temp/moc_predefs.h.cbt @@ -0,0 +1 @@ +This is a dummy file needed to create ./moc_predefs.h diff --git a/src/UAV_UI_new/x64/Debug/qmake/temp/props.txt b/src/UAV_UI_new/x64/Debug/qmake/temp/props.txt new file mode 100644 index 0000000..28af2d3 --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/qmake/temp/props.txt @@ -0,0 +1,25 @@ +QT_SYSROOT: +QT_INSTALL_PREFIX:D:/QT111/6.2.4/msvc2019_64 +QT_INSTALL_ARCHDATA:D:/QT111/6.2.4/msvc2019_64 +QT_INSTALL_DATA:D:/QT111/6.2.4/msvc2019_64 +QT_INSTALL_DOCS:D:/QT111/Docs/Qt-6.2.4 +QT_INSTALL_HEADERS:D:/QT111/6.2.4/msvc2019_64/include +QT_INSTALL_LIBS:D:/QT111/6.2.4/msvc2019_64/lib +QT_INSTALL_LIBEXECS:D:/QT111/6.2.4/msvc2019_64/bin +QT_INSTALL_BINS:D:/QT111/6.2.4/msvc2019_64/bin +QT_INSTALL_TESTS:D:/QT111/6.2.4/msvc2019_64/tests +QT_INSTALL_PLUGINS:D:/QT111/6.2.4/msvc2019_64/plugins +QT_INSTALL_QML:D:/QT111/6.2.4/msvc2019_64/qml +QT_INSTALL_TRANSLATIONS:D:/QT111/6.2.4/msvc2019_64/translations +QT_INSTALL_CONFIGURATION: +QT_INSTALL_EXAMPLES:D:/QT111/Examples/Qt-6.2.4 +QT_INSTALL_DEMOS:D:/QT111/Examples/Qt-6.2.4 +QT_HOST_PREFIX:D:/QT111/6.2.4/msvc2019_64 +QT_HOST_DATA:D:/QT111/6.2.4/msvc2019_64 +QT_HOST_BINS:D:/QT111/6.2.4/msvc2019_64/bin +QT_HOST_LIBEXECS:D:/QT111/6.2.4/msvc2019_64/bin +QT_HOST_LIBS:D:/QT111/6.2.4/msvc2019_64/lib +QMAKE_SPEC:win32-msvc +QMAKE_XSPEC:win32-msvc +QMAKE_VERSION:3.1 +QT_VERSION:6.2.4 diff --git a/src/UAV_UI_new/x64/Debug/qmake/temp/qtvars.log b/src/UAV_UI_new/x64/Debug/qmake/temp/qtvars.log new file mode 100644 index 0000000..7a46a5e --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/qmake/temp/qtvars.log @@ -0,0 +1 @@ +Info: creating stash file C:\Users\87334\AppData\Local\Temp\uu20lcg5.zbl\.qmake.stash diff --git a/src/UAV_UI_new/x64/Debug/qmake/temp/qtvars.pro b/src/UAV_UI_new/x64/Debug/qmake/temp/qtvars.pro new file mode 100644 index 0000000..8f15ce0 --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/qmake/temp/qtvars.pro @@ -0,0 +1,2 @@ +CONFIG += no_fixpath +QT += core gui network widgets diff --git a/src/UAV_UI_new/x64/Debug/qmake/temp/qtvars.vcxproj b/src/UAV_UI_new/x64/Debug/qmake/temp/qtvars.vcxproj new file mode 100644 index 0000000..dea8d7a --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/qmake/temp/qtvars.vcxproj @@ -0,0 +1,83 @@ + + + + + Debug + x64 + + + + + qtvars + Qt4VSv1.0 + + + + v143 + .\ + false + NotSet + Application + qtvars + + + + + + + + + .\ + qtvars + true + + + + C:\Users\87334\AppData\Local\Temp\uu20lcg5.zbl;D:\QT111\6.2.4\msvc2019_64\include;D:\QT111\6.2.4\msvc2019_64\include\QtWidgets;D:\QT111\6.2.4\msvc2019_64\include\QtGui;D:\QT111\6.2.4\msvc2019_64\include\QtNetwork;D:\QT111\6.2.4\msvc2019_64\include\QtCore;C:\Users\87334\AppData\Local\Temp\uu20lcg5.zbl;/include;D:\QT111\6.2.4\msvc2019_64\mkspecs\win32-msvc;%(AdditionalIncludeDirectories) + -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -utf-8 %(AdditionalOptions) + .\ + false + ProgramDatabase + Sync + stdcpp17 + .\ + Disabled + _WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;QT_WIDGETS_LIB;QT_GUI_LIB;QT_NETWORK_LIB;QT_CORE_LIB;%(PreprocessorDefinitions) + false + MultiThreadedDebugDLL + true + true + TurnOffAllWarnings + + + D:\QT111\6.2.4\msvc2019_64\lib\Qt6Widgetsd.lib;D:\QT111\6.2.4\msvc2019_64\lib\Qt6Guid.lib;D:\QT111\6.2.4\msvc2019_64\lib\Qt6Networkd.lib;D:\QT111\6.2.4\msvc2019_64\lib\Qt6Cored.lib;D:\QT111\6.2.4\msvc2019_64\lib\Qt6EntryPointd.lib;shell32.lib;%(AdditionalDependencies) + "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions) + true + true + true + $(OutDir)\qtvars.exe + true + Windows + true + + + Unsigned + None + 0 + + + _WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;QT_WIDGETS_LIB;QT_GUI_LIB;QT_NETWORK_LIB;QT_CORE_LIB;_DEBUG;%(PreprocessorDefinitions) + + + + + Document + D:\QT111\6.2.4\msvc2019_64\mkspecs\features\data\dummy.cpp;%(AdditionalInputs) + cl -BxD:\QT111\6.2.4\msvc2019_64\bin\qmake.exe -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -Zi -MDd -std:c++17 -utf-8 -W0 -E D:\QT111\6.2.4\msvc2019_64\mkspecs\features\data\dummy.cpp 2>NUL >moc_predefs.h + Generate moc_predefs.h + moc_predefs.h;%(Outputs) + + + + + \ No newline at end of file diff --git a/src/UAV_UI_new/x64/Debug/qmake/temp/qtvars.vcxproj.filters b/src/UAV_UI_new/x64/Debug/qmake/temp/qtvars.vcxproj.filters new file mode 100644 index 0000000..a5e61b7 --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/qmake/temp/qtvars.vcxproj.filters @@ -0,0 +1,14 @@ + + + + + {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} + cpp;c;cxx;moc;h;def;odl;idl;res; + + + + + Generated Files + + + \ No newline at end of file diff --git a/src/UAV_UI_new/x64/Debug/qmake/temp/qtvars_x64_Debug.props b/src/UAV_UI_new/x64/Debug/qmake/temp/qtvars_x64_Debug.props new file mode 100644 index 0000000..4fa74e1 --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/qmake/temp/qtvars_x64_Debug.props @@ -0,0 +1,60 @@ + + +_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;QT_WIDGETS_LIB;QT_GUI_LIB;QT_NETWORK_LIB;QT_CORE_LIB +C:\Users\87334\AppData\Local\Temp\uu20lcg5.zbl;D:\QT111\6.2.4\msvc2019_64\include;D:\QT111\6.2.4\msvc2019_64\include\QtWidgets;D:\QT111\6.2.4\msvc2019_64\include\QtGui;D:\QT111\6.2.4\msvc2019_64\include\QtNetwork;D:\QT111\6.2.4\msvc2019_64\include\QtCore;C:\Users\87334\AppData\Local\Temp\uu20lcg5.zbl;/include;D:\QT111\6.2.4\msvc2019_64\mkspecs\win32-msvc +stdcpp17 +MultiThreadedDebugDLL +-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -utf-8 +D:\QT111\6.2.4\msvc2019_64\lib\Qt6Widgetsd.lib;D:\QT111\6.2.4\msvc2019_64\lib\Qt6Guid.lib;D:\QT111\6.2.4\msvc2019_64\lib\Qt6Networkd.lib;D:\QT111\6.2.4\msvc2019_64\lib\Qt6Cored.lib;D:\QT111\6.2.4\msvc2019_64\lib\Qt6EntryPointd.lib;shell32.lib +"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" + +D:/QT111/6.2.4/msvc2019_64 +D:/QT111/6.2.4/msvc2019_64 +D:/QT111/6.2.4/msvc2019_64 +D:/QT111/Docs/Qt-6.2.4 +D:/QT111/6.2.4/msvc2019_64/include +D:/QT111/6.2.4/msvc2019_64/lib +D:/QT111/6.2.4/msvc2019_64/bin +D:/QT111/6.2.4/msvc2019_64/bin +D:/QT111/6.2.4/msvc2019_64/tests +D:/QT111/6.2.4/msvc2019_64/plugins +D:/QT111/6.2.4/msvc2019_64/qml +D:/QT111/6.2.4/msvc2019_64/translations + +D:/QT111/Examples/Qt-6.2.4 +D:/QT111/Examples/Qt-6.2.4 +D:/QT111/6.2.4/msvc2019_64 +D:/QT111/6.2.4/msvc2019_64 +D:/QT111/6.2.4/msvc2019_64/bin +D:/QT111/6.2.4/msvc2019_64/bin +D:/QT111/6.2.4/msvc2019_64/lib +win32-msvc +win32-msvc +3.1 +6.2.4 +$(Qt_INCLUDEPATH_);x64\Debug\moc;x64\Debug\uic + 6.2.4 + core;gui;network;widgets + bin + bin + + + DEFINES=/Project/ItemDefinitionGroup/ClCompile/PreprocessorDefinitions;INCLUDEPATH=/Project/ItemDefinitionGroup/ClCompile/AdditionalIncludeDirectories;STDCPP=/Project/ItemDefinitionGroup/ClCompile/LanguageStandard;RUNTIME=/Project/ItemDefinitionGroup/ClCompile/RuntimeLibrary;CL_OPTIONS=/Project/ItemDefinitionGroup/ClCompile/AdditionalOptions;LIBS=/Project/ItemDefinitionGroup/Link/AdditionalDependencies;LINK_OPTIONS=/Project/ItemDefinitionGroup/Link/AdditionalOptions + + debug + 6.2.4 + 6 + 2 + 4 + + diff --git a/src/UAV_UI_new/x64/Debug/qrc_UAV_UI_new.obj b/src/UAV_UI_new/x64/Debug/qrc_UAV_UI_new.obj new file mode 100644 index 0000000..1ad6483 Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/qrc_UAV_UI_new.obj differ diff --git a/src/UAV_UI_new/x64/Debug/qt.natvis b/src/UAV_UI_new/x64/Debug/qt.natvis new file mode 100644 index 0000000..aa113f7 --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/qt.natvis @@ -0,0 +1,449 @@ + + + + + + + {val} + + val + + + + + + + + {{ x = {x,g}, y = {y,g}, z = {_extraData().z,g}, width = {width,g}, height = {height,g} }} + {{ x = {x,g}, y = {y,g}, width = {width,g}, height = {height,g} }} + + x + y + _extraData().z + _extraData().scale + _extraData().rotation + _extraData().opacity + width + height + implicitWidth + implicitHeight + effectiveVisible + explicitEnable + _objectName(),na + parentItem + childItems, nr + + + + + {d_ptr.d,na} + + d_ptr.d + + + + + {{{data1,Xb}-{data2,Xb}-{data3,Xb}-{(data4[0]),nvoXb}{(data4[1]),nvoXb}-{(data4[2]),nvoXb}{(data4[3]),nvoXb}{(data4[4]),nvoXb}{(data4[5]),nvoXb}{(data4[6]),nvoXb}{(data4[7]),nvoXb}}} + + + + {val} + + val + + + + + {_q_value} + + _q_value + + + + + + + empty + {_q_value} + + *value() + + + + + + {{ x = {xp}, y = {yp} }} + + xp + yp + + + + + {{ x = {x1}, y = {y1}, width = {x2 - x1 + 1}, height = {y2 - y1 + 1} }} + + x1 + y1 + x2 - x1 + 1 + y2 - y1 + 1 + + + + + {{ x = {xp}, y = {yp}, width = {w}, height = {h} }} + + xp + yp + w + h + + + + + + {{ width = {wd}, height = {ht} }} + + wd + ht + + + + + + {{ start point = {pt1}, end point = {pt2} }} + + + {pt1} + + pt1 + + + + {pt2} + + pt2 + + + + + + + + {{ size={d->size} }} + + d->ref.atomic._q_value + + d->size + (QPoint*)((reinterpret_cast<char*>(d)) + d->offset) + + + + + + {{ size={d->size} }} + + + d->size > 0 + && ((((QPointF*)((reinterpret_cast<char*>(d)) + d->offset)[0]).xp + == (((QPointF*)((reinterpret_cast<char*>(d)) + d->offset)[d->size - 1]).xp) + && ((((QPointF*)((reinterpret_cast<char*>(d)) + d->offset)[0]).yp + == (((QPointF*)((reinterpret_cast<char*>(d)) + d->offset)[d->size - 1]).yp) + + d->ref.atomic._q_value + + d->size + (QPointF*)((reinterpret_cast<char*>(d)) + d->offset) + + + + + + {{ x = {xp}, y = {yp} }} + + xp + yp + + + + + {{ x = {xp}, y = {yp}, z = {zp} }} + + xp + yp + zp + + + + + {{ x = {xp}, y = {yp}, z = {zp}, w = {wp} }} + + xp + yp + zp + wp + + + + + + {{ m11 = {_m11}, m12 = {_m12}, m21 = {_m21}, m22 = {_m22}, ... }} + + + _m11 + _m12 + _m21 + _m22 + _dx + _dy + + + + + + {{ m11 = {m[0][0]}, m12 = {m[1][0]}, m13 = {m[2][0]}, m14 = {m[3][0]}, ... }} + + + m[0][0] + m[1][0] + m[2][0] + m[3][0] + m[0][1] + m[1][1] + m[2][1] + m[3][1] + m[0][2] + m[1][2] + m[2][2] + m[3][2] + m[0][3] + m[1][3] + m[2][3] + m[3][3] + + + + + + {{ horizontal = {static_cast<Policy>(bits.horPolicy)}, vertical = {static_cast<Policy>(bits.verPolicy)}, type = {ControlType(1 << bits.ctype)} }} + + + + QSizePolicy::Policy::{static_cast<Policy>(bits.verPolicy)} + + + QSizePolicy::Policy::{static_cast<Policy>(bits.horPolicy)} + + + QSizePolicy::ControlType::{ControlType(1 << bits.ctype)} + + + + Qt::Vertical (2) + + + Qt::Horizontal (1) + + + static_cast<int>(bits.verStretch) + static_cast<int>(bits.horStretch) + bits.hfw == 1 + bits.wfh == 1 + + + + + {ucs,c} + ucs,c + + ucs > 0xff ? '\0' : char(ucs),c + ucs,c + + + + + "{(reinterpret_cast<unsigned short*>(d.ptr)),sub}" + (reinterpret_cast<unsigned short*>(d.ptr)),sub + + d.size + + d.size + d.ptr + + + + + + {m_string,[m_size]} u"" + {m_string->d.ptr+m_position,[m_size]} + "" + m_string,[m_position+m_size] + + m_position + m_size + + m_size + m_string->d.ptr+m_position + + + + + + {m_data,[m_size]} + m_data,[m_size] + + m_size + + m_size + m_data + + + + + + "{((reinterpret_cast<char*>(d.ptr))),sb}" + ((reinterpret_cast<char*>(d.ptr))),sb + + d.size + + d.size + d.ptr + + + + + + + + + + + + + + + + + + + + {scheme()}://{host()}{path()} + {path()} + + scheme() + username() + password() + host() + path() + query() + fragment() + + + + + {{ julian day = {jd} }} + + + + + + + + {{ millisecond = {mds} }} + {{ milliseconds = {mds} }} + + hour(), d + hour(), d + minute(), d + minute(), d + second(), d + second(), d + millisecond(), d + millisecond(), d + + + + + ({first}, {second}) + + first + second + + + + + + {{ size={d.size} }} + + + d.size + reinterpret_cast<$T1*>(d.ptr) + + + + + + {{ size={s} }} + + a + + s + ptr + + + + + + + {{ size={d.d->m._Mypair._Myval2._Myval2._Mysize} }} + + d.d->m + + + + + + {{ size = {d->size} }} + + d->ref.atomic._q_value + + + + diff --git a/src/UAV_UI_new/x64/Debug/qt_work.log b/src/UAV_UI_new/x64/Debug/qt_work.log new file mode 100644 index 0000000..d21c883 Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/qt_work.log differ diff --git a/src/UAV_UI_new/x64/Debug/rcc/qrc_UAV_UI_new.cpp b/src/UAV_UI_new/x64/Debug/rcc/qrc_UAV_UI_new.cpp new file mode 100644 index 0000000..a4fc318 --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/rcc/qrc_UAV_UI_new.cpp @@ -0,0 +1,46 @@ +/**************************************************************************** +** Resource object code +** +** Created by: The Resource Compiler for Qt version 6.2.4 +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#ifdef QT_NAMESPACE +# define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name +# define QT_RCC_MANGLE_NAMESPACE0(x) x +# define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b +# define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b) +# define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \ + QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE)) +#else +# define QT_RCC_PREPEND_NAMESPACE(name) name +# define QT_RCC_MANGLE_NAMESPACE(name) name +#endif + +#ifdef QT_NAMESPACE +namespace QT_NAMESPACE { +#endif + +#ifdef QT_NAMESPACE +} +#endif + +int QT_RCC_MANGLE_NAMESPACE(qInitResources_UAV_UI_new)(); +int QT_RCC_MANGLE_NAMESPACE(qInitResources_UAV_UI_new)() +{ + return 1; +} + +int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_UAV_UI_new)(); +int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_UAV_UI_new)() +{ + return 1; +} + +namespace { + struct initializer { + initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources_UAV_UI_new)(); } + ~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources_UAV_UI_new)(); } + } dummy; +} diff --git a/src/UAV_UI_new/x64/Debug/tips.obj b/src/UAV_UI_new/x64/Debug/tips.obj new file mode 100644 index 0000000..e065cee Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/tips.obj differ diff --git a/src/UAV_UI_new/x64/Debug/uic/ui_Setting.h b/src/UAV_UI_new/x64/Debug/uic/ui_Setting.h new file mode 100644 index 0000000..f60a872 --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/uic/ui_Setting.h @@ -0,0 +1,173 @@ +/******************************************************************************** +** Form generated from reading UI file 'Setting.ui' +** +** Created by: Qt User Interface Compiler version 6.2.4 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_SETTING_H +#define UI_SETTING_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_SettingClass +{ +public: + QWidget *centralWidget; + QWidget *gridLayoutWidget; + QGridLayout *gridLayout; + QLabel *Start_Timer; + QLineEdit *seconds; + QLineEdit *hours; + QLineEdit *longitude; + QLineEdit *minutes; + QLineEdit *latitude; + QLabel *Speed_Lable; + QLabel *label; + QLineEdit *x; + QLineEdit *y; + QLineEdit *z; + QPushButton *finished; + QMenuBar *menuBar; + QToolBar *mainToolBar; + QStatusBar *statusBar; + + void setupUi(QMainWindow *SettingClass) + { + if (SettingClass->objectName().isEmpty()) + SettingClass->setObjectName(QString::fromUtf8("SettingClass")); + SettingClass->resize(871, 571); + centralWidget = new QWidget(SettingClass); + centralWidget->setObjectName(QString::fromUtf8("centralWidget")); + gridLayoutWidget = new QWidget(centralWidget); + gridLayoutWidget->setObjectName(QString::fromUtf8("gridLayoutWidget")); + gridLayoutWidget->setGeometry(QRect(20, 20, 451, 241)); + gridLayout = new QGridLayout(gridLayoutWidget); + gridLayout->setSpacing(6); + gridLayout->setContentsMargins(11, 11, 11, 11); + gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setContentsMargins(0, 0, 0, 0); + Start_Timer = new QLabel(gridLayoutWidget); + Start_Timer->setObjectName(QString::fromUtf8("Start_Timer")); + + gridLayout->addWidget(Start_Timer, 2, 0, 1, 1); + + seconds = new QLineEdit(gridLayoutWidget); + seconds->setObjectName(QString::fromUtf8("seconds")); + seconds->setMaximumSize(QSize(150, 16777215)); + + gridLayout->addWidget(seconds, 2, 3, 1, 1); + + hours = new QLineEdit(gridLayoutWidget); + hours->setObjectName(QString::fromUtf8("hours")); + hours->setMaximumSize(QSize(150, 16777215)); + + gridLayout->addWidget(hours, 2, 1, 1, 1); + + longitude = new QLineEdit(gridLayoutWidget); + longitude->setObjectName(QString::fromUtf8("longitude")); + longitude->setMaximumSize(QSize(150, 16777215)); + + gridLayout->addWidget(longitude, 0, 1, 1, 1); + + minutes = new QLineEdit(gridLayoutWidget); + minutes->setObjectName(QString::fromUtf8("minutes")); + minutes->setMaximumSize(QSize(150, 16777215)); + + gridLayout->addWidget(minutes, 2, 2, 1, 1); + + latitude = new QLineEdit(gridLayoutWidget); + latitude->setObjectName(QString::fromUtf8("latitude")); + latitude->setMaximumSize(QSize(150, 16777215)); + + gridLayout->addWidget(latitude, 0, 2, 1, 1); + + Speed_Lable = new QLabel(gridLayoutWidget); + Speed_Lable->setObjectName(QString::fromUtf8("Speed_Lable")); + Speed_Lable->setMaximumSize(QSize(80, 16777215)); + + gridLayout->addWidget(Speed_Lable, 0, 0, 1, 1); + + label = new QLabel(gridLayoutWidget); + label->setObjectName(QString::fromUtf8("label")); + label->setMaximumSize(QSize(16777215, 20)); + + gridLayout->addWidget(label, 1, 0, 1, 1); + + x = new QLineEdit(gridLayoutWidget); + x->setObjectName(QString::fromUtf8("x")); + x->setMaximumSize(QSize(150, 16777215)); + + gridLayout->addWidget(x, 1, 1, 1, 1); + + y = new QLineEdit(gridLayoutWidget); + y->setObjectName(QString::fromUtf8("y")); + y->setMaximumSize(QSize(150, 16777215)); + + gridLayout->addWidget(y, 1, 2, 1, 1); + + z = new QLineEdit(gridLayoutWidget); + z->setObjectName(QString::fromUtf8("z")); + z->setMaximumSize(QSize(150, 16777215)); + + gridLayout->addWidget(z, 1, 3, 1, 1); + + finished = new QPushButton(centralWidget); + finished->setObjectName(QString::fromUtf8("finished")); + finished->setGeometry(QRect(180, 290, 93, 29)); + SettingClass->setCentralWidget(centralWidget); + menuBar = new QMenuBar(SettingClass); + menuBar->setObjectName(QString::fromUtf8("menuBar")); + menuBar->setGeometry(QRect(0, 0, 871, 26)); + SettingClass->setMenuBar(menuBar); + mainToolBar = new QToolBar(SettingClass); + mainToolBar->setObjectName(QString::fromUtf8("mainToolBar")); + SettingClass->addToolBar(Qt::TopToolBarArea, mainToolBar); + statusBar = new QStatusBar(SettingClass); + statusBar->setObjectName(QString::fromUtf8("statusBar")); + SettingClass->setStatusBar(statusBar); + + retranslateUi(SettingClass); + + QMetaObject::connectSlotsByName(SettingClass); + } // setupUi + + void retranslateUi(QMainWindow *SettingClass) + { + SettingClass->setWindowTitle(QCoreApplication::translate("SettingClass", "Setting", nullptr)); + Start_Timer->setText(QCoreApplication::translate("SettingClass", "\345\207\272\345\217\221\346\227\266\351\227\264\357\274\232", nullptr)); + seconds->setPlaceholderText(QCoreApplication::translate("SettingClass", "\347\247\222", nullptr)); + hours->setPlaceholderText(QCoreApplication::translate("SettingClass", "\346\227\266", nullptr)); + longitude->setPlaceholderText(QCoreApplication::translate("SettingClass", "\347\273\217\345\272\246", nullptr)); + minutes->setPlaceholderText(QCoreApplication::translate("SettingClass", "\345\210\206", nullptr)); + latitude->setPlaceholderText(QCoreApplication::translate("SettingClass", "\347\272\254\345\272\246", nullptr)); + Speed_Lable->setText(QCoreApplication::translate("SettingClass", "\347\233\256\347\232\204\345\234\260", nullptr)); + label->setText(QCoreApplication::translate("SettingClass", "x,y,z", nullptr)); + x->setPlaceholderText(QCoreApplication::translate("SettingClass", "0", nullptr)); + y->setPlaceholderText(QCoreApplication::translate("SettingClass", "0", nullptr)); + z->setPlaceholderText(QCoreApplication::translate("SettingClass", "0", nullptr)); + finished->setText(QCoreApplication::translate("SettingClass", "\345\256\214\346\210\220", nullptr)); + } // retranslateUi + +}; + +namespace Ui { + class SettingClass: public Ui_SettingClass {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_SETTING_H diff --git a/src/UAV_UI_new/x64/Debug/uic/ui_UAV_UI_new.h b/src/UAV_UI_new/x64/Debug/uic/ui_UAV_UI_new.h new file mode 100644 index 0000000..f56e66c --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/uic/ui_UAV_UI_new.h @@ -0,0 +1,116 @@ +/******************************************************************************** +** Form generated from reading UI file 'UAV_UI_new.ui' +** +** Created by: Qt User Interface Compiler version 6.2.4 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_UAV_UI_NEW_H +#define UI_UAV_UI_NEW_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_UAV_UI_newClass +{ +public: + QWidget *centralWidget; + QWidget *verticalLayoutWidget; + QVBoxLayout *verticalLayout; + QLabel *display; + QPushButton *stop; + QPushButton *connection; + QLabel *play_tag; + QPushButton *Settings; + QPushButton *action; + QMenuBar *menuBar; + QToolBar *mainToolBar; + QStatusBar *statusBar; + + void setupUi(QMainWindow *UAV_UI_newClass) + { + if (UAV_UI_newClass->objectName().isEmpty()) + UAV_UI_newClass->setObjectName(QString::fromUtf8("UAV_UI_newClass")); + UAV_UI_newClass->resize(1159, 682); + centralWidget = new QWidget(UAV_UI_newClass); + centralWidget->setObjectName(QString::fromUtf8("centralWidget")); + verticalLayoutWidget = new QWidget(centralWidget); + verticalLayoutWidget->setObjectName(QString::fromUtf8("verticalLayoutWidget")); + verticalLayoutWidget->setGeometry(QRect(90, 60, 642, 509)); + verticalLayoutWidget->setMinimumSize(QSize(640, 480)); + verticalLayout = new QVBoxLayout(verticalLayoutWidget); + verticalLayout->setSpacing(6); + verticalLayout->setContentsMargins(11, 11, 11, 11); + verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + verticalLayout->setContentsMargins(0, 0, 0, 0); + display = new QLabel(verticalLayoutWidget); + display->setObjectName(QString::fromUtf8("display")); + display->setEnabled(true); + display->setMinimumSize(QSize(640, 480)); + display->setMaximumSize(QSize(640, 480)); + + verticalLayout->addWidget(display); + + stop = new QPushButton(centralWidget); + stop->setObjectName(QString::fromUtf8("stop")); + stop->setGeometry(QRect(820, 140, 93, 29)); + connection = new QPushButton(centralWidget); + connection->setObjectName(QString::fromUtf8("connection")); + connection->setGeometry(QRect(820, 70, 93, 29)); + play_tag = new QLabel(centralWidget); + play_tag->setObjectName(QString::fromUtf8("play_tag")); + play_tag->setGeometry(QRect(100, 40, 81, 31)); + Settings = new QPushButton(centralWidget); + Settings->setObjectName(QString::fromUtf8("Settings")); + Settings->setGeometry(QRect(1060, 0, 93, 29)); + action = new QPushButton(centralWidget); + action->setObjectName(QString::fromUtf8("action")); + action->setGeometry(QRect(820, 200, 93, 29)); + UAV_UI_newClass->setCentralWidget(centralWidget); + menuBar = new QMenuBar(UAV_UI_newClass); + menuBar->setObjectName(QString::fromUtf8("menuBar")); + menuBar->setGeometry(QRect(0, 0, 1159, 26)); + UAV_UI_newClass->setMenuBar(menuBar); + mainToolBar = new QToolBar(UAV_UI_newClass); + mainToolBar->setObjectName(QString::fromUtf8("mainToolBar")); + UAV_UI_newClass->addToolBar(Qt::TopToolBarArea, mainToolBar); + statusBar = new QStatusBar(UAV_UI_newClass); + statusBar->setObjectName(QString::fromUtf8("statusBar")); + UAV_UI_newClass->setStatusBar(statusBar); + + retranslateUi(UAV_UI_newClass); + + QMetaObject::connectSlotsByName(UAV_UI_newClass); + } // setupUi + + void retranslateUi(QMainWindow *UAV_UI_newClass) + { + UAV_UI_newClass->setWindowTitle(QCoreApplication::translate("UAV_UI_newClass", "UAV_UI_new", nullptr)); + display->setText(QString()); + stop->setText(QCoreApplication::translate("UAV_UI_newClass", "stop", nullptr)); + connection->setText(QCoreApplication::translate("UAV_UI_newClass", "connection", nullptr)); + play_tag->setText(QCoreApplication::translate("UAV_UI_newClass", "\345\233\276\345\203\217\346\222\255\346\224\276\345\244\204", nullptr)); + Settings->setText(QCoreApplication::translate("UAV_UI_newClass", "Settings", nullptr)); + action->setText(QCoreApplication::translate("UAV_UI_newClass", "\345\207\272\350\255\246", nullptr)); + } // retranslateUi + +}; + +namespace Ui { + class UAV_UI_newClass: public Ui_UAV_UI_newClass {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_UAV_UI_NEW_H diff --git a/src/UAV_UI_new/x64/Debug/uic/ui_tips.h b/src/UAV_UI_new/x64/Debug/uic/ui_tips.h new file mode 100644 index 0000000..25b5a0b --- /dev/null +++ b/src/UAV_UI_new/x64/Debug/uic/ui_tips.h @@ -0,0 +1,66 @@ +/******************************************************************************** +** Form generated from reading UI file 'tips.ui' +** +** Created by: Qt User Interface Compiler version 6.2.4 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_TIPS_H +#define UI_TIPS_H + +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_tipsClass +{ +public: + QMenuBar *menuBar; + QToolBar *mainToolBar; + QWidget *centralWidget; + QStatusBar *statusBar; + + void setupUi(QMainWindow *tipsClass) + { + if (tipsClass->objectName().isEmpty()) + tipsClass->setObjectName(QString::fromUtf8("tipsClass")); + tipsClass->resize(600, 400); + menuBar = new QMenuBar(tipsClass); + menuBar->setObjectName(QString::fromUtf8("menuBar")); + tipsClass->setMenuBar(menuBar); + mainToolBar = new QToolBar(tipsClass); + mainToolBar->setObjectName(QString::fromUtf8("mainToolBar")); + tipsClass->addToolBar(mainToolBar); + centralWidget = new QWidget(tipsClass); + centralWidget->setObjectName(QString::fromUtf8("centralWidget")); + tipsClass->setCentralWidget(centralWidget); + statusBar = new QStatusBar(tipsClass); + statusBar->setObjectName(QString::fromUtf8("statusBar")); + tipsClass->setStatusBar(statusBar); + + retranslateUi(tipsClass); + + QMetaObject::connectSlotsByName(tipsClass); + } // setupUi + + void retranslateUi(QMainWindow *tipsClass) + { + tipsClass->setWindowTitle(QCoreApplication::translate("tipsClass", "tips", nullptr)); + } // retranslateUi + +}; + +namespace Ui { + class tipsClass: public Ui_tipsClass {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_TIPS_H diff --git a/src/UAV_UI_new/x64/Debug/vc143.pdb b/src/UAV_UI_new/x64/Debug/vc143.pdb new file mode 100644 index 0000000..555d790 Binary files /dev/null and b/src/UAV_UI_new/x64/Debug/vc143.pdb differ diff --git a/src/飞控/command_to_mavros.h b/src/飞控/command_to_mavros.h new file mode 100644 index 0000000..028ea2e --- /dev/null +++ b/src/飞控/command_to_mavros.h @@ -0,0 +1,624 @@ +/*************************************************************************************************************************** +* command_to_mavros.h +* +* Author: Qyp +* +* Update Time: 2020.08.12 +* +* Introduction: Drone control command send class using Mavros package +* 1. Ref to the Mavros plugins (setpoint_raw, loca_position, imu and etc..) +* 2. Ref to the Offboard Flight task in PX4 code: https://github.com/PX4/Firmware/blob/master/src/lib/FlightTasks/tasks/Offboard/FlightTaskOffboard.cpp +* 3. Ref to the Mavlink module in PX4 code: https://github.com/PX4/Firmware/blob/master/src/modules/mavlink/mavlink_receiver.cpp +* 4. Ref to the position control module in PX4: https://github.com/PX4/Firmware/blob/master/src/modules/mc_pos_control +* 5. Ref to the attitude control module in PX4: https://github.com/PX4/Firmware/blob/master/src/modules/mc_att_control +* 6. 还需要考虑复合形式的输出情况 +* 主要功能: +* 本库函数主要用于连接prometheus_control与mavros两个功能包。简单来讲,本代码提供飞控的状态量,用于控制或者监控,本代码接受控制指令,并将其发送至飞控。 +* 1、发布prometheus_control功能包生成的控制量至mavros功能包,可发送期望位置、速度、角度、角速度、底层控制等。 +* 2、订阅mavros功能包发布的飞控状态量(包括PX4中的期望位置、速度、角度、角速度、底层控制),用于检查飞控是否正确接收机载电脑的指令 +* 3、解锁上锁、修改模式两个服务。 + +***************************************************************************************************************************/ +#ifndef COMMAND_TO_MAVROS_H +#define COMMAND_TO_MAVROS_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +class command_to_mavros +{ + public: + //constructed function 1 + command_to_mavros(void): + command_nh("~") + { + command_nh.param("uav_name", uav_name, "/uav0"); + + if (uav_name == "/uav0") + { + uav_name = ""; + } + + pos_drone_fcu_target = Eigen::Vector3d(0.0,0.0,0.0); + vel_drone_fcu_target = Eigen::Vector3d(0.0,0.0,0.0); + accel_drone_fcu_target = Eigen::Vector3d(0.0,0.0,0.0); + q_fcu_target = Eigen::Quaterniond(0.0,0.0,0.0,0.0); + euler_fcu_target = Eigen::Vector3d(0.0,0.0,0.0); + rates_fcu_target = Eigen::Vector3d(0.0,0.0,0.0); + Thrust_target = 0.0; + + // 【订阅】无人机期望位置/速度/加速度 坐标系:ENU系 + // 本话题来自飞控(通过Mavros功能包 /plugins/setpoint_raw.cpp读取), 对应Mavlink消息为POSITION_TARGET_LOCAL_NED, 对应的飞控中的uORB消息为vehicle_local_position_setpoint.msg + position_target_sub = command_nh.subscribe(uav_name + "/mavros/setpoint_raw/target_local", 10, &command_to_mavros::pos_target_cb,this); + + // 【订阅】无人机期望角度/角速度 坐标系:ENU系 + // 本话题来自飞控(通过Mavros功能包 /plugins/setpoint_raw.cpp读取), 对应Mavlink消息为ATTITUDE_TARGET (#83), 对应的飞控中的uORB消息为vehicle_attitude_setpoint.msg + attitude_target_sub = command_nh.subscribe(uav_name + "/mavros/setpoint_raw/target_attitude", 10, &command_to_mavros::att_target_cb,this); + + // 【订阅】无人机底层控制量(Mx My Mz 及 F) [0][1][2][3]分别对应 roll pitch yaw控制量 及 油门推力 + // 本话题来自飞控(通过Mavros功能包 /plugins/actuator_control.cpp读取), 对应Mavlink消息为ACTUATOR_CONTROL_TARGET, 对应的飞控中的uORB消息为actuator_controls.msg + actuator_target_sub = command_nh.subscribe(uav_name + "/mavros/target_actuator_control", 10, &command_to_mavros::actuator_target_cb,this); + + // 【发布】位置/速度/加速度期望值 坐标系 ENU系 + // 本话题要发送至飞控(通过Mavros功能包 /plugins/setpoint_raw.cpp发送), 对应Mavlink消息为SET_POSITION_TARGET_LOCAL_NED (#84), 对应的飞控中的uORB消息为position_setpoint_triplet.msg + setpoint_raw_local_pub = command_nh.advertise(uav_name + "/mavros/setpoint_raw/local", 10); + + // 【发布】角度/角速度期望值 坐标系 ENU系 + // 本话题要发送至飞控(通过Mavros功能包 /plugins/setpoint_raw.cpp发送), 对应Mavlink消息为SET_ATTITUDE_TARGET (#82), 对应的飞控中的uORB消息为vehicle_attitude_setpoint.msg(角度) 或vehicle_rates_setpoint.msg(角速度) + setpoint_raw_attitude_pub = command_nh.advertise(uav_name + "/mavros/setpoint_raw/attitude", 10); + + // 【发布】底层控制量(Mx My Mz 及 F) [0][1][2][3]分别对应 roll pitch yaw控制量 及 油门推力 注意 这里是NED系的!! + // 本话题要发送至飞控(通过Mavros功能包 /plugins/actuator_control.cpp发送), 对应Mavlink消息为SET_ACTUATOR_CONTROL_TARGET, 对应的飞控中的uORB消息为actuator_controls.msg + actuator_setpoint_pub = command_nh.advertise(uav_name + "/mavros/actuator_control", 10); + + // 本话题要发送至飞控(通过Mavros_extra功能包 /plugins/mount_control.cpp发送) + mount_control_pub = command_nh.advertise(uav_name + "/mavros/mount_control/command", 1); + + // 【服务】解锁/上锁 + // 本服务通过Mavros功能包 /plugins/command.cpp 实现 + arming_client = command_nh.serviceClient(uav_name + "/mavros/cmd/arming"); + + // 【服务】修改系统模式 + // 本服务通过Mavros功能包 /plugins/command.cpp 实现 + set_mode_client = command_nh.serviceClient(uav_name + "/mavros/set_mode"); + } + + //constructed function 2 + command_to_mavros(string Uav_name): + command_nh("") + { + uav_name = Uav_name; + + pos_drone_fcu_target = Eigen::Vector3d(0.0,0.0,0.0); + vel_drone_fcu_target = Eigen::Vector3d(0.0,0.0,0.0); + accel_drone_fcu_target = Eigen::Vector3d(0.0,0.0,0.0); + q_fcu_target = Eigen::Quaterniond(0.0,0.0,0.0,0.0); + euler_fcu_target = Eigen::Vector3d(0.0,0.0,0.0); + rates_fcu_target = Eigen::Vector3d(0.0,0.0,0.0); + Thrust_target = 0.0; + + // 【订阅】无人机期望位置/速度/加速度 坐标系:ENU系 + // 本话题来自飞控(通过Mavros功能包 /plugins/setpoint_raw.cpp读取), 对应Mavlink消息为POSITION_TARGET_LOCAL_NED, 对应的飞控中的uORB消息为vehicle_local_position_setpoint.msg + position_target_sub = command_nh.subscribe(uav_name + "/mavros/setpoint_raw/target_local", 10, &command_to_mavros::pos_target_cb,this); + + // 【订阅】无人机期望角度/角速度 坐标系:ENU系 + // 本话题来自飞控(通过Mavros功能包 /plugins/setpoint_raw.cpp读取), 对应Mavlink消息为ATTITUDE_TARGET (#83), 对应的飞控中的uORB消息为vehicle_attitude_setpoint.msg + attitude_target_sub = command_nh.subscribe(uav_name + "/mavros/setpoint_raw/target_attitude", 10, &command_to_mavros::att_target_cb,this); + + // 【订阅】无人机底层控制量(Mx My Mz 及 F) [0][1][2][3]分别对应 roll pitch yaw控制量 及 油门推力 + // 本话题来自飞控(通过Mavros功能包 /plugins/actuator_control.cpp读取), 对应Mavlink消息为ACTUATOR_CONTROL_TARGET, 对应的飞控中的uORB消息为actuator_controls.msg + actuator_target_sub = command_nh.subscribe(uav_name + "/mavros/target_actuator_control", 10, &command_to_mavros::actuator_target_cb,this); + + // 【发布】位置/速度/加速度期望值 坐标系 ENU系 + // 本话题要发送至飞控(通过Mavros功能包 /plugins/setpoint_raw.cpp发送), 对应Mavlink消息为SET_POSITION_TARGET_LOCAL_NED (#84), 对应的飞控中的uORB消息为position_setpoint_triplet.msg + setpoint_raw_local_pub = command_nh.advertise(uav_name + "/mavros/setpoint_raw/local", 10); + + // 【发布】角度/角速度期望值 坐标系 ENU系 + // 本话题要发送至飞控(通过Mavros功能包 /plugins/setpoint_raw.cpp发送), 对应Mavlink消息为SET_ATTITUDE_TARGET (#82), 对应的飞控中的uORB消息为vehicle_attitude_setpoint.msg(角度) 或vehicle_rates_setpoint.msg(角速度) + setpoint_raw_attitude_pub = command_nh.advertise(uav_name + "/mavros/setpoint_raw/attitude", 10); + + // 【发布】底层控制量(Mx My Mz 及 F) [0][1][2][3]分别对应 roll pitch yaw控制量 及 油门推力 注意 这里是NED系的!! + // 本话题要发送至飞控(通过Mavros功能包 /plugins/actuator_control.cpp发送), 对应Mavlink消息为SET_ACTUATOR_CONTROL_TARGET, 对应的飞控中的uORB消息为actuator_controls.msg + actuator_setpoint_pub = command_nh.advertise(uav_name + "/mavros/actuator_control", 10); + + // 本话题要发送至飞控(通过Mavros_extra功能包 /plugins/mount_control.cpp发送) + mount_control_pub = command_nh.advertise(uav_name + "/mavros/mount_control/command", 1); + + // 【服务】解锁/上锁 + // 本服务通过Mavros功能包 /plugins/command.cpp 实现 + arming_client = command_nh.serviceClient(uav_name + "/mavros/cmd/arming"); + + // 【服务】修改系统模式 + // 本服务通过Mavros功能包 /plugins/command.cpp 实现 + set_mode_client = command_nh.serviceClient(uav_name + "/mavros/set_mode"); + } + + string uav_name; + //Target pos of the drone [from fcu] + Eigen::Vector3d pos_drone_fcu_target; + //Target vel of the drone [from fcu] + Eigen::Vector3d vel_drone_fcu_target; + //Target accel of the drone [from fcu] + Eigen::Vector3d accel_drone_fcu_target; + //Target att of the drone [from fcu] + Eigen::Quaterniond q_fcu_target; + Eigen::Vector3d euler_fcu_target; + Eigen::Vector3d rates_fcu_target; + //Target thrust of the drone [from fcu] + float Thrust_target; + mavros_msgs::ActuatorControl actuator_target; + + //变量声明 - 服务 + mavros_msgs::SetMode mode_cmd; + + mavros_msgs::CommandBool arm_cmd; + + ros::ServiceClient arming_client; + + ros::ServiceClient set_mode_client; + + //Idle. Do nothing. + void idle(); + + //px4 takeoff + void takeoff(); + + //px4 loiter + void loiter(); + + // px4 land + void land(); + + //发送位置期望值至飞控(输入:期望xyz,期望yaw) + void send_pos_setpoint(const Eigen::Vector3d& pos_sp, float yaw_sp); + + //发送速度期望值至飞控(输入:期望vxvyvz,期望yaw) + void send_vel_setpoint(const Eigen::Vector3d& vel_sp, float yaw_sp); + + //发送速度期望值至飞控(输入:期望vxvy z,期望yaw) + void send_vel_xy_pos_z_setpoint(const Eigen::Vector3d& state_sp, float yaw_sp); + void send_vel_xy_pos_z_setpoint_yawrate(const Eigen::Vector3d& state_sp, float yaw_rate_sp); + + //发送速度期望值至飞控(机体系)(输入:期望vxvyvz,期望yaw) + void send_vel_setpoint_body(const Eigen::Vector3d& vel_sp, float yaw_sp); + + void send_vel_setpoint_yaw_rate(const Eigen::Vector3d& vel_sp, float yaw_rate_sp); + + // 发送位置+速度期望值至飞控(机体系)(输入:期望xyz + vxvyvz,期望yaw) + void send_pos_vel_xyz_setpoint(const Eigen::Vector3d& pos_sp, const Eigen::Vector3d& vel_sp, float yaw_sp); + + //发送加速度期望值至飞控(输入:期望axayaz,期望yaw) + void send_acc_xyz_setpoint(const Eigen::Vector3d& accel_sp, float yaw_sp); + + //发送角度期望值至飞控(输入:期望角度-四元数,期望推力) + //这是px4_pos_controller.cpp中目前使用的控制方式 + void send_attitude_setpoint(const prometheus_msgs::AttitudeReference& _AttitudeReference); + + //发送角度期望值至飞控(输入:期望角速度,期望推力) + void send_attitude_rate_setpoint(const Eigen::Vector3d& attitude_rate_sp, float thrust_sp); + + void send_attitude_setpoint_yawrate(const prometheus_msgs::AttitudeReference& _AttitudeReference, float yaw_rate_sp); + + //发送底层至飞控(输入:MxMyMz,期望推力)[Not recommanded. Because the high delay between the onboard computer and Pixhawk] + void send_actuator_setpoint(const Eigen::Vector4d& actuator_sp); + + //发送云台控制指令 + void send_mount_control_command(const Eigen::Vector3d& gimbal_att_sp); + + private: + + ros::NodeHandle command_nh; + + ros::Subscriber position_target_sub; + ros::Subscriber attitude_target_sub; + ros::Subscriber actuator_target_sub; + + ros::Publisher setpoint_raw_local_pub; + ros::Publisher setpoint_raw_attitude_pub; + ros::Publisher actuator_setpoint_pub; + ros::Publisher mount_control_pub; + + void pos_target_cb(const mavros_msgs::PositionTarget::ConstPtr& msg) + { + pos_drone_fcu_target = Eigen::Vector3d(msg->position.x, msg->position.y, msg->position.z); + + vel_drone_fcu_target = Eigen::Vector3d(msg->velocity.x, msg->velocity.y, msg->velocity.z); + + accel_drone_fcu_target = Eigen::Vector3d(msg->acceleration_or_force.x, msg->acceleration_or_force.y, msg->acceleration_or_force.z); + } + + void att_target_cb(const mavros_msgs::AttitudeTarget::ConstPtr& msg) + { + q_fcu_target = Eigen::Quaterniond(msg->orientation.w, msg->orientation.x, msg->orientation.y, msg->orientation.z); + + //Transform the Quaternion to euler Angles + euler_fcu_target = quaternion_to_euler(q_fcu_target); + + rates_fcu_target = Eigen::Vector3d(msg->body_rate.x, msg->body_rate.y, msg->body_rate.z); + + Thrust_target = msg->thrust; + } + + void actuator_target_cb(const mavros_msgs::ActuatorControl::ConstPtr& msg) + { + actuator_target = *msg; + } + + +}; + +void command_to_mavros::send_mount_control_command(const Eigen::Vector3d& gimbal_att_sp) +{ + mavros_msgs::MountControl mount_setpoint; + // + mount_setpoint.mode = 2; + mount_setpoint.pitch = gimbal_att_sp[0]; // Gimbal Pitch + mount_setpoint.roll = gimbal_att_sp[1]; // Gimbal Yaw + mount_setpoint.yaw = gimbal_att_sp[2]; // Gimbal Yaw + + mount_control_pub.publish(mount_setpoint); + +} + +void command_to_mavros::takeoff() +{ + mavros_msgs::PositionTarget pos_setpoint; + + //飞控如何接收该信号请见mavlink_receiver.cpp + //飞控如何执行该指令请见FlightTaskOffboard.cpp + //需要在QGC设置起飞高度 + pos_setpoint.type_mask = 0x1000; + + setpoint_raw_local_pub.publish(pos_setpoint); +} + +void command_to_mavros::land() +{ + mavros_msgs::PositionTarget pos_setpoint; + + //飞控如何接收该信号请见mavlink_receiver.cpp + //飞控如何执行该指令请见FlightTaskOffboard.cpp + //需要在QGC设置降落速度 + pos_setpoint.type_mask = 0x2000; + + setpoint_raw_local_pub.publish(pos_setpoint); +} + +void command_to_mavros::loiter() +{ + mavros_msgs::PositionTarget pos_setpoint; + + //飞控如何接收该信号请见mavlink_receiver.cpp + //飞控如何执行该指令请见FlightTaskOffboard.cpp + pos_setpoint.type_mask = 0x3000; + + setpoint_raw_local_pub.publish(pos_setpoint); +} + +void command_to_mavros::idle() +{ + mavros_msgs::PositionTarget pos_setpoint; + + //飞控如何接收该信号请见mavlink_receiver.cpp + //飞控如何执行该指令请见FlightTaskOffboard.cpp + pos_setpoint.type_mask = 0x4000; + + setpoint_raw_local_pub.publish(pos_setpoint); +} + +//发送位置期望值至飞控(输入:期望xyz,期望yaw) +void command_to_mavros::send_pos_setpoint(const Eigen::Vector3d& pos_sp, float yaw_sp) +{ + mavros_msgs::PositionTarget pos_setpoint; + //Bitmask toindicate which dimensions should be ignored (1 means ignore,0 means not ignore; Bit 10 must set to 0) + //Bit 1:x, bit 2:y, bit 3:z, bit 4:vx, bit 5:vy, bit 6:vz, bit 7:ax, bit 8:ay, bit 9:az, bit 10:is_force_sp, bit 11:yaw, bit 12:yaw_rate + //Bit 10 should set to 0, means is not force sp + pos_setpoint.type_mask = 0b100111111000; // 100 111 111 000 xyz + yaw + + pos_setpoint.coordinate_frame = 1; + + pos_setpoint.position.x = pos_sp[0]; + pos_setpoint.position.y = pos_sp[1]; + pos_setpoint.position.z = pos_sp[2]; + + pos_setpoint.yaw = yaw_sp; + + setpoint_raw_local_pub.publish(pos_setpoint); + + // 检查飞控是否收到控制量 + // cout <<">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>command_to_mavros<<<<<<<<<<<<<<<<<<<<<<<<<<<" <>>>>>>>>>>>>>>>>>>>>>>>>>>>>>command_to_mavros<<<<<<<<<<<<<<<<<<<<<<<<<<<" <>>>>>>>>>>>>>>>>>>>>>>>>>>>>>command_to_mavros<<<<<<<<<<<<<<<<<<<<<<<<<<<" <>>>>>>>>>>>>>>>>>>>>>>>>>>>>>command_to_mavros<<<<<<<<<<<<<<<<<<<<<<<<<<<" <>>>>>>>>>>>>>>>>>>>>>>>>>>>>>command_to_mavros<<<<<<<<<<<<<<<<<<<<<<<<<<<" <>>>>>>>>>>>>>>>>>>>>>>>>>>>>>command_to_mavros<<<<<<<<<<<<<<<<<<<<<<<<<<<" <>>>>>>>>>>>>>>>>>>>>>>>>>>>>>command_to_mavros<<<<<<<<<<<<<<<<<<<<<<<<<<<" <>>>>>>>>>>>>>>>>>>>>>>>>>>>>>command_to_mavros<<<<<<<<<<<<<<<<<<<<<<<<<<<" <>>>>>>>>>>>>>>>>>>>>>>>>>>>>>command_to_mavros<<<<<<<<<<<<<<<<<<<<<<<<<<<" <>>>>>>>>>>>>>>>>>>>>>>>>>>>>>command_to_mavros<<<<<<<<<<<<<<<<<<<<<<<<<<<" <>>>>>>>>>>>>>>>>>>>>>>>>>>>>>command_to_mavros<<<<<<<<<<<<<<<<<<<<<<<<<<<" < +#include +#include +#include +#include +#include +#include + + +using namespace std; + +class Controller_Test +{ + public: + //构造函数 + Controller_Test(void): + Controller_Test_nh("~") + { + Controller_Test_nh.param("Controller_Test/Circle/Center_x", circle_center[0], 0.0); + Controller_Test_nh.param("Controller_Test/Circle/Center_y", circle_center[1], 0.0); + Controller_Test_nh.param("Controller_Test/Circle/Center_z", circle_center[2], 1.0); + Controller_Test_nh.param("Controller_Test/Circle/circle_radius", circle_radius, 2.0); + Controller_Test_nh.param("Controller_Test/Circle/linear_vel", linear_vel, 0.5); + Controller_Test_nh.param("Controller_Test/Circle/direction", direction, 1.0); + + Controller_Test_nh.param("Controller_Test/Eight/Center_x", eight_origin_[0], 0.0); + Controller_Test_nh.param("Controller_Test/Eight/Center_y", eight_origin_[1], 0.0); + Controller_Test_nh.param("Controller_Test/Eight/Center_z", eight_origin_[2], 1.0); + Controller_Test_nh.param("Controller_Test/Eight/omega", eight_omega_, 0.5); + Controller_Test_nh.param("Controller_Test/Eight/radial", radial, 2.0); + + Controller_Test_nh.param("Controller_Test/Step/step_length", step_length, 0.0); + Controller_Test_nh.param("Controller_Test/Step/step_interval", step_interval, 0.0); + + } + + //Printf the Controller_Test parameter + void printf_param(); + + //Controller_Test Calculation [Input: time_from_start; Output: Circle_trajectory;] + prometheus_msgs::PositionReference Circle_trajectory_generation(float time_from_start); + + prometheus_msgs::PositionReference Eight_trajectory_generation(float time_from_start); + + prometheus_msgs::PositionReference Step_trajectory_generation(float time_from_start); + + prometheus_msgs::PositionReference Line_trajectory_generation(float time_from_start); + + private: + + ros::NodeHandle Controller_Test_nh; + + // Circle Parameter + Eigen::Vector3f circle_center; + float circle_radius; + float linear_vel; + float direction; //direction = 1 for CCW 逆时针, direction = -1 for CW 顺时针 + + // Eight Shape Parameter + Eigen::Vector3f eight_origin_; + float radial; + float eight_omega_; + + // Step + float step_length; + float step_interval; + +}; + + +prometheus_msgs::PositionReference Controller_Test::Circle_trajectory_generation(float time_from_start) +{ + prometheus_msgs::PositionReference Circle_trajectory; + float omega; + if( circle_radius != 0) + { + omega = direction * fabs(linear_vel / circle_radius); + }else + { + omega = 0.0; + } + const float angle = time_from_start * omega; + const float cos_angle = cos(angle); + const float sin_angle = sin(angle); + + // cout << "omega : " << omega * 180/M_PI <<" [deg/s] " <>>>>>>>>>>>>>>>>>>>>>>>>Controller_Test Parameter <<<<<<<<<<<<<<<<<<<<<<" < + +#include "state_from_mavros.h" +#include "command_to_mavros.h" +#include "prometheus_control_utils.h" +#include "message_utils.h" +#include "control_common.h" +#include "printf_utils.h" +#include "prometheus_station_utils.h" + +#define NODE_NAME "px4_sender" + +using namespace std; + //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>变量声明<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +float cur_time; //程序运行时间 +float Takeoff_height; //默认起飞高度 +float Disarm_height; //自动上锁高度 +float Land_speed; //降落速度 +int Land_mode; //降落策略选择 +bool quick_land = false; +//Geigraphical fence 地理围栏 +Eigen::Vector2f geo_fence_x; +Eigen::Vector2f geo_fence_y; +Eigen::Vector2f geo_fence_z; + +Eigen::Vector3d Takeoff_position; // 起飞位置 +prometheus_msgs::DroneState _DroneState; //无人机状态量 + +prometheus_msgs::ControlCommand Command_Now; //无人机当前执行命令 +prometheus_msgs::ControlCommand Command_Last; //无人机上一条执行命令 + +Eigen::Vector3d state_sp(0,0,0); +Eigen::Vector3d state_sp_extra(0,0,0); +double yaw_sp; +double yaw_rate_sp; + +prometheus_msgs::Message message; +prometheus_msgs::LogMessageControl LogMessage; + +//RVIZ显示:期望位置 +geometry_msgs::PoseStamped ref_pose_rviz; +float dt = 0; + +ros::Publisher rivz_ref_pose_pub; +ros::Publisher message_pub; +ros::Publisher log_message_pub; +//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>函数声明<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +void printf_param(); +int check_failsafe(); +geometry_msgs::PoseStamped get_rviz_ref_posistion(const prometheus_msgs::ControlCommand& cmd); +//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>回调函数<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +void Command_cb(const prometheus_msgs::ControlCommand::ConstPtr& msg) +{ + // CommandID必须递增才会被记录 + if( msg->Command_ID > Command_Now.Command_ID ) + { + Command_Now = *msg; + }else + { + pub_message(message_pub, prometheus_msgs::Message::WARN, NODE_NAME, "Wrong Command ID."); + } + + // 无人机一旦接受到Disarm指令,则会屏蔽其他指令 + if(Command_Last.Mode == prometheus_msgs::ControlCommand::Disarm) + { + Command_Now = Command_Last; + } +} +void station_command_cb(const prometheus_msgs::ControlCommand::ConstPtr& msg) +{ + Command_Now = *msg; + pub_message(message_pub, prometheus_msgs::Message::NORMAL, NODE_NAME, "Get a command from Prometheus Station."); + + // 无人机一旦接受到Disarm指令,则会屏蔽其他指令 + if(Command_Last.Mode == prometheus_msgs::ControlCommand::Disarm) + { + Command_Now = Command_Last; + } +} +void drone_state_cb(const prometheus_msgs::DroneState::ConstPtr& msg) +{ + _DroneState = *msg; + + _DroneState.time_from_start = cur_time; +} +void timerCallback(const ros::TimerEvent& e) +{ + cout << GREEN <<">>>>>>>>>>>>>>>>>>>>>>>> PX4 SENDER <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << TAIL <>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>主 函 数<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +int main(int argc, char **argv) +{ + ros::init(argc, argv, "px4_sender"); + ros::NodeHandle nh("~"); + + //【订阅】指令 + // 本话题为任务模块生成的控制指令 + ros::Subscriber Command_sub = nh.subscribe("/prometheus/control_command", 10, Command_cb); + + //【订阅】指令 + // 本话题为Prometheus地面站发送的控制指令 + ros::Subscriber station_command_sub = nh.subscribe("/prometheus/control_command_station", 10, station_command_cb); + + //【订阅】无人机状态 + // 本话题来自px4_pos_estimator.cpp + ros::Subscriber drone_state_sub = nh.subscribe("/prometheus/drone_state", 10, drone_state_cb); + + //【发布】参考位姿 RVIZ显示用 + rivz_ref_pose_pub = nh.advertise("/prometheus/control/ref_pose_rviz", 10); + + // 【发布】用于地面站显示的提示消息 + message_pub = nh.advertise("/prometheus/message/main", 10); + + // 【发布】用于log的消息 + log_message_pub = nh.advertise("/prometheus/log/control", 10); + + // 10秒定时打印,以确保程序在正确运行 + ros::Timer timer = nh.createTimer(ros::Duration(10.0), timerCallback); + + // 参数读取 + nh.param("Takeoff_height", Takeoff_height, 1.0); + nh.param("Disarm_height", Disarm_height, 0.15); + nh.param("Land_speed", Land_speed, 0.2); + nh.param("Land_mode",Land_mode,0); + + nh.param("geo_fence/x_min", geo_fence_x[0], -100.0); + nh.param("geo_fence/x_max", geo_fence_x[1], 100.0); + nh.param("geo_fence/y_min", geo_fence_y[0], -100.0); + nh.param("geo_fence/y_max", geo_fence_y[1], 100.0); + nh.param("geo_fence/z_min", geo_fence_z[0], -100.0); + nh.param("geo_fence/z_max", geo_fence_z[1], 100.0); + + // 设定起飞位置 + Takeoff_position[0] = 0.0; + Takeoff_position[1] = 0.0; + Takeoff_position[2] = 0.15; + + // 建议控制频率 : 10 - 50Hz, 控制频率取决于控制形式,若控制方式为速度或加速度应适当提高频率 + ros::Rate rate(20.0); + + // 用于与mavros通讯的类,通过mavros发送控制指令至飞控【本程序->mavros->飞控】 + command_to_mavros _command_to_mavros; + + printf_param(); + + // 初始化命令- + // 默认设置:Idle模式 电机怠速旋转 等待来自上层的控制指令 + Command_Now.Mode = prometheus_msgs::ControlCommand::Idle; + Command_Now.Command_ID = 0; + Command_Now.Reference_State.Move_mode = prometheus_msgs::PositionReference::XYZ_POS; + Command_Now.Reference_State.Move_frame = prometheus_msgs::PositionReference::ENU_FRAME; + Command_Now.Reference_State.position_ref[0] = 0; + Command_Now.Reference_State.position_ref[1] = 0; + Command_Now.Reference_State.position_ref[2] = 0; + Command_Now.Reference_State.velocity_ref[0] = 0; + Command_Now.Reference_State.velocity_ref[1] = 0; + Command_Now.Reference_State.velocity_ref[2] = 0; + Command_Now.Reference_State.acceleration_ref[0] = 0; + Command_Now.Reference_State.acceleration_ref[1] = 0; + Command_Now.Reference_State.acceleration_ref[2] = 0; + Command_Now.Reference_State.yaw_ref = 0; + + + // 记录启控时间 + ros::Time begin_time = ros::Time::now(); + float last_time = prometheus_control_utils::get_time_in_sec(begin_time); + +//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>主 循 环<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + while(ros::ok()) + { + // 当前时间 + cur_time = prometheus_control_utils::get_time_in_sec(begin_time); + dt = cur_time - last_time; + dt = constrain_function2(dt, 0.02, 0.1); + last_time = cur_time; + + // 执行回调函数 + ros::spinOnce(); + + + // Check for geo fence: If drone is out of the geo fence, it will land now. + if(Command_Now.Mode !=prometheus_msgs::ControlCommand::Idle ) + { + int safety_flag = check_failsafe(); + if(safety_flag == 1) + { + Command_Now.Mode = prometheus_msgs::ControlCommand::Land; + }else if(safety_flag == 2) + { + // 快速降落 + Land_speed = 0.8; + quick_land = true; + Command_Now.Mode = prometheus_msgs::ControlCommand::Land; + } + } + + switch (Command_Now.Mode) + { + // 【Idle】 怠速旋转,此时可以切入offboard模式,但不会起飞。 + case prometheus_msgs::ControlCommand::Idle: + + _command_to_mavros.idle(); + + // 设定yaw_ref=999时,切换offboard模式,并解锁 + if(Command_Now.Reference_State.yaw_ref == 999) + { + if(_DroneState.mode != "OFFBOARD") + { + _command_to_mavros.mode_cmd.request.custom_mode = "OFFBOARD"; + _command_to_mavros.set_mode_client.call(_command_to_mavros.mode_cmd); + pub_message(message_pub, prometheus_msgs::Message::NORMAL, NODE_NAME, "Setting to OFFBOARD Mode..."); + }else + { + pub_message(message_pub, prometheus_msgs::Message::NORMAL, NODE_NAME, "The Drone is in OFFBOARD Mode already..."); + } + + if(!_DroneState.armed) + { + _command_to_mavros.arm_cmd.request.value = true; + _command_to_mavros.arming_client.call(_command_to_mavros.arm_cmd); + pub_message(message_pub, prometheus_msgs::Message::NORMAL, NODE_NAME, "Arming..."); + }else + { + pub_message(message_pub, prometheus_msgs::Message::NORMAL, NODE_NAME, "The Drone is armd already..."); + } + } + break; + + // 【Takeoff】 从摆放初始位置原地起飞至指定高度,偏航角也保持当前角度 + case prometheus_msgs::ControlCommand::Takeoff: + + // 不能多次起飞! + // 此处起飞有一个bug,则是飞机起飞会有很严重的超调,没发现具体导致的因素 + + // 设定起飞点 + if (Command_Last.Mode != prometheus_msgs::ControlCommand::Takeoff) + { + pub_message(message_pub, prometheus_msgs::Message::NORMAL, NODE_NAME, "Takeoff to the desired point."); + // 设定起飞位置 + Takeoff_position[0] = _DroneState.position[0]; + Takeoff_position[1] = _DroneState.position[1]; + Takeoff_position[2] = _DroneState.position[2]; + + // + Command_Now.Reference_State.Move_mode = prometheus_msgs::PositionReference::XYZ_POS; + Command_Now.Reference_State.Move_frame = prometheus_msgs::PositionReference::ENU_FRAME; + Command_Now.Reference_State.position_ref[0] = Takeoff_position[0]; + Command_Now.Reference_State.position_ref[1] = Takeoff_position[1]; + Command_Now.Reference_State.position_ref[2] = Takeoff_position[2] + Takeoff_height; + Command_Now.Reference_State.yaw_ref = _DroneState.attitude[2]; + + state_sp = Eigen::Vector3d(Takeoff_position[0],Takeoff_position[1],Takeoff_position[2] + Takeoff_height); + yaw_sp = _DroneState.attitude[2]; //rad + } + + _command_to_mavros.send_pos_setpoint(state_sp, yaw_sp); + + //_command_to_mavros.takeoff(); 无用,未知原因 + + break; + + // 【Hold】 悬停。当前位置悬停 + case prometheus_msgs::ControlCommand::Hold: + + if (Command_Last.Mode != prometheus_msgs::ControlCommand::Hold) + { + Command_Now.Reference_State.Move_mode = prometheus_msgs::PositionReference::XYZ_POS; + Command_Now.Reference_State.Move_frame = prometheus_msgs::PositionReference::ENU_FRAME; + Command_Now.Reference_State.position_ref[0] = _DroneState.position[0]; + Command_Now.Reference_State.position_ref[1] = _DroneState.position[1]; + Command_Now.Reference_State.position_ref[2] = _DroneState.position[2]; + Command_Now.Reference_State.yaw_ref = _DroneState.attitude[2]; //rad + + state_sp = Eigen::Vector3d(_DroneState.position[0],_DroneState.position[1],_DroneState.position[2]); + yaw_sp = _DroneState.attitude[2]; //rad + } + _command_to_mavros.send_pos_setpoint(state_sp, yaw_sp); + //_command_to_mavros.loiter(); 可用,但不启用 + + break; + + // 【Land】 降落。两种降落方式: 只有加载了参数Land_mode为1时,启用第二种降落方式;默认启用第一种降落方式。 + // 第一种:当前位置原地降落,降落后会自动上锁,且切换为mannual模式 + // 第二种:当前位置原地降落,降落中到达Disarm_height后,切换为飞控中land模式 + case prometheus_msgs::ControlCommand::Land: + + if(quick_land) + { + // 紧急降落 + state_sp << 0.0, 0.0, -Land_speed; + yaw_sp = _DroneState.attitude[2]; //rad + _command_to_mavros.send_vel_setpoint(state_sp,yaw_sp); + }else if(Land_mode == 1) + { + if (Command_Last.Mode != prometheus_msgs::ControlCommand::Land) + { + Command_Now.Reference_State.Move_mode = prometheus_msgs::PositionReference::XY_POS_Z_VEL; + Command_Now.Reference_State.Move_frame = prometheus_msgs::PositionReference::ENU_FRAME; + Command_Now.Reference_State.position_ref[0] = _DroneState.position[0]; + Command_Now.Reference_State.position_ref[1] = _DroneState.position[1]; + Command_Now.Reference_State.yaw_ref = _DroneState.attitude[2]; //rad + } + //如果距离起飞高度小于30厘米,则直接切换为land模式; + if(_DroneState.position[2] <= Disarm_height) + { + if(_DroneState.mode != "AUTO.LAND") // 无效 + { + //此处切换会manual模式是因为:PX4默认在offboard模式且有控制的情况下没法上锁,直接使用飞控中的land模式 + _command_to_mavros.mode_cmd.request.custom_mode = "AUTO.LAND"; + _command_to_mavros.set_mode_client.call(_command_to_mavros.mode_cmd); + pub_message(message_pub, prometheus_msgs::Message::WARN, NODE_NAME, "LAND: inter AUTO LAND filght mode"); + } + } + else if(_DroneState.position[2] > Disarm_height) + { + Command_Now.Reference_State.position_ref[0] = _DroneState.position[0]; + Command_Now.Reference_State.position_ref[1] = _DroneState.position[1]; + Command_Now.Reference_State.position_ref[2] = _DroneState.position[2] - Land_speed * dt ; + Command_Now.Reference_State.velocity_ref[0] = 0.0; + Command_Now.Reference_State.velocity_ref[1] = 0.0; + Command_Now.Reference_State.velocity_ref[2] = - Land_speed; //Land_speed + state_sp = Eigen::Vector3d(Command_Now.Reference_State.position_ref[0],Command_Now.Reference_State.position_ref[1],Command_Now.Reference_State.position_ref[2]); + state_sp_extra = Eigen::Vector3d(0.0,0.0,Command_Now.Reference_State.velocity_ref[2]); + yaw_sp = _DroneState.attitude[2]; + _command_to_mavros.send_pos_vel_xyz_setpoint(state_sp,state_sp_extra,yaw_sp); + } + + if(_DroneState.landed) + { + Command_Now.Mode = prometheus_msgs::ControlCommand::Idle; + } + }else{ + if (Command_Last.Mode != prometheus_msgs::ControlCommand::Land) + { + Command_Now.Reference_State.Move_mode = prometheus_msgs::PositionReference::XYZ_POS; + Command_Now.Reference_State.Move_frame = prometheus_msgs::PositionReference::ENU_FRAME; + Command_Now.Reference_State.position_ref[0] = _DroneState.position[0]; + Command_Now.Reference_State.position_ref[1] = _DroneState.position[1]; + Command_Now.Reference_State.yaw_ref = _DroneState.attitude[2]; //rad + } + if(_DroneState.position[2] > Disarm_height) + { + Command_Now.Reference_State.position_ref[2] = _DroneState.position[2] - Land_speed * dt ; + Command_Now.Reference_State.velocity_ref[0] = 0.0; + Command_Now.Reference_State.velocity_ref[1] = 0.0; + Command_Now.Reference_State.velocity_ref[2] = - Land_speed; //Land_speed + + state_sp = Eigen::Vector3d(Command_Now.Reference_State.position_ref[0],Command_Now.Reference_State.position_ref[1], Command_Now.Reference_State.position_ref[2] ); + state_sp_extra = Eigen::Vector3d(0.0, 0.0 , Command_Now.Reference_State.velocity_ref[2]); + yaw_sp = Command_Now.Reference_State.yaw_ref; + _command_to_mavros.send_pos_vel_xyz_setpoint(state_sp, state_sp_extra, yaw_sp); + }else + { + //此处切换会manual模式是因为:PX4默认在offboard模式且有控制的情况下没法上锁,直接使用飞控中的land模式 + _command_to_mavros.mode_cmd.request.custom_mode = "MANUAL"; + _command_to_mavros.set_mode_client.call(_command_to_mavros.mode_cmd); + + _command_to_mavros.arm_cmd.request.value = false; + _command_to_mavros.arming_client.call(_command_to_mavros.arm_cmd); + pub_message(message_pub, prometheus_msgs::Message::NORMAL, NODE_NAME, "Disarming..."); + + pub_message(message_pub, prometheus_msgs::Message::WARN, NODE_NAME, "LAND: switch to MANUAL filght mode"); + } + } + break; + + case prometheus_msgs::ControlCommand::Move: + + // PX4暂不支持轨迹模式 + // PX4暂不支持位置-速度复合模式(详细见mavlink_receiver.cpp) + if(Command_Now.Reference_State.Move_frame == prometheus_msgs::PositionReference::ENU_FRAME) + { + if( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XYZ_POS ) + { + state_sp = Eigen::Vector3d(Command_Now.Reference_State.position_ref[0],Command_Now.Reference_State.position_ref[1],Command_Now.Reference_State.position_ref[2]); + yaw_sp = Command_Now.Reference_State.yaw_ref; + }else if( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XYZ_VEL ) + { + state_sp = Eigen::Vector3d(Command_Now.Reference_State.velocity_ref[0],Command_Now.Reference_State.velocity_ref[1],Command_Now.Reference_State.velocity_ref[2]); + yaw_sp = Command_Now.Reference_State.yaw_ref; + }else if( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XY_VEL_Z_POS ) + { + state_sp = Eigen::Vector3d(Command_Now.Reference_State.velocity_ref[0],Command_Now.Reference_State.velocity_ref[1],Command_Now.Reference_State.position_ref[2]); + yaw_sp = Command_Now.Reference_State.yaw_ref; + }else if( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XY_POS_Z_VEL ) + { + Command_Now.Reference_State.position_ref[2] = _DroneState.position[2] + Command_Now.Reference_State.velocity_ref[2] * dt; + state_sp = Eigen::Vector3d(Command_Now.Reference_State.position_ref[0],Command_Now.Reference_State.position_ref[1],Command_Now.Reference_State.position_ref[2]); + state_sp_extra = Eigen::Vector3d(0.0, 0.0 ,Command_Now.Reference_State.velocity_ref[2]); + yaw_sp = Command_Now.Reference_State.yaw_ref; + }else if ( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XYZ_ACC ) + { + state_sp = Eigen::Vector3d(Command_Now.Reference_State.acceleration_ref[0],Command_Now.Reference_State.acceleration_ref[1],Command_Now.Reference_State.acceleration_ref[2]); + yaw_sp = Command_Now.Reference_State.yaw_ref; + } + }else + { + if( Command_Now.Command_ID > Command_Last.Command_ID) + { + if( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XYZ_POS ) + { + float d_pos_body[2] = {Command_Now.Reference_State.position_ref[0], Command_Now.Reference_State.position_ref[1]}; //the desired xy position in Body Frame + float d_pos_enu[2]; //the desired xy position in enu Frame (The origin point is the drone) + prometheus_control_utils::rotation_yaw(_DroneState.attitude[2], d_pos_body, d_pos_enu); + + Command_Now.Reference_State.position_ref[0] = _DroneState.position[0] + d_pos_enu[0]; + Command_Now.Reference_State.position_ref[1] = _DroneState.position[1] + d_pos_enu[1]; + Command_Now.Reference_State.position_ref[2] = _DroneState.position[2] + Command_Now.Reference_State.position_ref[2]; + state_sp = Eigen::Vector3d(Command_Now.Reference_State.position_ref[0],Command_Now.Reference_State.position_ref[1],Command_Now.Reference_State.position_ref[2]); + yaw_sp = _DroneState.attitude[2] + Command_Now.Reference_State.yaw_ref; + }else if( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XYZ_VEL ) + { + //xy velocity mode + float d_vel_body[2] = {Command_Now.Reference_State.velocity_ref[0], Command_Now.Reference_State.velocity_ref[1]}; //the desired xy velocity in Body Frame + float d_vel_enu[2]; //the desired xy velocity in NED Frame + + //根据无人机当前偏航角进行坐标系转换 + prometheus_control_utils::rotation_yaw(_DroneState.attitude[2], d_vel_body, d_vel_enu); + Command_Now.Reference_State.velocity_ref[0] = d_vel_enu[0]; + Command_Now.Reference_State.velocity_ref[1] = d_vel_enu[1]; + state_sp = Eigen::Vector3d(Command_Now.Reference_State.velocity_ref[0],Command_Now.Reference_State.velocity_ref[1],Command_Now.Reference_State.velocity_ref[2]); + yaw_sp = _DroneState.attitude[2] + Command_Now.Reference_State.yaw_ref; + }else if( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XY_VEL_Z_POS ) + { + //xy velocity mode + float d_vel_body[2] = {Command_Now.Reference_State.velocity_ref[0], Command_Now.Reference_State.velocity_ref[1]}; //the desired xy velocity in Body Frame + float d_vel_enu[2]; //the desired xy velocity in NED Frame + + //根据无人机当前偏航角进行坐标系转换 + prometheus_control_utils::rotation_yaw(_DroneState.attitude[2], d_vel_body, d_vel_enu); + Command_Now.Reference_State.position_ref[0] = 0; + Command_Now.Reference_State.position_ref[1] = 0; + Command_Now.Reference_State.velocity_ref[0] = d_vel_enu[0]; + Command_Now.Reference_State.velocity_ref[1] = d_vel_enu[1]; + Command_Now.Reference_State.velocity_ref[2] = 0.0; + Command_Now.Reference_State.position_ref[2] = _DroneState.position[2] + Command_Now.Reference_State.position_ref[2]; + // 高度锁定为给定值 2021.3.24 云台追踪控制修改 + state_sp = Eigen::Vector3d(Command_Now.Reference_State.velocity_ref[0],Command_Now.Reference_State.velocity_ref[1],Command_Now.Reference_State.position_ref[2]); + + if(Command_Now.Reference_State.Move_frame == prometheus_msgs::PositionReference::MIX_FRAME) + { + // 2021.6.30 for color_line_following + yaw_sp = _DroneState.attitude[2] + Command_Now.Reference_State.yaw_ref; + }else + { + // 偏航角更新为锁定 2021.3.24 云台追踪控制修改 + yaw_sp = Command_Now.Reference_State.yaw_ref + _DroneState.attitude[2] ; + } + + }else if( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XY_POS_Z_VEL ) + { + float d_pos_body[2] = {Command_Now.Reference_State.position_ref[0], Command_Now.Reference_State.position_ref[1]}; //the desired xy position in Body Frame + float d_pos_enu[2]; //the desired xy position in enu Frame (The origin point is the drone) + prometheus_control_utils::rotation_yaw(_DroneState.attitude[2], d_pos_body, d_pos_enu); + + Command_Now.Reference_State.position_ref[0] = _DroneState.position[0] + d_pos_enu[0]; + Command_Now.Reference_State.position_ref[1] = _DroneState.position[1] + d_pos_enu[1]; + Command_Now.Reference_State.position_ref[2] = _DroneState.position[2] + Command_Now.Reference_State.velocity_ref[2] * dt; + state_sp = Eigen::Vector3d(Command_Now.Reference_State.position_ref[0],Command_Now.Reference_State.position_ref[1],Command_Now.Reference_State.position_ref[2]); + state_sp_extra = Eigen::Vector3d(0.0, 0.0 ,Command_Now.Reference_State.velocity_ref[2]); + yaw_sp = _DroneState.attitude[2] + Command_Now.Reference_State.yaw_ref; + }else if ( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XYZ_ACC ) + { + pub_message(message_pub, prometheus_msgs::Message::WARN, NODE_NAME, "Not Defined. Change to ENU frame"); + } + } + } + + if( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XYZ_POS ) + { + _command_to_mavros.send_pos_setpoint(state_sp, yaw_sp); + }else if( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XYZ_VEL ) + { + if(Command_Now.Reference_State.Yaw_Rate_Mode) + { + yaw_rate_sp = Command_Now.Reference_State.yaw_rate_ref; + _command_to_mavros.send_vel_setpoint_yaw_rate(state_sp, yaw_rate_sp); + }else + { + _command_to_mavros.send_vel_setpoint(state_sp, yaw_sp); + } + }else if( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XY_VEL_Z_POS ) + { + if(Command_Now.Reference_State.Yaw_Rate_Mode) + { + yaw_rate_sp = Command_Now.Reference_State.yaw_rate_ref; + _command_to_mavros.send_vel_xy_pos_z_setpoint_yawrate(state_sp, yaw_rate_sp); + }else + { + _command_to_mavros.send_vel_xy_pos_z_setpoint(state_sp, yaw_sp); + } + }else if ( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XY_POS_Z_VEL ) + { + // 特殊情况,一般也用不到 + _command_to_mavros.send_pos_vel_xyz_setpoint(state_sp, state_sp_extra, yaw_sp); + }else if ( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XYZ_ACC ) + { + _command_to_mavros.send_acc_xyz_setpoint(state_sp, yaw_sp); + }else if ( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::TRAJECTORY ) + { + state_sp = Eigen::Vector3d(Command_Now.Reference_State.position_ref[0],Command_Now.Reference_State.position_ref[1],Command_Now.Reference_State.position_ref[2]); + state_sp_extra = Eigen::Vector3d(Command_Now.Reference_State.velocity_ref[0], Command_Now.Reference_State.velocity_ref[1] ,Command_Now.Reference_State.velocity_ref[2]); + yaw_sp = Command_Now.Reference_State.yaw_ref; + _command_to_mavros.send_pos_vel_xyz_setpoint(state_sp, state_sp_extra,yaw_sp); + }else + { + pub_message(message_pub, prometheus_msgs::Message::WARN, NODE_NAME, "Not Defined. Hold there"); + _command_to_mavros.loiter(); + } + break; + + + // 【Disarm】 上锁 + case prometheus_msgs::ControlCommand::Disarm: + + pub_message(message_pub, prometheus_msgs::Message::WARN, NODE_NAME, "Disarm: switch to MANUAL flight mode"); + if(_DroneState.mode == "OFFBOARD") + { + _command_to_mavros.mode_cmd.request.custom_mode = "MANUAL"; + _command_to_mavros.set_mode_client.call(_command_to_mavros.mode_cmd); + } + + if(_DroneState.armed) + { + _command_to_mavros.arm_cmd.request.value = false; + _command_to_mavros.arming_client.call(_command_to_mavros.arm_cmd); + } + + break; + + // 【User_Mode1】 暂空。可进行自定义 + case prometheus_msgs::ControlCommand::User_Mode1: + + break; + + // 【User_Mode2】 暂空。可进行自定义 + case prometheus_msgs::ControlCommand::User_Mode2: + + break; + } + + //发布用于RVIZ显示的位姿 + ref_pose_rviz = get_rviz_ref_posistion(Command_Now); + rivz_ref_pose_pub.publish(ref_pose_rviz); + + //发布log消息,可用rosbag记录 + LogMessage.control_type = PX4_SENDER; + LogMessage.time = cur_time; + LogMessage.Drone_State = _DroneState; + LogMessage.Control_Command = Command_Now; + LogMessage.ref_pose = ref_pose_rviz; + + log_message_pub.publish(LogMessage); + + Command_Last = Command_Now; + rate.sleep(); + } + + return 0; + +} + + +void printf_param() +{ + cout <<">>>>>>>>>>>>>>>>>>>>>>>> px4_sender Parameter <<<<<<<<<<<<<<<<<<<<<<" < geo_fence_x[1] || + _DroneState.position[1] < geo_fence_y[0] || _DroneState.position[1] > geo_fence_y[1] || + _DroneState.position[2] < geo_fence_z[0] || _DroneState.position[2] > geo_fence_z[1]) + { + cout << RED <<":----> Out of the geo fence, the drone is landing..."<< TAIL << endl; + return 1; + }else if(!_DroneState.odom_valid) + { + cout << RED <<":----> Mocap valid..., land quickly!"<< TAIL << endl; + return 2; + } + else{ + return 0; + } +} + + +geometry_msgs::PoseStamped get_rviz_ref_posistion(const prometheus_msgs::ControlCommand& cmd) +{ + geometry_msgs::PoseStamped ref_pose; + + ref_pose.header.stamp = ros::Time::now(); + // world: 世界系,即gazebo坐标系,参见tf_transform.launch + ref_pose.header.frame_id = "world"; + + if(cmd.Mode == prometheus_msgs::ControlCommand::Idle) + { + ref_pose.pose.position.x = _DroneState.position[0]; + ref_pose.pose.position.y = _DroneState.position[1]; + ref_pose.pose.position.z = _DroneState.position[2]; + ref_pose.pose.orientation = _DroneState.attitude_q; + }else if(cmd.Mode == prometheus_msgs::ControlCommand::Takeoff || cmd.Mode == prometheus_msgs::ControlCommand::Hold) + { + ref_pose.pose.position.x = cmd.Reference_State.position_ref[0]; + ref_pose.pose.position.y = cmd.Reference_State.position_ref[1]; + ref_pose.pose.position.z = cmd.Reference_State.position_ref[2]; + ref_pose.pose.orientation = _DroneState.attitude_q; + }else if(cmd.Mode == prometheus_msgs::ControlCommand::Disarm || cmd.Mode == prometheus_msgs::ControlCommand::Land ) + { + ref_pose.pose.position.x = cmd.Reference_State.position_ref[0]; + ref_pose.pose.position.y = cmd.Reference_State.position_ref[1]; + ref_pose.pose.position.z = 0.0; + ref_pose.pose.orientation = _DroneState.attitude_q; + } + else if(cmd.Mode == prometheus_msgs::ControlCommand::Move) + { + if( cmd.Reference_State.Move_mode == prometheus_msgs::PositionReference::XYZ_POS ) + { + ref_pose.pose.position.x = cmd.Reference_State.position_ref[0]; + ref_pose.pose.position.y = cmd.Reference_State.position_ref[1]; + ref_pose.pose.position.z = cmd.Reference_State.position_ref[2]; + }else if( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XYZ_VEL ) + { + ref_pose.pose.position.x = _DroneState.position[0] + cmd.Reference_State.velocity_ref[0] * dt; + ref_pose.pose.position.y = _DroneState.position[1] + cmd.Reference_State.velocity_ref[1] * dt; + ref_pose.pose.position.z = _DroneState.position[2] + cmd.Reference_State.velocity_ref[2] * dt; + }else if( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XY_VEL_Z_POS ) + { + ref_pose.pose.position.x = _DroneState.position[0] + cmd.Reference_State.velocity_ref[0] * dt; + ref_pose.pose.position.y = _DroneState.position[1] + cmd.Reference_State.velocity_ref[1] * dt; + ref_pose.pose.position.z = cmd.Reference_State.position_ref[2]; + }else if( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XY_POS_Z_VEL ) + { + ref_pose.pose.position.x = cmd.Reference_State.position_ref[0]; + ref_pose.pose.position.y = cmd.Reference_State.position_ref[1]; + ref_pose.pose.position.z = _DroneState.position[2] + cmd.Reference_State.velocity_ref[2] * dt; + }else if ( Command_Now.Reference_State.Move_mode == prometheus_msgs::PositionReference::XYZ_ACC ) + { + ref_pose.pose.position.x = _DroneState.position[0] + 0.5 * cmd.Reference_State.acceleration_ref[0] * dt * dt; + ref_pose.pose.position.y = _DroneState.position[1] + 0.5 * cmd.Reference_State.acceleration_ref[1] * dt * dt; + ref_pose.pose.position.z = _DroneState.position[2] + 0.5 * cmd.Reference_State.acceleration_ref[2] * dt * dt; + } + + ref_pose.pose.orientation = _DroneState.attitude_q; + }else + { + ref_pose.pose.position.x = 0.0; + ref_pose.pose.position.y = 0.0; + ref_pose.pose.position.z = 0.0; + ref_pose.pose.orientation = _DroneState.attitude_q; + } + + return ref_pose; +} diff --git a/src/飞控/terminal_control.cpp b/src/飞控/terminal_control.cpp new file mode 100644 index 0000000..0c88e4e --- /dev/null +++ b/src/飞控/terminal_control.cpp @@ -0,0 +1,889 @@ +/*************************************************************************************************************************** +* terminal_control.cpp +* +* Author: Qyp +* +* Update Time: 2020.11.4 +* +* Introduction: test function for sending ControlCommand.msg +***************************************************************************************************************************/ +#include +#include + +#include +#include +#include +#include +#include + +#include "controller_test.h" +#include "KeyboardEvent.h" + + +//json数据库 +#include +#include +#include +#include +#include +#include +#include +#include + +#define HOST "192.168.43.58" +#define PORT 1900 + +#define VEL_XY_STEP_SIZE 0.1 +#define VEL_Z_STEP_SIZE 0.1 +#define YAW_STEP_SIZE 0.08 +#define TRA_WINDOW 2000 +#define NODE_NAME "terminal_control" + +using namespace std; + +//即将发布的command +prometheus_msgs::ControlCommand Command_to_pub; +//轨迹容器 +std::vector posehistory_vector_; + + +float time_trajectory = 0.0; +// 轨迹追踪总时长,键盘控制时固定时长,指令输入控制可调 +float trajectory_total_time = 50.0; + + +//发布 +ros::Publisher move_pub; +ros::Publisher ref_trajectory_pub; +//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 函数声明 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +void mainloop1(); +void mainloop2(); +void generate_com(int Move_mode, float state_desired[4]); +void Draw_in_rviz(const prometheus_msgs::PositionReference& pos_ref, bool draw_trajectory); +void timerCallback(const ros::TimerEvent& e) +{ + cout << ">>>>>>>>>>>>>>>> Welcome to use Prometheus Terminal Control <<<<<<<<<<<<<<<<"<< endl; + cout << "ENTER key to control the drone: " <>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 主函数 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +int main(int argc, char **argv) +{ + ros::init(argc, argv, "terminal_control"); + ros::NodeHandle nh; + + // 【发布】 控制指令 + move_pub = nh.advertise("/prometheus/control_command", 10); + + // 【发布】 参考轨迹 + ref_trajectory_pub = nh.advertise("/prometheus/reference_trajectory", 10); + + //用于控制器测试的类,功能例如:生成圆形轨迹,8字轨迹等 + Controller_Test Controller_Test; // 打印参数 + Controller_Test.printf_param(); + + // 初始化命令 - Idle模式 电机怠速旋转 等待来自上层的控制指令 + Command_to_pub.Mode = prometheus_msgs::ControlCommand::Idle; + Command_to_pub.Command_ID = 0; + Command_to_pub.source = NODE_NAME; + Command_to_pub.Reference_State.Move_mode = prometheus_msgs::PositionReference::XYZ_POS; + Command_to_pub.Reference_State.Move_frame = prometheus_msgs::PositionReference::ENU_FRAME; + Command_to_pub.Reference_State.position_ref[0] = 0; + Command_to_pub.Reference_State.position_ref[1] = 0; + Command_to_pub.Reference_State.position_ref[2] = 0; + Command_to_pub.Reference_State.velocity_ref[0] = 0; + Command_to_pub.Reference_State.velocity_ref[1] = 0; + Command_to_pub.Reference_State.velocity_ref[2] = 0; + Command_to_pub.Reference_State.acceleration_ref[0] = 0; + Command_to_pub.Reference_State.acceleration_ref[1] = 0; + Command_to_pub.Reference_State.acceleration_ref[2] = 0; + Command_to_pub.Reference_State.yaw_ref = 0; + + //固定的浮点显示 + cout.setf(ios::fixed); + //setprecision(n) 设显示小数精度为n位 + cout<>>>>>>>>>>>>>>> Welcome to use Prometheus Terminal Control <<<<<<<<<<<<<<<<"<< endl; + cout << "Please choose the Remote Mode: 0 for command input control, 1 for keyboard input control"<> Remote_Mode; + if (Remote_Mode == 0) + { + cout << "Command input control mode"<>>>>>>>>>>>>>>> Welcome to use Prometheus Terminal Control <<<<<<<<<<<<<<<<"<< endl; + cout << "Please choose the Command.Mode: 0 for Idle, 1 for Takeoff, 2 for Hold, 3 for Land, 4 for Move, 5 for Disarm, 6 for User_Mode1, 7 for User_Mode2"<> Control_Mode; + + if(Control_Mode == prometheus_msgs::ControlCommand::Move) + { + cout << "Please choose the Command.Reference_State.Move_mode: 0 for XYZ_POS, 1 for XY_POS_Z_VEL, 2 for XY_VEL_Z_POS, 3 for XYZ_VEL, 5 for TRAJECTORY"<> Move_mode; + + if(Move_mode == prometheus_msgs::PositionReference::TRAJECTORY) + { + cout << "For safety, please move the drone near to the trajectory start point firstly!!!"<> Trjectory_mode; + cout << "Input the trajectory_total_time:"<> trajectory_total_time; + }else + { + cout << "Please choose the Command.Reference_State.Move_frame: 0 for ENU_FRAME, 1 for BODY_FRAME"<> Move_frame; + cout << "Please input the reference state [x y z yaw]: "<< endl; + cout << "setpoint_t[0] --- x [m] : "<< endl; + cin >> state_desired[0]; + cout << "setpoint_t[1] --- y [m] : "<< endl; + cin >> state_desired[1]; + cout << "setpoint_t[2] --- z [m] : "<< endl; + cin >> state_desired[2]; + cout << "setpoint_t[3] --- yaw [du] : "<< endl; + cin >> state_desired[3]; + } + + } + else if(Control_Mode == prometheus_msgs::ControlCommand::User_Mode1) + { + cout << "Please choose the Command.Reference_State.Move_mode: 0 for XYZ_POS, 1 for XY_POS_Z_VEL, 2 for XY_VEL_Z_POS, 3 for XYZ_VEL, 5 for TRAJECTORY"<> state_desired[0]; + cout << "setpoint_t[1] --- y [m] : "<< endl; + cin >> state_desired[1]; + cout << "setpoint_t[2] --- z [m] : "<< endl; + cin >> state_desired[2]; + cout << "setpoint_t[3] --- yaw [du] : "<< endl; + cin >> state_desired[3]; + } + } + else if(Control_Mode == 999) + { + Command_to_pub.header.stamp = ros::Time::now(); + Command_to_pub.Mode = prometheus_msgs::ControlCommand::Idle; + Command_to_pub.Command_ID = Command_to_pub.Command_ID + 1; + Command_to_pub.source = NODE_NAME; + Command_to_pub.Reference_State.yaw_ref = 999; + move_pub.publish(Command_to_pub); + Command_to_pub.Reference_State.yaw_ref = 0.0; + } + + switch (Control_Mode) + { + case prometheus_msgs::ControlCommand::Idle: + Command_to_pub.header.stamp = ros::Time::now(); + Command_to_pub.Mode = prometheus_msgs::ControlCommand::Idle; + Command_to_pub.Command_ID = Command_to_pub.Command_ID + 1; + Command_to_pub.source = NODE_NAME; + move_pub.publish(Command_to_pub); + break; + + case prometheus_msgs::ControlCommand::Takeoff: + Command_to_pub.header.stamp = ros::Time::now(); + Command_to_pub.Mode = prometheus_msgs::ControlCommand::Takeoff; + Command_to_pub.Command_ID = Command_to_pub.Command_ID + 1; + Command_to_pub.source = NODE_NAME; + move_pub.publish(Command_to_pub); + break; + + case prometheus_msgs::ControlCommand::Hold: + Command_to_pub.header.stamp = ros::Time::now(); + Command_to_pub.Mode = prometheus_msgs::ControlCommand::Hold; + Command_to_pub.Command_ID = Command_to_pub.Command_ID + 1; + Command_to_pub.source = NODE_NAME; + move_pub.publish(Command_to_pub); + break; + + case prometheus_msgs::ControlCommand::Land: + Command_to_pub.header.stamp = ros::Time::now(); + Command_to_pub.Mode = prometheus_msgs::ControlCommand::Land; + Command_to_pub.Command_ID = Command_to_pub.Command_ID + 1; + Command_to_pub.source = NODE_NAME; + move_pub.publish(Command_to_pub); + break; + + case prometheus_msgs::ControlCommand::Move: + if(Move_mode == prometheus_msgs::PositionReference::TRAJECTORY) + { + time_trajectory = 0.0; + + while(time_trajectory < trajectory_total_time) + { + Command_to_pub.header.stamp = ros::Time::now(); + Command_to_pub.Mode = prometheus_msgs::ControlCommand::Move; + Command_to_pub.Command_ID = Command_to_pub.Command_ID + 1; + Command_to_pub.source = NODE_NAME; + + if(Trjectory_mode == 0) + { + Command_to_pub.Reference_State = Controller_Test.Circle_trajectory_generation(time_trajectory); + }else if(Trjectory_mode == 1) + { + Command_to_pub.Reference_State = Controller_Test.Eight_trajectory_generation(time_trajectory); + }else if(Trjectory_mode == 2) + { + Command_to_pub.Reference_State = Controller_Test.Step_trajectory_generation(time_trajectory); + }else if(Trjectory_mode == 3) + { + Command_to_pub.Reference_State = Controller_Test.Line_trajectory_generation(time_trajectory); + } + + move_pub.publish(Command_to_pub); + time_trajectory = time_trajectory + 0.01; + + cout << "Trajectory tracking: "<< time_trajectory << " / " << trajectory_total_time << " [ s ]" <(rand()) / 10; + x_ori = state_desired[0] + 0.9761; + y_ori = state_desired[1] + 0.3562; + sendmsg["x_pos"] = x_ori; + sendmsg["y_pos"] = y_ori; + std::string pos_msg = Json::writeString(Json::StreamWriterBuilder(), sendmsg); + std::cout< 25 && time_trajectory <= 50){ + state_desired[1] += (time_trajectory-25)/5; + } + else if (time_trajectory > 50 && time_trajectory <= 75){ + state_desired[0] -= (time_trajectory-50)/5; + } + else if (time_trajectory > 75 && time_trajectory <= 100){ + state_desired[1] -= (time_trajectory-75)/5; + } + cout<<"******************************"<>>>>>>>>>>>>>>> Welcome to use Prometheus Terminal Control <<<<<<<<<<<<<<<<"<< endl; + cout << "ENTER key to control the drone: " < TRA_WINDOW){ + posehistory_vector_.pop_back(); + } + + nav_msgs::Path reference_trajectory; + reference_trajectory.header.stamp = ros::Time::now(); + reference_trajectory.header.frame_id = "world"; + reference_trajectory.poses = posehistory_vector_; + ref_trajectory_pub.publish(reference_trajectory); + }else + { + posehistory_vector_.clear(); + + nav_msgs::Path reference_trajectory; + reference_trajectory.header.stamp = ros::Time::now(); + reference_trajectory.header.frame_id = "world"; + reference_trajectory.poses = posehistory_vector_; + ref_trajectory_pub.publish(reference_trajectory); + } +}