summaryrefslogtreecommitdiffhomepage
path: root/proto-fg/ftnoir_protocol_fg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'proto-fg/ftnoir_protocol_fg.cpp')
-rw-r--r--proto-fg/ftnoir_protocol_fg.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/proto-fg/ftnoir_protocol_fg.cpp b/proto-fg/ftnoir_protocol_fg.cpp
index 3df51c3e..3e0f955c 100644
--- a/proto-fg/ftnoir_protocol_fg.cpp
+++ b/proto-fg/ftnoir_protocol_fg.cpp
@@ -14,20 +14,15 @@
// For Todd and Arda Kutlu
void flightgear::pose(const double* headpose) {
- FlightData.x = headpose[TX] * 1e-2;
+ FlightData.x = -headpose[TX] * 1e-2;
FlightData.y = headpose[TY] * 1e-2;
FlightData.z = headpose[TZ] * 1e-2;
FlightData.p = headpose[Pitch];
- FlightData.h = headpose[Yaw];
- FlightData.r = headpose[Roll];
+ FlightData.h = -headpose[Yaw];
+ FlightData.r = -headpose[Roll];
FlightData.status = 1;
- QHostAddress destIP(QString("%1.%2.%3.%4").arg(
- QString::number(static_cast<int>(s.ip1)),
- QString::number(static_cast<int>(s.ip2)),
- QString::number(static_cast<int>(s.ip3)),
- QString::number(static_cast<int>(s.ip4))));
- int destPort = s.port;
- (void) outSocket.writeDatagram(reinterpret_cast<const char*>(&FlightData), sizeof(FlightData), destIP, static_cast<quint16>(destPort));
+ QHostAddress destIP(quint32(s.ip1 << 24 | s.ip2 << 16 | s.ip3 << 8 | s.ip4));
+ (void) outSocket.writeDatagram(reinterpret_cast<const char*>(&FlightData), sizeof(FlightData), destIP, static_cast<quint16>(s.port));
}
bool flightgear::correct()