You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
1.6 KiB
82 lines
1.6 KiB
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <QMainWindow>
|
|
#include <QImage>
|
|
#include <QMutex>
|
|
#include <QTimer>
|
|
#include "ui_mainwindow.h"
|
|
#include "../include/joystick.h"
|
|
#include "../include/qnode.hpp"
|
|
#include "../include/dashboard.h"
|
|
#include <sensor_msgs/BatteryState.h>
|
|
|
|
using namespace cv;
|
|
namespace Ui {
|
|
class MainWindow;
|
|
}
|
|
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit MainWindow(int argc, char **argv, QWidget *parent = 0);
|
|
~MainWindow();
|
|
enum {
|
|
upleft = 0,
|
|
up,
|
|
upright,
|
|
left,
|
|
stop,
|
|
right,
|
|
downleft,
|
|
down,
|
|
downright
|
|
};
|
|
|
|
|
|
|
|
public slots:
|
|
void slot_keyboard_control();
|
|
//void slot_command_control(int linear, int angular);
|
|
void slot_rockKeyChange(int);
|
|
void slot_speed_x(double x);
|
|
void slot_speed_th(double th);
|
|
void slot_batteryState(sensor_msgs::BatteryState);
|
|
void Slider_raw_valueChanged(int v);
|
|
void Slider_linear_valueChanged(int v);
|
|
void importFrame();//read video
|
|
void slot_show_image(const QImage& image);//added
|
|
|
|
|
|
private slots:
|
|
void on_Stop_receive_clicked();
|
|
|
|
private slots:
|
|
void on_Open_receive_clicked();
|
|
|
|
private:
|
|
Ui::MainWindow *ui;
|
|
QNode qnode;
|
|
JoyStick *rock_widget;
|
|
DashBoard *m_DashBoard_x;
|
|
DashBoard *m_DashBoard_th;
|
|
|
|
VideoCapture capture;
|
|
QTimer *timer;
|
|
Mat frame;
|
|
bool isCamerea = 0;
|
|
|
|
void initUis();
|
|
void setBtnStyles();
|
|
void connections();
|
|
|
|
QImage qimage_;//added
|
|
mutable QMutex qimage_mutex_;//added
|
|
|
|
|
|
};
|
|
|
|
#endif // MAINWINDOW_H
|