feat(navigator): add NavigatorModeChange uORB message for mode transition telemetry#26947
Draft
feat(navigator): add NavigatorModeChange uORB message for mode transition telemetry#26947
Conversation
…tion telemetry Introduces a new navigator_mode_change uORB topic that publishes a structured record on every navigator mode transition. Each message captures the previous and new nav state, user intention, failsafe status, whether reset_triplets() was called, horizontal speed, and distance to the active waypoint at the moment of transition. The topic is registered in logged_topics so it is automatically included in every ULog without any configuration.
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
During post-flight analysis of autonomous missions, determining why a vehicle transitioned out of a mission or into failsafe currently requires correlating multiple log topics by hand. This PR introduces a dedicated, structured record for every navigator mode transition.
What this adds
A new
navigator_mode_changeuORB topic published once per mode transition, automatically recorded to ULog. Each message captures:nav_state_prev/nav_state_new— the state transitionnav_state_user_intention— what the user intended (distinguishes commanded vs automatic transitions)in_failsafe— whether the vehicle was in failsafe at the timetriplet_reset_applied— whetherreset_triplets()was called on entryentry_velocity_xy— horizontal ground speed at the moment of transition [m/s]entry_dist_to_target— distance to the active waypoint at the moment of transition [m], NaN if noneFiles changed
msg/NavigatorModeChange.msgmsg/CMakeLists.txtsrc/modules/navigator/navigator.hpublish_mode_change()declarationsrc/modules/navigator/navigator_main.cppsrc/modules/logger/logged_topics.cppWhy uORB instead of PX4_DEBUG
Debug log strings are stripped in release builds and cannot be queried after a flight. A uORB message is recorded at full fidelity in every ULog, parseable by Flight Review and pyulog, and adds negligible overhead — one small struct publish per mode change, which is a rare event.
Testing
Verified with
listener navigator_mode_changein SITL (gazebo-classic iris). Topic publishes correctly on each mode transition. Existing navigator unit tests pass.