Skip to content

feat(navigator): add NavigatorModeChange uORB message for mode transition telemetry#26947

Draft
Rpirayesh wants to merge 4 commits intoPX4:mainfrom
Rpirayesh:feature/navigator-mode-change-telemetry
Draft

feat(navigator): add NavigatorModeChange uORB message for mode transition telemetry#26947
Rpirayesh wants to merge 4 commits intoPX4:mainfrom
Rpirayesh:feature/navigator-mode-change-telemetry

Conversation

@Rpirayesh
Copy link
Copy Markdown

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_change uORB topic published once per mode transition, automatically recorded to ULog. Each message captures:

  • nav_state_prev / nav_state_new — the state transition
  • nav_state_user_intention — what the user intended (distinguishes commanded vs automatic transitions)
  • in_failsafe — whether the vehicle was in failsafe at the time
  • triplet_reset_applied — whether reset_triplets() was called on entry
  • entry_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 none

Files changed

File Change
msg/NavigatorModeChange.msg New message definition
msg/CMakeLists.txt Register new message in build
src/modules/navigator/navigator.h Add publisher + publish_mode_change() declaration
src/modules/navigator/navigator_main.cpp Detect transitions, capture context, publish
src/modules/logger/logged_topics.cpp Register topic for automatic ULog recording

Why 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_change in SITL (gazebo-classic iris). Topic publishes correctly on each mode transition. Existing navigator unit tests pass.

make tests TESTFILTER=navigator

…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.
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.

1 participant