Unverified Commit 8f1b0d04 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #8059 from DonLakeFlyer/GimbalYaw

Plan: Fix gimbal yaw visual problems
parents a6c91495 50b46416
......@@ -67,8 +67,6 @@ CameraSection::CameraSection(Vehicle* vehicle, QObject* parent)
connect(this, &CameraSection::specifyGimbalChanged, this, &CameraSection::_setDirty);
connect(this, &CameraSection::specifyCameraModeChanged, this, &CameraSection::_setDirty);
connect(this, &CameraSection::specifyGimbalChanged, this, &CameraSection::_updateSpecifiedGimbalYaw);
connect(this, &CameraSection::specifyGimbalChanged, this, &CameraSection::_updateSpecifiedGimbalPitch);
connect(&_gimbalYawFact, &Fact::valueChanged, this, &CameraSection::_updateSpecifiedGimbalYaw);
connect(&_gimbalPitchFact, &Fact::valueChanged, this, &CameraSection::_updateSpecifiedGimbalPitch);
}
......@@ -78,6 +76,8 @@ void CameraSection::setSpecifyGimbal(bool specifyGimbal)
if (specifyGimbal != _specifyGimbal) {
_specifyGimbal = specifyGimbal;
emit specifyGimbalChanged(specifyGimbal);
emit specifiedGimbalYawChanged(specifiedGimbalYaw());
emit specifiedGimbalPitchChanged(specifiedGimbalPitch());
}
}
......
......@@ -1419,7 +1419,21 @@ void MissionController::_recalcMissionFlightStatus()
_missionFlightStatus.vehicleSpeed = newSpeed;
}
// Look for gimbal change
// ROI commands cancel out previous gimbal yaw/pitch
if (simpleItem) {
switch (simpleItem->command()) {
case MAV_CMD_NAV_ROI:
case MAV_CMD_DO_SET_ROI_LOCATION:
case MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET:
_missionFlightStatus.gimbalYaw = std::numeric_limits<double>::quiet_NaN();
_missionFlightStatus.gimbalPitch = std::numeric_limits<double>::quiet_NaN();
break;
default:
break;
}
}
// Look for specific gimbal changes
double gimbalYaw = item->specifiedGimbalYaw();
if (!qIsNaN(gimbalYaw)) {
_missionFlightStatus.gimbalYaw = gimbalYaw;
......
......@@ -39,12 +39,11 @@ void MissionItemTest::init(void)
MAV_TYPE_QUADROTOR,
qgcApp()->toolbox()->firmwarePluginManager(),
this);
}
void MissionItemTest::cleanup(void)
{
delete _offlineVehicle;
_offlineVehicle->deleteLater();
UnitTest::cleanup();
}
......
......@@ -54,7 +54,7 @@ void VisualMissionItemTest::init(void)
void VisualMissionItemTest::cleanup(void)
{
delete _offlineVehicle;
_offlineVehicle->deleteLater();
UnitTest::cleanup();
}
......
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