AP_Mission: make cmd.p1 be radius on plane for NAV_WAYPOINT

This commit is contained in:
Andrew Tridgell 2014-09-03 11:23:08 +10:00
parent 9de1ae8fbb
commit c4f84232e2

View File

@ -466,7 +466,18 @@ bool AP_Mission::mavlink_to_mission_cmd(const mavlink_mission_item_t& packet, AP
case MAV_CMD_NAV_WAYPOINT: // MAV ID: 16
copy_location = true;
cmd.p1 = packet.param1; // delay at waypoint in seconds
/*
the 15 byte limit means we can't fit both delay and radius
in the cmd structure. When we expand the mission structure
we can do this properly
*/
#if APM_BUILD_TYPE(APM_BUILD_ArduPlane)
// acceptance radius in meters
cmd.p1 = packet.param2;
#else
// delay at waypoint in seconds
cmd.p1 = packet.param1;
#endif
break;
case MAV_CMD_NAV_LOITER_UNLIM: // MAV ID: 17