-
Notifications
You must be signed in to change notification settings - Fork 3
/
sim.hh
134 lines (120 loc) · 3.26 KB
/
sim.hh
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
#ifndef SIM_HH
#define SIM_HH 1
#include <string>
#include <vector>
#include "./comm/udp_client_server.hh"
#include "./XPlane/XPdata.hh"
#include "./XPlane/XPaerangles.hh"
#include "./XPlane/XPatmosphere.hh"
#include "./XPlane/XPattitude.hh"
#include "./XPlane/XPgearbrakes.hh"
#include "./XPlane/XPgps.hh"
#include "./XPlane/XPloads.hh"
#include "./XPlane/XPpqr.hh"
#include "./XPlane/XPspeeds.hh"
#include "./XPlane/XPthrottela.hh"
#include "./XPlane/XPthrottelc.hh"
#include "./XPlane/XPxyz.hh"
#include "./XPlane/XPyoke.hh"
#include "./environment/gravity.hh"
enum Simulator{
NONE,
XPLANE};
class Sim
{
private:
std::string _ip;
Simulator _simulator;
std::vector<char> _datagram;
XPdataVector vout;
udp_server _server;
udp_client _client;
int _readDatagram();
float _aoa, _aos;
float _atm_pressure;
float _roll, _pitch, _yaw;
float _gear, _brakew, _brakel, _braker;
float _latitude, _longitude, _altitude_msl;
float _gx, _gy, _gz;
float _ax, _ay, _az;
float _wx, _wy, _wz;
float _vkias;
float _t1c, _t2c, _t3c, _t4c, _t5c, _t6c, _t7c, _t8c;
float _t1a, _t2a, _t3a, _t4a, _t5a, _t6a, _t7a, _t8a;
float _x, _y, _z;
float _ve, _vn, _vu;
float _elevc, _ailc, _rudc;
Gravity _gravity;
public:
Sim();
Sim(std::string, int, int, Simulator);
~Sim();
void connect();
void readFromSim();
void sendToSim();
Simulator get_simulator();
void clearvout();
float get_aoa();
float get_aos();
float get_atm_pressure();
float get_roll();
float get_pitch();
float get_yaw();
float get_gear();
float get_brakew();
float get_brakel();
float get_braker();
float get_latitude();
float get_longitude();
float get_altitude_msl();
float get_gx();
float get_gy();
float get_gz();
float get_ax();
float get_ay();
float get_az();
float get_wx();
float get_wy();
float get_wz();
float get_vkias();
float get_t1c();
float get_t2c();
float get_t3c();
float get_t4c();
float get_t5c();
float get_t6c();
float get_t7c();
float get_t8c();
float get_t1a();
float get_t2a();
float get_t3a();
float get_t4a();
float get_t5a();
float get_t6a();
float get_t7a();
float get_t8a();
float get_x();
float get_y();
float get_z();
float get_ve();
float get_vn();
float get_vu();
float get_elevc();
float get_ailc();
float get_rudc();
void set_tc(float, float, float, float,
float, float, float, float);
void visit(XPaerangles *);
void visit(XPatmosphere *);
void visit(XPattitude *);
void visit(XPgearbrakes *);
void visit(XPgps *);
void visit(XPloads *);
void visit(XPpqr *);
void visit(XPspeeds *);
void visit(XPthrottela *);
void visit(XPthrottelc *);
void visit(XPxyz *);
void visit(XPyoke *);
};
#endif