diff --git a/src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc b/src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc index 23dcf59..25c188f 100644 --- a/src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc +++ b/src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc @@ -67,9 +67,11 @@ const QVariantList& PX4AutoPilotPlugin::vehicleComponents(void) _airframeComponent->setupTriggerSignals(); _components.append(QVariant::fromValue(static_cast(_airframeComponent))); - _sensorsComponent = new SensorsComponent(_vehicle, this, this); - _sensorsComponent->setupTriggerSignals(); - _components.append(QVariant::fromValue(static_cast(_sensorsComponent))); + if (!_vehicle->hilMode()) { + _sensorsComponent = new SensorsComponent(_vehicle, this, this); + _sensorsComponent->setupTriggerSignals(); + _components.append(QVariant::fromValue(static_cast(_sensorsComponent))); + } _radioComponent = new PX4RadioComponent(_vehicle, this, this); _radioComponent->setupTriggerSignals(); diff --git a/src/Vehicle/Vehicle.h b/src/Vehicle/Vehicle.h index b9d437e..3858d64 100644 --- a/src/Vehicle/Vehicle.h +++ b/src/Vehicle/Vehicle.h @@ -588,6 +588,7 @@ public: bool allSensorsHealthy () const{ return _allSensorsHealthy; } QObject* sysStatusSensorInfo () { return &_sysStatusSensorInfo; } bool requiresGpsFix () const { return static_cast(_onboardControlSensorsPresent & SysStatusSensorGPS); } + bool hilMode () const { return _base_mode & MAV_MODE_FLAG_HIL_ENABLED; } /// Get the maximum MAVLink protocol version supported /// @return the maximum version