Copter: update pv_location_to_vector to use get_origin instead of get_home

This commit is contained in:
Jonathan Challinger 2015-02-02 18:12:16 -08:00 committed by Randy Mackay
parent c95e7b2282
commit 9c2865f6a8
1 changed files with 2 additions and 2 deletions

View File

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