AP_Common: make Location(Vector3f) require ALTFRAME

This commit is contained in:
Josh Henderson 2021-03-17 17:15:20 -04:00 committed by Randy Mackay
parent cc46483e6c
commit dce01fbb43
2 changed files with 4 additions and 3 deletions

View File

@ -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
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;

View File

@ -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; }