diff --git a/ExtLibs/ArduPilot/Mavlink/MAVLinkInterface.cs b/ExtLibs/ArduPilot/Mavlink/MAVLinkInterface.cs
index 11840d6eb4..0d3926187c 100644
--- a/ExtLibs/ArduPilot/Mavlink/MAVLinkInterface.cs
+++ b/ExtLibs/ArduPilot/Mavlink/MAVLinkInterface.cs
@@ -4491,28 +4491,18 @@ public void setMountControl(double pa, double pb, double pc, bool islatlng)
public void setMountControl(byte sysid, byte compid, double pa, double pb, double pc, bool islatlng)
{
- mavlink_mount_control_t req = new mavlink_mount_control_t
- {
- target_system = sysid,
- target_component = compid
- };
-
if (!islatlng)
{
- req.input_a = (int) pa;
- req.input_b = (int) pb;
- req.input_c = (int) pc;
+ // pa is pitch, pb is roll, pc is yaw in centi-degrees. convert to degrees
+ doCommand(sysid, compid, MAV_CMD.DO_MOUNT_CONTROL, (float)(pa * 0.01), (float)(pb * 0.01), (float)(pc * 0.01), 0, 0, 0, (float)MAV_MOUNT_MODE.MAVLINK_TARGETING, false);
}
else
{
- req.input_a = (int) (pa * 10000000.0);
- req.input_b = (int) (pb * 10000000.0);
- req.input_c = (int) (pc * 100.0);
+ // pa is lat in degrees, placed in param5 in deg * 10e7
+ // pb is lon in degrees, placed in param6 in deg * 10e7
+ // pc is alt in meters, placed in param5 in meters
+ doCommand(sysid, compid, MAV_CMD.DO_MOUNT_CONTROL, 0, 0, 0, (float)pc, (float)(pa * 10000000.0f), (float)(pb * 10000000.0f), (float)MAV_MOUNT_MODE.MAVLINK_TARGETING, false);
}
-
- generatePacket((byte) MAVLINK_MSG_ID.MOUNT_CONTROL, req);
- Thread.Sleep(20);
- generatePacket((byte) MAVLINK_MSG_ID.MOUNT_CONTROL, req);
}
[Obsolete]
diff --git a/GCSViews/FlightData.cs b/GCSViews/FlightData.cs
index ee47d1107b..c5906d0f5d 100644
--- a/GCSViews/FlightData.cs
+++ b/GCSViews/FlightData.cs
@@ -703,35 +703,6 @@ public void loadTabControlActions()
ThemeManager.ApplyThemeTo(tabControlactions);
}
- //Updates the visibility of the payload control tab based on whether the payload target is available or not
- public void updatePayloadTabVisible()
- {
- bool gimbalPresent = false;
-
- //if the currently connected target is a flight controller check if there is an associated mavlink gimbal
- if (MainV2.comPort.compidcurrent == 1)
- {
- foreach (var mav in MainV2.comPort.MAVlist)
- {
- if (mav.sysid == MainV2.comPort.sysidcurrent &&
- mav.compid == (int) MAVLink.MAV_COMPONENT.MAV_COMP_ID_GIMBAL)
- {
- gimbalPresent = true;
- break;
- }
- }
- }
-
- if (tabControlactions.TabPages.Contains(tabPayload) == true && gimbalPresent == false)
- {
- tabControlactions.TabPages.Remove(tabPayload);
- }
- else if (tabControlactions.TabPages.Contains(tabPayload) == false && gimbalPresent == true)
- {
- tabControlactions.TabPages.Add(tabPayload);
- }
- }
-
internal void BUT_run_script_Click(object sender, EventArgs e)
{
if (File.Exists(selectedscript))
diff --git a/GCSViews/FlightData.resx b/GCSViews/FlightData.resx
index e3d2c28aec..1bb5e9051c 100644
--- a/GCSViews/FlightData.resx
+++ b/GCSViews/FlightData.resx
@@ -3983,7 +3983,7 @@
63, 19
- Yes
+ No
True
diff --git a/MainV2.cs b/MainV2.cs
index 8b4d64c96d..301c032a35 100644
--- a/MainV2.cs
+++ b/MainV2.cs
@@ -1179,34 +1179,6 @@ void comPort_MavChanged(object sender, EventArgs e)
return;
}
}
-
- if (this.InvokeRequired)
- {
- this.BeginInvoke((MethodInvoker) delegate
- {
- //enable the payload control page if a mavlink gimbal is detected
- if (instance.FlightData != null)
- {
- instance.FlightData.updatePayloadTabVisible();
- }
-
- instance.MyView.Reload();
-
- _connectionControl.UpdateSysIDS();
- });
- }
- else
- {
- //enable the payload control page if a mavlink gimbal is detected
- if (instance.FlightData != null)
- {
- instance.FlightData.updatePayloadTabVisible();
- }
-
- instance.MyView.Reload();
-
- _connectionControl.UpdateSysIDS();
- }
}
#if !NETSTANDARD2_0
#if !NETCOREAPP2_0