Commit de38e49b authored by Lorenz Meier's avatar Lorenz Meier

Merge pull request #623 from julianoes/hil_cmds

include HIL bit, this makes HIL without RC working again
parents 113ee261 144dcddd
......@@ -539,6 +539,8 @@ public:
bool isAuto();
/** @brief Check if vehicle is armed */
bool isArmed() const { return systemIsArmed; }
/** @brief Check if vehicle is in HIL mode */
bool isHilEnabled() const { return hilEnabled; }
/** @brief Get reference to the waypoint manager **/
UASWaypointManager* getWaypointManager() {
......
......@@ -230,8 +230,8 @@ void UASControlWidget::setMode(int mode)
void UASControlWidget::transmitMode()
{
UASInterface* uas = UASManager::instance()->getUASForId(this->uasID);
if (uas) {
UASInterface* uas_iface = UASManager::instance()->getUASForId(this->uasID);
if (uas_iface) {
if (modeIdx >= 0 && modeIdx < modesNum) {
struct full_mode_s mode = modesList[modeIdx];
// include armed state
......@@ -241,6 +241,14 @@ void UASControlWidget::transmitMode()
mode.baseMode &= ~MAV_MODE_FLAG_SAFETY_ARMED;
}
UAS* uas = dynamic_cast<UAS*>(uas_iface);
if (uas->isHilEnabled()) {
mode.baseMode |= MAV_MODE_FLAG_HIL_ENABLED;
} else {
mode.baseMode &= ~MAV_MODE_FLAG_HIL_ENABLED;
}
uas->setMode(mode.baseMode, mode.customMode);
QString modeText = ui.modeComboBox->currentText();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment