From d064ac00c5cb73507f9a35af32c49a6c0696569d Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 28 Nov 2012 21:48:05 +0100 Subject: [PATCH] Potential fix for HIL state machine issue --- src/comm/QGCFlightGearLink.cc | 2 ++ src/uas/UAS.cc | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/comm/QGCFlightGearLink.cc b/src/comm/QGCFlightGearLink.cc index 279e665..ce8e2a7 100644 --- a/src/comm/QGCFlightGearLink.cc +++ b/src/comm/QGCFlightGearLink.cc @@ -338,6 +338,8 @@ bool QGCFlightGearLink::connectSimulation() connect(mav, SIGNAL(hilControlsChanged(uint64_t, float, float, float, float, uint8_t, uint8_t)), this, SLOT(updateControls(uint64_t,float,float,float,float,uint8_t,uint8_t))); connect(this, SIGNAL(hilStateChanged(uint64_t,float,float,float,float,float,float,int32_t,int32_t,int32_t,int16_t,int16_t,int16_t,int16_t,int16_t,int16_t)), mav, SLOT(sendHilState(uint64_t,float,float,float,float,float,float,int32_t,int32_t,int32_t,int16_t,int16_t,int16_t,int16_t,int16_t,int16_t))); + mav->startHil(); + //connect(&refreshTimer, SIGNAL(timeout()), this, SLOT(sendUAVUpdate())); // Catch process error QObject::connect( process, SIGNAL(error(QProcess::ProcessError)), diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 1de82be..3fc4e2d 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -2699,11 +2699,11 @@ void UAS::startHil() { if (hilEnabled) return; hilEnabled = true; - // Connect HIL simulation link - simulation->connectSimulation(); mavlink_message_t msg; mavlink_msg_set_mode_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, this->getUASID(), mode | MAV_MODE_FLAG_HIL_ENABLED, navMode); sendMessage(msg); + // Connect HIL simulation link + simulation->connectSimulation(); } /**