-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathamurcore.h
107 lines (84 loc) · 2.63 KB
/
amurcore.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*
* Copyright (c) 2020 ARDev1161 <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef AmurCore_H
#define AmurCore_H
#undef main
#include "pch.h"
#define NO_PICTURE "./data/images/no_picture.jpeg"
#define SOURCE_STREAM 0
//#define SOURCE_STREAM "udpsrc port=1488 ! application/x-rtp, encoding-name=H264 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! appsink"
namespace Ui {
class AmurCore;
}
class AmurCore : public QMainWindow
{
Q_OBJECT
Ui::AmurCore *ui;
QTimer *tmrTimer;
QString *hostName;
QString statusMessage = "No robot connected";
const char *configName = "AmurCore.cfg";
ConfigProcessor *config;
int arpPort = 11111;
int grpcPort = 7777;
QString arpHeader = "AMUR";
std::string address_mask = "0.0.0.0:" + std::to_string(grpcPort);
// TODO - add vector with robots id
std::shared_ptr<NetworkController> network;
std::shared_ptr<RobotRepository> repo;
SpeechDialog *speechDialog;
ConnectDialog *connectDialog;
JoystickDialog *joystickDialog;
AMUR::AmurControls *controls;
AMUR::AmurSensors *sensors;
Joystick *joyThread;
JoyState *joyState;
Logic *amurLogic;
CamSettingsHolder *camHolder;
VideoCapture capture;
Mat sourceMat;
Mat undistortedMat;
Mat outputMat;
int loopTime = 50;
public:
explicit AmurCore(QWidget *parent = nullptr);
~AmurCore();
protected:
void resizeEvent(QResizeEvent *e) override;
private slots:
void frameUpdate();
void calibDialogOpen();
void speechDialogOpen();
void connectDialogOpen();
void joystickDialogOpen();
void fetchJoystickId();
void amurHalt();
void amurReboot();
private:
void fillFieldsByConfig();
void startCap();
void startTimer();
void initialize();
void connMenu();
void worker();
void outMat(Mat &toOut);
void undistortMat(Mat &inMat, Mat &outMat);
signals:
void timeout();
};
#endif // AmurCore_H