diff --git a/src/comm/QGCFlightGearLink.cc b/src/comm/QGCFlightGearLink.cc index a6e593dc24e5ee00878faebc26146165a35a2e1a..6e60ea7f5aecd6ffc5b8bf7a9dd7b3b41215211a 100644 --- a/src/comm/QGCFlightGearLink.cc +++ b/src/comm/QGCFlightGearLink.cc @@ -230,9 +230,9 @@ void QGCFlightGearLink::readBytes() double airspeed; time = values.at(0).toDouble(); - lat = values.at(1).toDouble(); - lon = values.at(2).toDouble(); - alt = values.at(3).toDouble(); + lat = values.at(1).toDouble() * 1e7; + lon = values.at(2).toDouble() * 1e7; + alt = values.at(3).toDouble() * 1e3; roll = values.at(4).toDouble(); pitch = values.at(5).toDouble(); yaw = values.at(6).toDouble(); @@ -244,9 +244,9 @@ void QGCFlightGearLink::readBytes() yacc = values.at(11).toDouble(); zacc = values.at(12).toDouble(); - vx = values.at(13).toDouble(); - vy = values.at(14).toDouble(); - vz = values.at(15).toDouble(); + vx = values.at(13).toDouble() * 1e2; + vy = values.at(14).toDouble() * 1e2; + vz = values.at(15).toDouble() * 1e2; airspeed = values.at(16).toDouble(); @@ -322,6 +322,8 @@ bool QGCFlightGearLink::disconnectSimulation() **/ bool QGCFlightGearLink::connectSimulation() { + qDebug() << "STARTING FLIGHTGEAR LINK"; + if (!mav) return false; socket = new QUdpSocket(this); connectState = socket->bind(host, port); @@ -377,9 +379,9 @@ bool QGCFlightGearLink::connectSimulation() #endif #ifdef Q_OS_LINUX - processFgfs = "fgfs"; - fgRoot = "/usr/share/flightgear/data"; - fgScenery = "/usr/share/flightgear/data/Scenery-Terrasync"; + processFgfs = "/usr/games/fgfs"; + fgRoot = "/usr/share/games/flightgear"; + fgScenery = "/usr/share/games/flightgear/Scenery"; #endif // Sanity checks @@ -451,7 +453,8 @@ bool QGCFlightGearLink::connectSimulation() //processCall << "--disable-horizon-effect"; processCall << "--disable-clouds"; processCall << "--fdm=jsb"; - processCall << "--units-meters"; + processCall << "--units-meters"; //XXX: check: the protocol xml has already a conversion from feet to m? + processCall << "--notrim"; if (mav->getSystemType() == MAV_TYPE_QUADROTOR) { // Start all engines of the quad diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 3ba3174133b376466dd267e5a2a7072ab6204f77..ccf5877b797d15e3f61d34d539aa11ec122d30e9 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -97,7 +97,7 @@ UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(), paramManager(NULL), attitudeStamped(false), lastAttitude(0), - simulation(new QGCXPlaneLink(this)), + simulation(new QGCFlightGearLink(this)), isLocalPositionKnown(false), isGlobalPositionKnown(false), systemIsArmed(false), diff --git a/src/ui/uas/UASView.cc b/src/ui/uas/UASView.cc index 6954a34b7184fc523237a7fa3a27a4dcd0f36f44..816dc416bfa902a4493e85f5bb736500c14f271d 100644 --- a/src/ui/uas/UASView.cc +++ b/src/ui/uas/UASView.cc @@ -82,7 +82,7 @@ UASView::UASView(UASInterface* uas, QWidget *parent) : hilAction->setCheckable(true); // Flightgear is not ready for prime time - hilAction->setEnabled(false); + //hilAction->setEnabled(false); hilXAction->setCheckable(true); m_ui->setupUi(this); @@ -503,6 +503,7 @@ void UASView::contextMenuEvent (QContextMenuEvent* event) { menu.addAction(removeAction); } + menu.addAction(hilAction); menu.addAction(hilXAction); // XXX Re-enable later menu.addAction(hilXAction); menu.addAction(selectAirframeAction);