From a38fef65c77b02c80ea28e2e062d3271b95ebe62 Mon Sep 17 00:00:00 2001 From: Michael Oborne Date: Sun, 30 Sep 2012 07:29:33 +0800 Subject: [PATCH] AP,AC Add ability to override an altitude in any auto mode, on the current active target --- ArduCopter/GCS_Mavlink.pde | 16 ++++++++++++++++ ArduPlane/GCS_Mavlink.pde | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/ArduCopter/GCS_Mavlink.pde b/ArduCopter/GCS_Mavlink.pde index e9eeedcffde..ea69ad80f72 100644 --- a/ArduCopter/GCS_Mavlink.pde +++ b/ArduCopter/GCS_Mavlink.pde @@ -1542,6 +1542,22 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg) msg->compid, 0); + } else if(packet.current == 3) { //current = 3 is a flag to tell us this is a alt change only + + // add home alt if needed + if (tell_command.options & MASK_OPTIONS_RELATIVE_ALT) { + tell_command.alt += home.alt; + } + + set_new_altitude(tell_command.alt); + + // verify we recevied the command + mavlink_msg_mission_ack_send( + chan, + msg->sysid, + msg->compid, + 0); + } else { // Check if receiving waypoints (mission upload expected) if (!waypoint_receiving) break; diff --git a/ArduPlane/GCS_Mavlink.pde b/ArduPlane/GCS_Mavlink.pde index 0fc1c89dbc8..194e8aeb024 100644 --- a/ArduPlane/GCS_Mavlink.pde +++ b/ArduPlane/GCS_Mavlink.pde @@ -1541,6 +1541,22 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg) msg->compid, 0); + } else if(packet.current == 3) { //current = 3 is a flag to tell us this is a alt change only + + // add home alt if needed + if (tell_command.options & MASK_OPTIONS_RELATIVE_ALT) { + tell_command.alt += home.alt; + } + + next_WP.alt = tell_command.alt; + + // verify we recevied the command + mavlink_msg_mission_ack_send( + chan, + msg->sysid, + msg->compid, + 0); + } else { // Check if receiving waypoints (mission upload expected) if (!waypoint_receiving) {