From 1ad83a80025c6ec719eb5c2ab2025619c7eff497 Mon Sep 17 00:00:00 2001 From: Thomas Stauber <48206725+ThomasRigi@users.noreply.github.com> Date: Tue, 12 Mar 2024 00:49:11 +0100 Subject: [PATCH] mavlink: OPEN_DRONE_ID_SYSTEM stream publish operator altitude in geodetic frame (#22866) --- src/modules/mavlink/streams/OPEN_DRONE_ID_SYSTEM.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/mavlink/streams/OPEN_DRONE_ID_SYSTEM.hpp b/src/modules/mavlink/streams/OPEN_DRONE_ID_SYSTEM.hpp index bcc7e0f145..9467df81e9 100644 --- a/src/modules/mavlink/streams/OPEN_DRONE_ID_SYSTEM.hpp +++ b/src/modules/mavlink/streams/OPEN_DRONE_ID_SYSTEM.hpp @@ -86,7 +86,8 @@ private: msg.area_floor = -1000; msg.category_eu = MAV_ODID_CATEGORY_EU_UNDECLARED; msg.class_eu = MAV_ODID_CLASS_EU_UNDECLARED; - msg.operator_altitude_geo = home_position.alt; + float wgs84_amsl_offset = vehicle_gps_position.altitude_ellipsoid_m - vehicle_gps_position.altitude_msl_m; + msg.operator_altitude_geo = home_position.alt + wgs84_amsl_offset; // timestamp: 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019. static uint64_t utc_offset_s = 1'546'300'800; // UTC seconds since 00:00:00 01/01/2019