-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmainwindow.h
175 lines (151 loc) · 4.19 KB
/
mainwindow.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QMessageBox>
#include <QStringList> //used to add item to QListView
#include <QStringListModel> //used to add item to QListView
#include <QDebug>
#include <QFileDialog>
#include <QFontDatabase>
#include <QCloseEvent>
#include <QScrollArea>
#include <sstream>
#include <list>
#include <fstream>
#include "creditwindow.h"
#include "sendertoserver.h"
using namespace std;
extern bool bResetMonitor;
// UTAustinVilla joint order
enum joints
{
_he1,
_he2,
_lae1,
_lae2,
_lae3,
_lae4,
_rae1,
_rae2,
_rae3,
_rae4,
_lle1,
_lle2,
_lle3,
_lle4,
_lle5,
_lle6,
_lle7,
_rle1,
_rle2,
_rle3,
_rle4,
_rle5,
_rle6,
_rle7,
JOINT_NUM
};
// The following is just an enum like the one above but only with different joint order. the
// joint order is according to the order specified by RoboNewbie team motion files.
enum joints_robonewbie
{
_he1_r,
_he2_r,
_lae1_r,
_lae2_r,
_lae3_r,
_lae4_r,
_lle1_r,
_lle2_r,
_lle3_r,
_lle4_r,
_lle5_r,
_lle6_r,
_rle1_r,
_rle2_r,
_rle3_r,
_rle4_r,
_rle5_r,
_rle6_r,
_rae1_r,
_rae2_r,
_rae3_r,
_rae4_r,
_lle7_r, // This is not considered by RoboNewbie team, I've added this to make it consistent with UTAustinvilla (95-10-7)
_rle7_r, // This is not considered by RoboNewbie team, I've added this to make it consistent with UTAustinvilla (95-10-7)
_JOINT_NUM_R
};
typedef struct _JointSet
{
int keyframeIndex;
double joints[JOINT_NUM];
double keyframeTime; //in seconds
} JointSet;
namespace Ui
{
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent=0);
~MainWindow();
shared_ptr<KeyFrame> createKeyframe(JointSet &js);
public slots:
void getupButtClicked();
void autoFallRecoverChBxStateChanged(int state);
void setBodyTypeButtClicked();
void resetMonitorButtClicked();
void playKeyframeButtClicked();
void SetJointsActivationState(bool state);
void addKeyFrameButtClicked();
void deleteKeyFrameButtClicked();
void moveKeyFrameUpButtClicked();
void moveKeyFrameDownButtClicked();
void keyFrameListViewItemClicked(QModelIndex qmIndex);
void UpdateKeyFrameSequenceEntry(joints jointIndex, double jointVal);
void UpdateKeyFrameSequenceEntry(double time);
void KeyframeTimeTextChanged(QString val);
void He1ValChanged(int val);
void He2ValChanged(int val);
void Lae1ValChanged(int val);
void Lae2ValChanged(int val);
void Lae3ValChanged(int val);
void Lae4ValChanged(int val);
void Rae1ValChanged(int val);
void Rae2ValChanged(int val);
void Rae3ValChanged(int val);
void Rae4ValChanged(int val);
void Lle1ValChanged(int val);
void Lle2ValChanged(int val);
void Lle3ValChanged(int val);
void Lle4ValChanged(int val);
void Lle5ValChanged(int val);
void Lle6ValChanged(int val);
void Lle7ValChanged(int val);
void Rle1ValChanged(int val);
void Rle2ValChanged(int val);
void Rle3ValChanged(int val);
void Rle4ValChanged(int val);
void Rle5ValChanged(int val);
void Rle6ValChanged(int val);
void Rle7ValChanged(int val);
//menu event handlers
void OpenFile();
void OpenFileRoboNewbieFormat(string fileName);
void SaveFileAs();
void SaveFile();
void SaveFileRoboNewbieFormat(string fileName);
joints_robonewbie ServerMsgJntOrderToRbNwBieJntOrder(joints j);
joints RbNwBieJntOrderToServerMsgJntOrder(joints_robonewbie jrb);
void About();
private:
Ui::MainWindow *ui;
QStringList keyFrameStrList; //each item of this list contains the name of one of the keyframes.
list<JointSet> keyFrameSequence; //each item of this list contains the set of joint commands for one keyframe
SenderToServer *sts; //an instance of SendToServer object used to communicate with rcssserver3d in parallel with
//the motion editor gui.
string motionFileName; //the name of the motion file opened/created by the user
};
#endif // MAINWINDOW_H