Copter: pv_location_to_vector use pv_alt_above_origin

This commit is contained in:
Jonathan Challinger 2015-04-13 14:12:10 -07:00 committed by Randy Mackay
parent e5a6023827
commit 920ac12214

View File

@ -11,9 +11,8 @@
Vector3f pv_location_to_vector(const Location& loc)
{
const struct Location &origin = inertial_nav.get_origin();
float alt_above_origin = loc.alt + (ahrs.get_home().alt - origin.alt); // convert alt-relative-to-home to alt-relative-to-origin
Vector3f tmp((loc.lat-origin.lat) * LATLON_TO_CM, (loc.lng-origin.lng) * LATLON_TO_CM * scaleLongDown, alt_above_origin);
return tmp;
float alt_above_origin = pv_alt_above_origin(loc.alt); // convert alt-relative-to-home to alt-relative-to-origin
return Vector3f((loc.lat-origin.lat) * LATLON_TO_CM, (loc.lng-origin.lng) * LATLON_TO_CM * scaleLongDown, alt_above_origin);
}
// pv_location_to_vector_with_default - convert lat/lon coordinates to a position vector,