Browse Source

AP_Common: make Location(Vector3f) require ALTFRAME

c415-sdk
Josh Henderson 4 years ago committed by Randy Mackay
parent
commit
dce01fbb43
  1. 5
      libraries/AP_Common/Location.cpp
  2. 2
      libraries/AP_Common/Location.h

5
libraries/AP_Common/Location.cpp

@ -26,6 +26,7 @@ void Location::zero(void) @@ -26,6 +26,7 @@ void Location::zero(void)
memset(this, 0, sizeof(*this));
}
// Construct location using position (NEU) from ekf_origin for the given altitude frame
Location::Location(int32_t latitude, int32_t longitude, int32_t alt_in_cm, AltFrame frame)
{
zero();
@ -34,10 +35,10 @@ Location::Location(int32_t latitude, int32_t longitude, int32_t alt_in_cm, AltFr @@ -34,10 +35,10 @@ Location::Location(int32_t latitude, int32_t longitude, int32_t alt_in_cm, AltFr
set_alt_cm(alt_in_cm, frame);
}
Location::Location(const Vector3f &ekf_offset_neu)
Location::Location(const Vector3f &ekf_offset_neu, AltFrame frame)
{
// store alt and alt frame
set_alt_cm(ekf_offset_neu.z, AltFrame::ABOVE_ORIGIN);
set_alt_cm(ekf_offset_neu.z, frame);
// calculate lat, lon
Location ekf_origin;

2
libraries/AP_Common/Location.h

@ -32,7 +32,7 @@ public: @@ -32,7 +32,7 @@ public:
/// constructors
Location();
Location(int32_t latitude, int32_t longitude, int32_t alt_in_cm, AltFrame frame);
Location(const Vector3f &ekf_offset_neu);
Location(const Vector3f &ekf_offset_neu, AltFrame frame);
static void set_terrain(AP_Terrain* terrain) { _terrain = terrain; }

Loading…
Cancel
Save