From 1b64dd2280da0160b1a0f26525fa53a82adac00c Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Thu, 6 Nov 2014 11:39:53 +0900 Subject: [PATCH] Copter: clarify pv_location_to_vector param name Also update function description --- ArduCopter/position_vector.pde | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ArduCopter/position_vector.pde b/ArduCopter/position_vector.pde index 8a1a50aabd..03faefc056 100644 --- a/ArduCopter/position_vector.pde +++ b/ArduCopter/position_vector.pde @@ -16,21 +16,20 @@ Vector3f pv_location_to_vector(const Location& loc) } // pv_location_to_vector_with_default - convert lat/lon coordinates to a position vector, -// defaulting to the current position if the provided lat/lon are zero and the current -// altitude if the provided altitude is zero. -Vector3f pv_location_to_vector_with_default(const Location& loc, const Vector3f& default_) +// defaults to the default_posvec's lat/lon and alt if the provided lat/lon or alt are zero +Vector3f pv_location_to_vector_with_default(const Location& loc, const Vector3f& default_posvec) { Vector3f pos = pv_location_to_vector(loc); // set target altitude to default if not provided if (loc.alt == 0) { - pos.z = default_.z; + pos.z = default_posvec.z; } // set target position to default if not provided if (loc.lat == 0 && loc.lng == 0) { - pos.x = default_.x; - pos.y = default_.y; + pos.x = default_posvec.x; + pos.y = default_posvec.y; } return pos;