From 33ef5f9305086595ac8cd965ceeeb162ea600e08 Mon Sep 17 00:00:00 2001 From: Dingzijian <1418626018@qq.com> Date: Mon, 3 Jul 2023 02:36:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E5=A4=B4=E6=96=87=E4=BB=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BA=86=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app_ui/include/dialog/commondialog.h | 20 ++++++++- .../src/app_ui/include/dialog/directcontrol.h | 21 ++++++++- .../src/app_ui/include/dialog/messagebox.h | 31 +++++++++---- .../src/app_ui/include/dialog/missionopen.h | 33 ++++++++++---- .../src/app_ui/include/dialog/missionset.h | 25 +++++++---- .../src/app_ui/include/dialog/robortset.h | 32 ++++++++------ .../src/app_ui/include/dialog/robortupdate.h | 29 ++++++++----- .../src/app_ui/include/main/mainwindow.h | 23 +++++++--- .../src/app_ui/include/main/missionwindow.h | 34 +++++++++++---- .../app_ui/include/node/direct_control_node.h | 13 ++++++ .../src/app_ui/include/node/manage_node.h | 13 ++++++ .../include/node/tcp_port_receive_node.h | 13 ++++++ .../app_ui/include/node/tcp_port_send_node.h | 13 ++++++ .../include/node/udp_port_receive_node.h | 13 ++++++ .../app_ui/include/node/udp_port_send_node.h | 14 ++++++ .../src/app_ui/include/robort/ground_robort.h | 43 ++++++++++++------- .../src/app_ui/include/robort/sky_robort.h | 41 +++++++++++------- .../src/app_ui/include/tool/myviz.h | 13 +++++- .../src/app_ui/include/tool/ping.h | 19 +++++++- .../src/app_ui/include/tool/plan.hpp | 13 ++++++ .../src/app_ui/include/tool/sqlite.h | 13 ++++++ .../tool/transmission/receive_transform.hpp | 16 ++++++- .../tool/transmission/send_transform.hpp | 13 ++++++ .../src/app_ui/include/tool/video.h | 21 +++++++-- 24 files changed, 417 insertions(+), 102 deletions(-) diff --git a/src/客户端代码/src/app_ui/include/dialog/commondialog.h b/src/客户端代码/src/app_ui/include/dialog/commondialog.h index 665c2986..7bf2963a 100644 --- a/src/客户端代码/src/app_ui/include/dialog/commondialog.h +++ b/src/客户端代码/src/app_ui/include/dialog/commondialog.h @@ -1,3 +1,17 @@ +/** + * ************************************************************************ + * @file commondialog.h + * @author 丁梓坚 + * @brief CommonDialog窗口类,用于显示按键按后的效果 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ + #ifndef COMMONDIALOG_H #define COMMONDIALOG_H @@ -16,13 +30,15 @@ public: explicit CommonDialog(QWidget *parent = 0); ~CommonDialog(); - void setContent(QString); + void setContent(QString); //设置窗口显示内容 private: + + //窗口控件 QDialogButtonBox *buttonBox; QLabel *content; - void confirm(); + void confirm(); //点击确定后delete此窗口 }; #endif // COMMONDIALOG_H diff --git a/src/客户端代码/src/app_ui/include/dialog/directcontrol.h b/src/客户端代码/src/app_ui/include/dialog/directcontrol.h index 91426d44..6a4a1496 100644 --- a/src/客户端代码/src/app_ui/include/dialog/directcontrol.h +++ b/src/客户端代码/src/app_ui/include/dialog/directcontrol.h @@ -1,3 +1,17 @@ +/** + * ************************************************************************ + * @file directcontrol.h + * @author 丁梓坚 + * @brief DirectControl窗口类,负责显示手动控制机器人的操作 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ + #ifndef DIRECTCONTROL_H #define DIRECTCONTROL_H @@ -20,17 +34,22 @@ public: explicit DirectControl(QWidget *parent = 0); ~DirectControl(); - void direct_control_send(); + void direct_control_send(); //发送信息到控制节点 private: + + //窗口控件 double linear, angular; QDialogButtonBox *buttonBox; QLabel *robortname; + + //手动控制节点 DirectControlNode *direct_control_node; void reject(); protected: + //按键按和释放消息处理 void keyPressEvent(QKeyEvent *event); void keyReleaseEvent(QKeyEvent *event); }; diff --git a/src/客户端代码/src/app_ui/include/dialog/messagebox.h b/src/客户端代码/src/app_ui/include/dialog/messagebox.h index 9b99cc22..ab7205ff 100644 --- a/src/客户端代码/src/app_ui/include/dialog/messagebox.h +++ b/src/客户端代码/src/app_ui/include/dialog/messagebox.h @@ -1,3 +1,17 @@ +/** + * ************************************************************************ + * @file messagebox.h + * @author 丁梓坚 + * @brief MessageBox窗口类,MissonWinodw的成员,负责在任务主窗口显示机器人等信息 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ + #ifndef MESSAGEBOX_H #define MESSAGEBOX_H @@ -8,9 +22,6 @@ #include #include -namespace Ui { -class MessageBox; -} class MessageBox : public QDialog { @@ -20,27 +31,29 @@ public: explicit MessageBox(QWidget *parent); ~MessageBox(); - QString robortmission; - Q_SIGNALS: - //发送数据的信号,不需要实体函数,在头文件定义就可以 + //信号函数 void sendData(std::string, int, std::string); private: + + QString robortmission; + + //窗口控件 QLabel *mission_robort; QLabel *people_find; QTextEdit *mission_page; QTextEdit *people_page; - Ui::MessageBox *ui; void accept(); void reject(); protected: - void paintEvent(QPaintEvent *event) override; + void paintEvent(QPaintEvent *event) override; //绘制MessageBox的边框 private Q_SLOTS: - void get_connect_robort(QString);//得到数据的槽函数 + //槽函数 + void get_connect_robort(QString); //接收机器人是否连接成功的信息 }; #endif // MESSAGEBOX_H diff --git a/src/客户端代码/src/app_ui/include/dialog/missionopen.h b/src/客户端代码/src/app_ui/include/dialog/missionopen.h index 48883c32..e4080088 100644 --- a/src/客户端代码/src/app_ui/include/dialog/missionopen.h +++ b/src/客户端代码/src/app_ui/include/dialog/missionopen.h @@ -1,3 +1,17 @@ +/** + * ************************************************************************ + * @file missionopen.h + * @author 丁梓坚 + * @brief MissionOpen窗口类,负责打开任务对话框设置,完成后将打开MissionWindow对象 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ + #ifndef MISSIONOPEN_H #define MISSIONOPEN_H @@ -10,11 +24,6 @@ #include #include - -namespace Ui { -class MissionOpen; -} - class MissionOpen : public QDialog { Q_OBJECT @@ -22,22 +31,28 @@ class MissionOpen : public QDialog public: explicit MissionOpen(QWidget *parent = 0); ~MissionOpen(); - QString name; //任务名称 Q_SIGNALS: - void sendData(QString); - void sendCloseSignal(); + //信号函数 + void sendData(QString); //连接missionwindow的getData()槽函数,创建missionwindow窗口 + void sendCloseSignal(); //连接mainwindow的getCloseSignal槽函数,隐藏mainwindow窗口 private: + + QString name; //任务名称 + + //窗口控件 QDialogButtonBox *buttonBox; QLabel *missionname; QComboBox *inputtype; - Ui::MissionOpen *ui; + + //任务子窗口 MissionWindow *missionwindow; void accept(); void reject(); + //基本窗口设置 void basicFrameSet(); }; diff --git a/src/客户端代码/src/app_ui/include/dialog/missionset.h b/src/客户端代码/src/app_ui/include/dialog/missionset.h index 7fa3636a..9dd5469e 100644 --- a/src/客户端代码/src/app_ui/include/dialog/missionset.h +++ b/src/客户端代码/src/app_ui/include/dialog/missionset.h @@ -1,3 +1,17 @@ +/** + * ************************************************************************ + * @file missionset.h + * @author 丁梓坚 + * @brief MissionSet窗口类,负责设置任务对话框设置,主要对数据库进行处理 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ + #ifndef MISSIONSET_H #define MISSIONSET_H @@ -7,10 +21,6 @@ #include #include -namespace Ui { -class MissionSet; -} - class MissionSet : public QDialog { Q_OBJECT @@ -20,19 +30,18 @@ public: ~MissionSet(); private: - QDialogButtonBox *buttonBox; + //窗口控件 + QDialogButtonBox *buttonBox; QLabel *missionname; QLabel *missiontype; - QLineEdit *inputname; QComboBox *inputtype; - Ui::MissionSet *ui; - void accept(); void reject(); + //基本窗口设置 void basicFrameSet(); }; diff --git a/src/客户端代码/src/app_ui/include/dialog/robortset.h b/src/客户端代码/src/app_ui/include/dialog/robortset.h index 8b11adfe..f6e967e6 100644 --- a/src/客户端代码/src/app_ui/include/dialog/robortset.h +++ b/src/客户端代码/src/app_ui/include/dialog/robortset.h @@ -1,3 +1,17 @@ +/** + * ************************************************************************ + * @file robortset.h + * @author 丁梓坚 + * @brief RobortSet窗口类,当创建机器人时显示此对话框 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ + #ifndef ROBORTSET_H #define ROBORTSET_H @@ -7,10 +21,6 @@ #include #include -namespace Ui { -class RobortSet; -} - class RobortSet : public QDialog { Q_OBJECT @@ -19,25 +29,23 @@ public: explicit RobortSet(QWidget *parent = 0); ~RobortSet(); - QString robortmission; - Q_SIGNALS: - //发送数据的信号,不需要实体函数,在头文件定义就可以 - void sendData(std::string, int, std::string); + //信号函数 + void sendData(std::string, int, std::string); //告知Mission类机器人设置完成 private: - QDialogButtonBox *buttonBox; + QString robortmission; //机器人所属任务 + + //窗口控件 + QDialogButtonBox *buttonBox; QLabel *robortname; QLabel *roborttype; QLabel *robortip; - QLineEdit *inputname; QComboBox *inputtype; QLineEdit *inputip; - Ui::RobortSet *ui; - void accept(); void reject(); diff --git a/src/客户端代码/src/app_ui/include/dialog/robortupdate.h b/src/客户端代码/src/app_ui/include/dialog/robortupdate.h index 389ba4ce..da7bcb71 100644 --- a/src/客户端代码/src/app_ui/include/dialog/robortupdate.h +++ b/src/客户端代码/src/app_ui/include/dialog/robortupdate.h @@ -1,3 +1,17 @@ +/** + * ************************************************************************ + * @file robortupdate.h + * @author 丁梓坚 + * @brief RobortSet窗口类,当更新机器人信息时显示此对话框 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ + #ifndef ROBORTUPDATE_H #define ROBORTUPDATE_H @@ -9,10 +23,6 @@ #include "../dialog/commondialog.h" -namespace Ui { -class RobortUpdate; -} - class RobortUpdate : public QDialog { Q_OBJECT @@ -20,22 +30,21 @@ class RobortUpdate : public QDialog public: explicit RobortUpdate(QWidget *parent = 0); ~RobortUpdate(); - void getRobortID(int); + + void getRobortID(int); //获取机器人id号 private: - QDialogButtonBox *buttonBox; + //窗口控件 + QDialogButtonBox *buttonBox; QLabel *robortname; QLabel *roborttype; QLabel *robortip; - QLineEdit *inputname; QComboBox *inputtype; QLineEdit *inputip; - CommonDialog *commondialog; - - Ui::RobortUpdate *ui; + CommonDialog *commondialog; //更新完成后显示此对话框 void accept(); void reject(); diff --git a/src/客户端代码/src/app_ui/include/main/mainwindow.h b/src/客户端代码/src/app_ui/include/main/mainwindow.h index 5f0b3c6b..cc2fb5e8 100644 --- a/src/客户端代码/src/app_ui/include/main/mainwindow.h +++ b/src/客户端代码/src/app_ui/include/main/mainwindow.h @@ -1,3 +1,17 @@ +/** + * ************************************************************************ + * @file mainwindow.h + * @author 丁梓坚 + * @brief MainWindow窗口类,负责欢迎界面设置 + * @version 1.0 + * @date 2023-06-28 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ + #ifndef MAINWINDOW_H #define MAINWINDOW_H @@ -20,10 +34,6 @@ #include #include -namespace Ui { -class MainWindow; -} - class MainWindow : public QMainWindow { Q_OBJECT @@ -33,19 +43,20 @@ public: ~MainWindow(); private: - Ui::MainWindow *ui; QProcess *process; //启动roscore QPushButton *startbutton; //创建任务按钮 QPushButton *openbutton; //打开任务按钮 MissionSet *missionset; //任务设置窗口 MissionOpen *missionopen; //任务打开窗口 - //基本窗口设置 + //窗口控件 QMenuBar *menubar; QWidget *centralwidget; QStatusBar *statusbar; QFrame *frame; QGridLayout *gridLayout; + + //基本窗口设置 void basicFrameSet(); private Q_SLOTS: diff --git a/src/客户端代码/src/app_ui/include/main/missionwindow.h b/src/客户端代码/src/app_ui/include/main/missionwindow.h index b66d99f8..da5ee394 100644 --- a/src/客户端代码/src/app_ui/include/main/missionwindow.h +++ b/src/客户端代码/src/app_ui/include/main/missionwindow.h @@ -1,3 +1,16 @@ +/** + * ************************************************************************ + * @file missionwindow.h + * @author 丁梓坚 + * @brief MissionWindow窗口类,是软件使用的主窗口 + * @version 1.0 + * @date 2023-06-29 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ #ifndef MISSIONWINDOW_H #define MISSIONWINDOW_H @@ -27,10 +40,6 @@ #include -namespace Ui { -class MissionWindow; -} - class MissionWindow : public QWidget { Q_OBJECT @@ -48,11 +57,11 @@ public: GroundRobort *tab_ground; Q_SIGNALS: + //信号函数 void sendRobortData(std::string, int, int, std::string); private: - Ui::MissionWindow *ui; - MyViz *myviz; + int type; std::vector robort; std::string name; @@ -62,16 +71,25 @@ private: QPushButton *StartMission; QPushButton *TerminateMission; + //用于显示雷达扫描图像 + MyViz *myviz; + + //显示任务执行信息等情况 MessageBox *message; + + //创建机器人时显示此对话框 RobortSet *robortset; + + //信息发送和接收节点 TcpReceiveNode *tcpreceivenode; UdpReceiveNode *udpreceivenode; UdpSendNode *udpsendnode; ManageNode *managenode; private Q_SLOTS: - void getData(QString); - void getData(std::string, int, std::string); + //槽函数 + void getData(QString); //接收MainWindow窗口的信息,从数据库查找相关任务信息 + void getData(std::string, int, std::string); //创建新机器人后显示机器人内容,便于后期可能的扩展 void toRobortSet(); void startMission(); void terminateMission(); diff --git a/src/客户端代码/src/app_ui/include/node/direct_control_node.h b/src/客户端代码/src/app_ui/include/node/direct_control_node.h index f648fdca..d31eab05 100644 --- a/src/客户端代码/src/app_ui/include/node/direct_control_node.h +++ b/src/客户端代码/src/app_ui/include/node/direct_control_node.h @@ -1,3 +1,16 @@ +/** + * ************************************************************************ + * @file direct_control_node.h + * @author 丁梓坚 + * @brief DirectControlNode节点类,负责发送手动控制信息到unitree_legged_sdk,再发送到机器人端执行 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ #ifndef DIRECT_CONTROL_NODE_H #define DIRECT_CONTROL_NODE_H diff --git a/src/客户端代码/src/app_ui/include/node/manage_node.h b/src/客户端代码/src/app_ui/include/node/manage_node.h index 1a8be164..1bd756fe 100644 --- a/src/客户端代码/src/app_ui/include/node/manage_node.h +++ b/src/客户端代码/src/app_ui/include/node/manage_node.h @@ -1,3 +1,16 @@ +/** + * ************************************************************************ + * @file manage_node.h + * @author 丁梓坚 + * @brief ManageNode节点类,负责对目标进行任务队列规划 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ #ifndef MANAGE_NODE_H #define MANAGE_NODE_H diff --git a/src/客户端代码/src/app_ui/include/node/tcp_port_receive_node.h b/src/客户端代码/src/app_ui/include/node/tcp_port_receive_node.h index 892b6c9b..73d49e08 100644 --- a/src/客户端代码/src/app_ui/include/node/tcp_port_receive_node.h +++ b/src/客户端代码/src/app_ui/include/node/tcp_port_receive_node.h @@ -1,3 +1,16 @@ +/** + * ************************************************************************ + * @file tcp_port_receive_node.h + * @author 丁梓坚 + * @brief TcpReceiveNode节点类,负责TCP/IP通信 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ #ifndef TCP_PORT_RECEIVE_NODE_H #define TCP_PORT_RECEIVE_NODE_H diff --git a/src/客户端代码/src/app_ui/include/node/tcp_port_send_node.h b/src/客户端代码/src/app_ui/include/node/tcp_port_send_node.h index 6a7e8118..f7298ee1 100644 --- a/src/客户端代码/src/app_ui/include/node/tcp_port_send_node.h +++ b/src/客户端代码/src/app_ui/include/node/tcp_port_send_node.h @@ -1,3 +1,16 @@ +/** + * ************************************************************************ + * @file tcp_port_send_node.h + * @author 丁梓坚,王京 + * @brief TcpSendNode节点类,负责TCP/IP通信 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ #ifndef TCP_PORT_SEND_NODE_H #define TCP_PORT_SEND_NODE_H diff --git a/src/客户端代码/src/app_ui/include/node/udp_port_receive_node.h b/src/客户端代码/src/app_ui/include/node/udp_port_receive_node.h index 848f929c..148a81e7 100644 --- a/src/客户端代码/src/app_ui/include/node/udp_port_receive_node.h +++ b/src/客户端代码/src/app_ui/include/node/udp_port_receive_node.h @@ -1,3 +1,16 @@ +/** + * ************************************************************************ + * @file udp_port_receive_node.h + * @author 丁梓坚 + * @brief UdpReceiveNode节点类,负责UDP/IP通信 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ #ifndef UDP_PORT_RECEIVE_NODE_H #define UDP_PORT_RECEIVE_NODE_H diff --git a/src/客户端代码/src/app_ui/include/node/udp_port_send_node.h b/src/客户端代码/src/app_ui/include/node/udp_port_send_node.h index 795e86ed..1f9c579f 100644 --- a/src/客户端代码/src/app_ui/include/node/udp_port_send_node.h +++ b/src/客户端代码/src/app_ui/include/node/udp_port_send_node.h @@ -1,3 +1,17 @@ +/** + * ************************************************************************ + * @file udp_port_send_node.h + * @author 丁梓坚 + * @brief UdpSendNode节点类,负责UDP/IP通信 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ + #ifndef UDP_PORT_SEND_NODE_H #define UDP_PORT_SEND_NODE_H diff --git a/src/客户端代码/src/app_ui/include/robort/ground_robort.h b/src/客户端代码/src/app_ui/include/robort/ground_robort.h index fcf0d33b..8c19b6ff 100644 --- a/src/客户端代码/src/app_ui/include/robort/ground_robort.h +++ b/src/客户端代码/src/app_ui/include/robort/ground_robort.h @@ -1,3 +1,17 @@ +/** + * ************************************************************************ + * @file ground_robort.h + * @author 丁梓坚 + * @brief GroundRobort界面类,负责显示四足机器人信息 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ + #ifndef GROUND_ROBORT_H #define GROUND_ROBORT_H @@ -24,10 +38,6 @@ #include #include -namespace Ui { -class GroundRobort; -} - class GroundRobort : public QWidget { Q_OBJECT @@ -36,6 +46,7 @@ public: explicit GroundRobort(QWidget *parent = 0); ~GroundRobort(); + //测试是否成功连接 Ping* m_ping; QThread* m_pingThread; @@ -45,36 +56,38 @@ private: std::string name; int id; + //基本控件 QPushButton *join_mission; QPushButton *stop_mission; - QPushButton *directcontrol_button; DirectControl *directcontrol; - QPushButton *modify_settings; QPushButton *delete_robort; - QTextEdit *robort_name; QTextEdit *robort_type; QTextEdit *robort_ip; QTextEdit *robort_ping; + //更新机器人信息 RobortUpdate *robortupdate; + //通信节点 UdpReceiveNode *udpreceivenode; UdpSendNode *udpsendnode; Q_SIGNALS: - void send_connected_robort(QString); + //信号函数 + void send_connected_robort(QString); //发送是否连接成功信息到MissionWindow类 public Q_SLOTS: - void getRobortData(std::string, int, int, std::string); - void directControl(); - void getPing(QString); - void deleteThisRobort(); - void updateThisRobort(); - void joinMission(); - void stopMission(); + //槽函数 + void getRobortData(std::string, int, int, std::string); //接收MissionWindow从数据库中查找到到机器人相关信息 + void directControl(); //直接控制 + void getPing(QString); //判断连接情况 + void deleteThisRobort(); //从数据库删除此机器人信息 + void updateThisRobort(); //从数据库更新此机器人信息 + void joinMission(); //加入任务 + void stopMission(); //停止任务 }; diff --git a/src/客户端代码/src/app_ui/include/robort/sky_robort.h b/src/客户端代码/src/app_ui/include/robort/sky_robort.h index d930edde..f66f27eb 100644 --- a/src/客户端代码/src/app_ui/include/robort/sky_robort.h +++ b/src/客户端代码/src/app_ui/include/robort/sky_robort.h @@ -1,3 +1,16 @@ +/** + * ************************************************************************ + * @file sky_robort.h + * @author 丁梓坚 + * @brief SkyRobort界面类,负责显示无人机信息 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ #ifndef SKY_ROBORT_H #define SKY_ROBORT_H @@ -24,10 +37,6 @@ #include #include -namespace Ui { -class SkyRobort; -} - class SkyRobort : public QWidget { Q_OBJECT @@ -36,6 +45,7 @@ public: explicit SkyRobort(QWidget *parent = 0); ~SkyRobort(); + //测试是否成功连接 Ping* m_ping; QThread* m_pingThread; @@ -45,36 +55,37 @@ private: std::string name; int id; + //基本控件 QPushButton *join_mission; QPushButton *stop_mission; - QPushButton *directcontrol_button; DirectControl *directcontrol; - QPushButton *modify_settings; QPushButton *delete_robort; - QTextEdit *robort_name; QTextEdit *robort_type; QTextEdit *robort_ip; QTextEdit *robort_ping; + //更新机器人信息 RobortUpdate *robortupdate; + //通信节点 UdpReceiveNode *udpreceivenode; UdpSendNode *udpsendnode; Q_SIGNALS: - void send_connected_robort(QString); + //信号函数 + void send_connected_robort(QString); //发送是否连接成功信息到MissionWindow类 public Q_SLOTS: - void getRobortData(std::string, int, int, std::string); - void directControl(); - void getPing(QString); - void deleteThisRobort(); - void updateThisRobort(); - void joinMission(); - void stopMission(); + void getRobortData(std::string, int, int, std::string); //接收MissionWindow从数据库中查找到到机器人相关信息 + void directControl(); //直接控制 + void getPing(QString); //判断连接情况 + void deleteThisRobort(); //从数据库删除此机器人信息 + void updateThisRobort(); //从数据库更新此机器人信息 + void joinMission(); //加入任务 + void stopMission(); //停止任务 }; #endif // SKY_ROBORT_H diff --git a/src/客户端代码/src/app_ui/include/tool/myviz.h b/src/客户端代码/src/app_ui/include/tool/myviz.h index 75654882..87a8c425 100644 --- a/src/客户端代码/src/app_ui/include/tool/myviz.h +++ b/src/客户端代码/src/app_ui/include/tool/myviz.h @@ -26,6 +26,17 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +/** + * ************************************************************************ + * @file myviz.h + * @author 丁梓坚 + * @brief MyViz类,主要重用了代码框架,去除了不必要的功能,并添加了需要显示的内容 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + */ + #ifndef MYVIZ_H #define MYVIZ_H @@ -35,7 +46,7 @@ namespace rviz { class Display; class RenderPanel; -class VisualizationManager;; +class VisualizationManager; } // BEGIN_TUTORIAL diff --git a/src/客户端代码/src/app_ui/include/tool/ping.h b/src/客户端代码/src/app_ui/include/tool/ping.h index 9510423a..413867ec 100644 --- a/src/客户端代码/src/app_ui/include/tool/ping.h +++ b/src/客户端代码/src/app_ui/include/tool/ping.h @@ -1,3 +1,17 @@ +/** + * ************************************************************************ + * @file ping.h + * @author 丁梓坚 + * @brief Ping类,用于测试指定IP是否能够连接 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ + #ifndef PING_H #define PING_H @@ -26,10 +40,11 @@ public: void init(QString); Q_SIGNALS: - void sendPing(QString); + //信号函数 + void sendPing(QString); //发送结果信息到其他类 private Q_SLOTS: - int getResult(); + int getResult(); //得到结果信息 }; diff --git a/src/客户端代码/src/app_ui/include/tool/plan.hpp b/src/客户端代码/src/app_ui/include/tool/plan.hpp index faf2466a..3cff35d9 100644 --- a/src/客户端代码/src/app_ui/include/tool/plan.hpp +++ b/src/客户端代码/src/app_ui/include/tool/plan.hpp @@ -1,3 +1,16 @@ +/** + * ************************************************************************ + * @file plan.hpp + * @author 王京 + * @brief Plan类,负责任务规划 + * @version 1.0 + * @date 2023-06-29 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ #ifndef PLAN_H #define PLAN_H #include diff --git a/src/客户端代码/src/app_ui/include/tool/sqlite.h b/src/客户端代码/src/app_ui/include/tool/sqlite.h index 5fcaf9df..dccdb512 100644 --- a/src/客户端代码/src/app_ui/include/tool/sqlite.h +++ b/src/客户端代码/src/app_ui/include/tool/sqlite.h @@ -1,3 +1,16 @@ +/** + * ************************************************************************ + * @file sqlite.h + * @author 洪扬 + * @brief sqlite类,负责数据库相关操作 + * @version 1.0 + * @date 2023-06-27 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ #ifndef SQLITE_H #define SQLITE_H diff --git a/src/客户端代码/src/app_ui/include/tool/transmission/receive_transform.hpp b/src/客户端代码/src/app_ui/include/tool/transmission/receive_transform.hpp index 451ed431..3c952dd4 100644 --- a/src/客户端代码/src/app_ui/include/tool/transmission/receive_transform.hpp +++ b/src/客户端代码/src/app_ui/include/tool/transmission/receive_transform.hpp @@ -1,3 +1,17 @@ +/** + * ************************************************************************ + * @file receive_transform.hpp + * @author 丁梓坚 + * @brief json转ROS信息 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ + #ifndef RECEIVE_TRANSFORM_HPP #define RECEIVE_TRANSFORM_HPP @@ -20,7 +34,7 @@ std::string get_message_type(std::string &s) } int goal_receive_transform(geometry_msgs::PoseStamped &goal, std::string &s) -{ + const auto& j = json::parse(s, nullptr, false); diff --git a/src/客户端代码/src/app_ui/include/tool/transmission/send_transform.hpp b/src/客户端代码/src/app_ui/include/tool/transmission/send_transform.hpp index 1b03ddaf..1f9ec18a 100644 --- a/src/客户端代码/src/app_ui/include/tool/transmission/send_transform.hpp +++ b/src/客户端代码/src/app_ui/include/tool/transmission/send_transform.hpp @@ -1,3 +1,16 @@ +/** + * ************************************************************************ + * @file send_transform.hpp + * @author 丁梓坚 + * @brief ROS信息转json + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ #ifndef SEND_TRANSFORM_HPP #define SEND_TRANSFORM_HPP diff --git a/src/客户端代码/src/app_ui/include/tool/video.h b/src/客户端代码/src/app_ui/include/tool/video.h index 34599211..56575b88 100644 --- a/src/客户端代码/src/app_ui/include/tool/video.h +++ b/src/客户端代码/src/app_ui/include/tool/video.h @@ -1,3 +1,16 @@ +/** + * ************************************************************************ + * @file video.h + * @author 王京,丁梓坚 + * @brief Video类,负责图像传输 + * @version 1.0 + * @date 2023-06-30 + * ************************************************************************ + * + * @copyright Copyright (c) 2023 XXX + * For study and research only, no reprinting + * ************************************************************************ + */ #ifndef VIDEO_H #define VIDEO_H @@ -26,11 +39,13 @@ public: void init(QString, int); protected: - void paintEvent(QPaintEvent *event) override; + + void paintEvent(QPaintEvent *event) override; //绘制Video的边框 private Q_SLOTS: - void openCamera(); - void closeCamera(); + //槽函数 + void openCamera(); //接收从机器人窗口发来的消息 + void closeCamera(); //接收从机器人窗口发来的消息 };