Skip to content

Commit

Permalink
Copter: support SET_POSITION_TARGET with WGS84 altitudes
Browse files Browse the repository at this point in the history
  • Loading branch information
jschall committed Jan 13, 2016
1 parent 19a0675 commit aec18c3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ArduCopter/GCS_Mavlink.pde
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,10 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
case MAV_FRAME_GLOBAL:
case MAV_FRAME_GLOBAL_INT:
default:
loc.flags.relative_alt = false;
// Copter does not support navigation to absolute altitudes. This is a temporary hack
// to convert the WGS84 altitude to a home-relative altitude before passing it to Copter
loc.alt -= ahrs.get_home().alt;
loc.flags.relative_alt = true;
loc.flags.terrain_alt = false;
break;
}
Expand Down

0 comments on commit aec18c3

Please sign in to comment.