Skip to content

feat(ulog2kml): read vehicle_gnss by default - #129

Merged
bkueng merged 2 commits into
mainfrom
dakejahl/kml-vehicle-gnss
Oct 20, 2026
Merged

bkueng merged 2 commits into
mainfrom
dakejahl/kml-vehicle-gnss

Conversation

@dakejahl

Copy link
Copy Markdown
Contributor

Summary

ulog2kml reads vehicle_gnss by default and falls back to vehicle_gps_position in older logs. It also no longer crashes on logs with flight modes numbered 18 or higher.

Problem

PX4/PX4-Autopilot#24399 renamed vehicle_gps_position to vehicle_gnss and nests the receiver sample under receiver. (receiver.latitude, receiver.longitude, receiver.altitude_msl, receiver.fix_type). With the old default topic, ulog2kml raised KeyError on logs from PX4 main, and with --topic vehicle_gnss it couldn't find the position fields.

Separately, the default color table has 18 entries, so any log that reached nav_state 18 (Auto Land) or higher raised IndexError. Callers that pass their own colors, like Flight Review, weren't affected.

Solution

With no topic given, ulog2kml loads 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 the vehicle_gnss fields also work with --topic. Default colors now repeat past the end of the table. The help-text examples name vehicle_gnss.

KML output for the sample logs and for older vehicle_gps_position and vehicle_global_position logs is byte-identical to main. ulog2ros2bag already maps vehicle_gnss to px4_msgs/VehicleGnss by name, but still skips it because composed message types aren't supported yet (existing TODO).

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
bkueng merged commit 299b0c8 into main Oct 20, 2026
8 checks passed
@bkueng
bkueng deleted the dakejahl/kml-vehicle-gnss branch October 20, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants