summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-10-08 19:29:54 +0200
committerStanislaw Halik <sthalik@misaki.pl>2013-10-08 19:29:54 +0200
commitf5c9765f76141840e411159933098c6f4bad7f33 (patch)
treed44060cf03dc78b853bb1e88f23d80d70dce729a
parenta12d2533e2025959a33ebf692e2a65bffa3684fa (diff)
correct fgfs protocol bitrot
Signed-off-by: Stanislaw Halik <sthalik@misaki.pl>
-rw-r--r--facetracknoir/clientfiles/FlightGear/Linux/usage.txt6
-rw-r--r--ftnoir_protocol_fg/fgtypes.h2
-rw-r--r--ftnoir_protocol_fg/ftnoir_fgcontrols.ui4
-rw-r--r--ftnoir_protocol_fg/ftnoir_protocol_fg.cpp12
-rw-r--r--ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp2
-rw-r--r--ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp2
6 files changed, 16 insertions, 12 deletions
diff --git a/facetracknoir/clientfiles/FlightGear/Linux/usage.txt b/facetracknoir/clientfiles/FlightGear/Linux/usage.txt
new file mode 100644
index 00000000..14c77ad0
--- /dev/null
+++ b/facetracknoir/clientfiles/FlightGear/Linux/usage.txt
@@ -0,0 +1,6 @@
+fgfs --generic=socket,in,25,localhost,5542,udp,headtracker ~/opt/fgdata/Nasal/headtracker.xml
+
+Adjust paths as necessary.
+
+cheers,
+-sh 20131008
diff --git a/ftnoir_protocol_fg/fgtypes.h b/ftnoir_protocol_fg/fgtypes.h
index 0f29be3d..049de318 100644
--- a/ftnoir_protocol_fg/fgtypes.h
+++ b/ftnoir_protocol_fg/fgtypes.h
@@ -17,7 +17,7 @@
//
// x,y,z position in metres, heading, pitch and roll in degrees...
//
-#pragma pack(push, 2)
+#pragma pack(push, 1)
struct TFlightGearData {
double x, y, z, h, p, r;
int status;
diff --git a/ftnoir_protocol_fg/ftnoir_fgcontrols.ui b/ftnoir_protocol_fg/ftnoir_fgcontrols.ui
index 51b5693c..fd0df6b0 100644
--- a/ftnoir_protocol_fg/ftnoir_fgcontrols.ui
+++ b/ftnoir_protocol_fg/ftnoir_fgcontrols.ui
@@ -9,8 +9,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>486</width>
- <height>210</height>
+ <width>518</width>
+ <height>208</height>
</rect>
</property>
<property name="windowTitle">
diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp b/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp
index dc76d193..643f9dd5 100644
--- a/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp
+++ b/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp
@@ -74,7 +74,7 @@ void FTNoIR_Protocol::loadSettings() {
QString destAddr = iniFile.value ( "IP-1", 192 ).toString() + "." + iniFile.value ( "IP-2", 168 ).toString() + "." + iniFile.value ( "IP-3", 2 ).toString() + "." + iniFile.value ( "IP-4", 1 ).toString();
destIP = QHostAddress( destAddr );
}
- destPort = iniFile.value ( "PortNumber", 5550 ).toInt();
+ destPort = iniFile.value ( "PortNumber", 5542 ).toInt();
iniFile.endGroup ();
@@ -91,10 +91,10 @@ quint16 senderPort;
//
// Copy the Raw measurements directly to the client.
//
- FlightData.x = headpose[TX];
- FlightData.y = headpose[Pitch];
- FlightData.z = headpose[TZ];
- FlightData.p = headpose[TY];
+ 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.status = fg_cmd;
@@ -129,11 +129,9 @@ quint16 senderPort;
#ifndef SEND_ASCII_DATA
//! [1]
-// no_bytes = outSocket->writeDatagram((const char *) &FlightData, sizeof( FlightData ), QHostAddress::LocalHost, 5550);
if (outSocket != 0) {
no_bytes = outSocket->writeDatagram((const char *) &FlightData, sizeof( FlightData ), destIP, destPort);
if ( no_bytes > 0) {
- // qDebug() << "FGServer::writePendingDatagrams says: bytes send =" << no_bytes << sizeof( double );
}
else {
qDebug() << "FGServer::writePendingDatagrams says: nothing sent!";
diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp b/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp
index b670bdd3..f479ce76 100644
--- a/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp
+++ b/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp
@@ -147,7 +147,7 @@ void FGControls::loadSettings() {
ui.spinIPThirdNibble->setValue( iniFile.value ( "IP-3", 2 ).toInt() );
ui.spinIPFourthNibble->setValue( iniFile.value ( "IP-4", 1 ).toInt() );
- ui.spinPortNumber->setValue( iniFile.value ( "PortNumber", 5550 ).toInt() );
+ ui.spinPortNumber->setValue( iniFile.value ( "PortNumber", 5542 ).toInt() );
iniFile.endGroup ();
chkLocalPCOnlyChanged();
diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp
index d29c80c9..3d04dfd0 100644
--- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp
+++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp
@@ -58,7 +58,7 @@ void FTNoIR_Protocol::loadSettings() {
QString destAddr = iniFile.value ( "IP-1", 192 ).toString() + "." + iniFile.value ( "IP-2", 168 ).toString() + "." + iniFile.value ( "IP-3", 2 ).toString() + "." + iniFile.value ( "IP-4", 1 ).toString();
destIP = QHostAddress( destAddr );
- destPort = iniFile.value ( "PortNumber", 5550 ).toInt();
+ destPort = iniFile.value ( "PortNumber", 5550 ).toInt();
iniFile.endGroup ();
}