diff --git a/src/uas/UAS.h b/src/uas/UAS.h index 9d9681c..20c7e62 100644 --- a/src/uas/UAS.h +++ b/src/uas/UAS.h @@ -569,8 +569,10 @@ public: bool isAuto(); /** @brief Check if vehicle is armed */ bool isArmed() const { return systemIsArmed; } - /** @brief Check if vehicle is in HIL mode */ + /** @brief Check if vehicle is supposed to be in HIL mode by the GS */ bool isHilEnabled() const { return hilEnabled; } + /** @brief Check if vehicle is in HIL mode */ + bool isHilActive() const { return base_mode & MAV_MODE_FLAG_HIL_ENABLED; } /** @brief Get reference to the waypoint manager **/ UASWaypointManager* getWaypointManager() { diff --git a/src/ui/uas/UASControlWidget.cc b/src/ui/uas/UASControlWidget.cc index 99666bb..3d9b150 100644 --- a/src/ui/uas/UASControlWidget.cc +++ b/src/ui/uas/UASControlWidget.cc @@ -246,7 +246,7 @@ void UASControlWidget::transmitMode() UAS* uas = dynamic_cast(uas_iface); - if (uas->isHilEnabled()) { + if (uas->isHilEnabled() || uas->isHilActive()) { mode.baseMode |= MAV_MODE_FLAG_HIL_ENABLED; } else { mode.baseMode &= ~MAV_MODE_FLAG_HIL_ENABLED;