Repository navigation
feat(ulog2kml): read vehicle_gnss by default - #129
Merged
Merged
Conversation
PX4 renamed vehicle_gps_position to vehicle_gnss and nests the receiver sample under 'receiver.' (PX4/PX4-Autopilot#24399), so ulog2kml found no position in logs from PX4 main. The default topic is now vehicle_gnss, falling back to vehicle_gps_position in older logs.
The default color table has 18 entries, so a log reaching nav_state 18 (Auto Land) or higher raised IndexError.
bkueng
approved these changes
Oct 20, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
ulog2kmlreadsvehicle_gnssby default and falls back tovehicle_gps_positionin older logs. It also no longer crashes on logs with flight modes numbered 18 or higher.Problem
PX4/PX4-Autopilot#24399 renamed
vehicle_gps_positiontovehicle_gnssand nests the receiver sample underreceiver.(receiver.latitude,receiver.longitude,receiver.altitude_msl,receiver.fix_type). With the old default topic,ulog2kmlraisedKeyErroron logs from PX4 main, and with--topic vehicle_gnssit couldn't find the position fields.Separately, the default color table has 18 entries, so any log that reached
nav_state18 (Auto Land) or higher raisedIndexError. Callers that pass their own colors, like Flight Review, weren't affected.Solution
With no topic given,
ulog2kmlloads both GNSS topics and uses whichever the log has. Each position field is looked up under all of its names (lon,longitude_deg,receiver.longitude), so thevehicle_gnssfields also work with--topic. Default colors now repeat past the end of the table. The help-text examples namevehicle_gnss.KML output for the sample logs and for older
vehicle_gps_positionandvehicle_global_positionlogs is byte-identical tomain.ulog2ros2bagalready mapsvehicle_gnsstopx4_msgs/VehicleGnssby name, but still skips it because composed message types aren't supported yet (existing TODO).