-
Notifications
You must be signed in to change notification settings - Fork 15.3k
EKF2: support multiple AGP sources #26306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+682
−238
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a1f0e1c
uorb: add AuxGlobalPosition message
haumarco 922688a
ekf2: add multi-instance AGP parameters
haumarco f9317d9
ekf2: implement multi-instance AGP fusion
haumarco 347cdc1
ekf2: update logger, mavlink, DDS, and replay for AuxGlobalPosition
haumarco be0d0f3
simulation: update sensor_agp_sim for AuxGlobalPosition message
haumarco 2324aef
add translation for aux_global_position
haumarco e03eaf4
fix ros-test-config for multi-APG
haumarco File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Fused global position in WGS84. | ||
| # This struct contains global position estimation. It is not the raw GPS | ||
| # measurement (@see vehicle_gps_position). This topic is usually published by the position | ||
| # estimator, which will take more sources of information into account than just GPS, | ||
| # e.g. control inputs of the vehicle in a Kalman-filter implementation. | ||
| # | ||
|
|
||
| uint32 MESSAGE_VERSION = 0 | ||
|
|
||
| uint64 timestamp # time since system start (microseconds) | ||
| uint64 timestamp_sample # the timestamp of the raw data (microseconds) | ||
|
|
||
| float64 lat # Latitude, (degrees) | ||
| float64 lon # Longitude, (degrees) | ||
| float32 alt # Altitude AMSL, (meters) | ||
| float32 alt_ellipsoid # Altitude above ellipsoid, (meters) | ||
|
|
||
| bool lat_lon_valid | ||
| bool alt_valid | ||
|
|
||
| float32 delta_alt # Reset delta for altitude | ||
| float32 delta_terrain # Reset delta for terrain | ||
| uint8 lat_lon_reset_counter # Counter for reset events on horizontal position coordinates | ||
| uint8 alt_reset_counter # Counter for reset events on altitude | ||
| uint8 terrain_reset_counter # Counter for reset events on terrain | ||
|
|
||
| float32 eph # Standard deviation of horizontal position error, (metres) | ||
| float32 epv # Standard deviation of vertical position error, (metres) | ||
|
|
||
| float32 terrain_alt # Terrain altitude WGS84, (metres) | ||
| bool terrain_alt_valid # Terrain altitude estimate is valid | ||
|
|
||
| bool dead_reckoning # True if this position is estimated through dead-reckoning | ||
|
|
||
| # TOPICS vehicle_global_position vehicle_global_position_groundtruth external_ins_global_position | ||
| # TOPICS estimator_global_position |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
msg/translation_node/translations/translation_aux_global_position_v1.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| /**************************************************************************** | ||
| * Copyright (c) 2026 PX4 Development Team. | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| ****************************************************************************/ | ||
| #pragma once | ||
|
|
||
| #include <cmath> | ||
|
|
||
| // Translate aux_global_position: VehicleGlobalPosition v0 <--> AuxGlobalPosition v1 | ||
| #include <px4_msgs_old/msg/vehicle_global_position_v0.hpp> | ||
| #include <px4_msgs/msg/aux_global_position.hpp> | ||
|
|
||
| class AuxGlobalPositionV1Translation { | ||
| public: | ||
| using MessageOlder = px4_msgs_old::msg::VehicleGlobalPositionV0; | ||
| static_assert(MessageOlder::MESSAGE_VERSION == 0); | ||
|
|
||
| using MessageNewer = px4_msgs::msg::AuxGlobalPosition; | ||
| static_assert(MessageNewer::MESSAGE_VERSION == 1); | ||
|
|
||
| static constexpr const char* kTopic = "fmu/in/aux_global_position"; | ||
|
|
||
| static void fromOlder(const MessageOlder &msg_older, MessageNewer &msg_newer) { | ||
| msg_newer.timestamp = msg_older.timestamp; | ||
| msg_newer.timestamp_sample = msg_older.timestamp_sample; | ||
| msg_newer.id = 1; | ||
| msg_newer.source = MessageNewer::SOURCE_VISION; | ||
| msg_newer.lat = msg_older.lat; | ||
| msg_newer.lon = msg_older.lon; | ||
| msg_newer.alt = msg_older.alt_valid ? msg_older.alt : NAN; | ||
| msg_newer.eph = msg_older.eph; | ||
| msg_newer.epv = msg_older.epv; | ||
| msg_newer.lat_lon_reset_counter = msg_older.lat_lon_reset_counter; | ||
| } | ||
|
|
||
| static void toOlder(const MessageNewer &msg_newer, MessageOlder &msg_older) { | ||
| msg_older.timestamp = msg_newer.timestamp; | ||
| msg_older.timestamp_sample = msg_newer.timestamp_sample; | ||
| msg_older.lat = msg_newer.lat; | ||
| msg_older.lon = msg_newer.lon; | ||
| msg_older.alt = std::isnan(msg_newer.alt) ? 0.0f : msg_newer.alt; | ||
| msg_older.alt_ellipsoid = 0.0f; | ||
| msg_older.lat_lon_valid = true; | ||
| msg_older.alt_valid = !std::isnan(msg_newer.alt); | ||
| msg_older.delta_alt = 0.0f; | ||
| msg_older.delta_terrain = 0.0f; | ||
| msg_older.lat_lon_reset_counter = msg_newer.lat_lon_reset_counter; | ||
| msg_older.alt_reset_counter = 0; | ||
| msg_older.terrain_reset_counter = 0; | ||
| msg_older.eph = std::isnan(msg_newer.eph) ? 0.0f : msg_newer.eph; | ||
| msg_older.epv = std::isnan(msg_newer.epv) ? 0.0f : msg_newer.epv; | ||
| msg_older.terrain_alt = 0.0f; | ||
| msg_older.terrain_alt_valid = false; | ||
| msg_older.dead_reckoning = false; | ||
| } | ||
| }; | ||
|
|
||
| REGISTER_TOPIC_TRANSLATION_DIRECT(AuxGlobalPositionV1Translation); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Auxiliary global position | ||
| # | ||
| # This message provides global position data from an external source such as | ||
| # pseudolites, visual navigation, or other positioning system. | ||
|
|
||
| uint32 MESSAGE_VERSION = 1 | ||
|
|
||
| uint64 timestamp # [us] Time since system start | ||
| uint64 timestamp_sample # [us] Timestamp of the raw data | ||
|
|
||
| uint8 id # [-] Unique identifier for the AGP source | ||
| uint8 source # [@enum SOURCE] Source type of the position data (based on mavlink::GLOBAL_POSITION_SRC) | ||
| uint8 SOURCE_UNKNOWN = 0 # Unknown source | ||
| uint8 SOURCE_GNSS = 1 # GNSS | ||
| uint8 SOURCE_VISION = 2 # Vision | ||
| uint8 SOURCE_PSEUDOLITES = 3 # Pseudolites | ||
| uint8 SOURCE_TERRAIN = 4 # Terrain | ||
| uint8 SOURCE_MAGNETIC = 5 # Magnetic | ||
| uint8 SOURCE_ESTIMATOR = 6 # Estimator | ||
|
|
||
| # lat, lon: required for horizontal position fusion, alt: required for vertical position fusion | ||
| float64 lat # [deg] Latitude in WGS84 | ||
| float64 lon # [deg] Longitude in WGS84 | ||
| float32 alt # [m] [@invalid NaN] Altitude above mean sea level (AMSL) | ||
|
|
||
| float32 eph # [m] [@invalid NaN] Std dev of horizontal position, lower bounded by NOISE param | ||
| float32 epv # [m] [@invalid NaN] Std dev of vertical position, lower bounded by NOISE param | ||
|
|
||
| uint8 lat_lon_reset_counter # [-] Counter for reset events on horizontal position coordinates | ||
|
|
||
| # TOPICS aux_global_position | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.