Copter: clarify pv_location_to_vector param name
Also update function description
This commit is contained in:
parent
71586d40e3
commit
1b64dd2280
@ -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,
|
// 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
|
// defaults to the default_posvec's lat/lon and alt if the provided lat/lon or alt are zero
|
||||||
// altitude if the provided altitude is zero.
|
Vector3f pv_location_to_vector_with_default(const Location& loc, const Vector3f& default_posvec)
|
||||||
Vector3f pv_location_to_vector_with_default(const Location& loc, const Vector3f& default_)
|
|
||||||
{
|
{
|
||||||
Vector3f pos = pv_location_to_vector(loc);
|
Vector3f pos = pv_location_to_vector(loc);
|
||||||
|
|
||||||
// set target altitude to default if not provided
|
// set target altitude to default if not provided
|
||||||
if (loc.alt == 0) {
|
if (loc.alt == 0) {
|
||||||
pos.z = default_.z;
|
pos.z = default_posvec.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set target position to default if not provided
|
// set target position to default if not provided
|
||||||
if (loc.lat == 0 && loc.lng == 0) {
|
if (loc.lat == 0 && loc.lng == 0) {
|
||||||
pos.x = default_.x;
|
pos.x = default_posvec.x;
|
||||||
pos.y = default_.y;
|
pos.y = default_posvec.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
return pos;
|
return pos;
|
||||||
|
Loading…
Reference in New Issue
Block a user