Skip to content

Move writing of compass log messages into compass library#33064

Merged
peterbarker merged 2 commits into
ArduPilot:masterfrom
peterbarker:pr-claude/move-write-compass-to-AP_Compass_Logging
May 26, 2026
Merged

Move writing of compass log messages into compass library#33064
peterbarker merged 2 commits into
ArduPilot:masterfrom
peterbarker:pr-claude/move-write-compass-to-AP_Compass_Logging

Conversation

@peterbarker

Copy link
Copy Markdown
Contributor

Summary

Mirror structure used by baro already for logging

Classification & Testing (check all that apply and add your own)

  • Checked by a human programmer
  • Non-functional change
  • No-binary change
  • Infrastructure change (e.g. unit tests, helper scripts)
  • Automated test(s) verify changes (e.g. unit test, autotest)
  • Tested manually, description below (e.g. SITL)
  • Tested on hardware
  • Logs attached
  • Logs available on request

Still get log messages in SITL:

1970-01-01 10:00:09.03: MAG {TimeUS : 9039716, I : 0, MagX : 224, MagY : 80, MagZ : -528, OfsX : 5, OfsY : 13, OfsZ : -18, MOX : 0, MOY : 0, MOZ : 0, Health : 1, S : 9039716}
1970-01-01 10:00:09.03: MAG {TimeUS : 9039716, I : 1, MagX : 224, MagY : 80, MagZ : -528, OfsX : 5, OfsY : 13, OfsZ : -18, MOX : 0, MOY : 0, MOZ : 0, Health : 1, S : 9039716}
1970-01-01 10:00:09.03: MAG {TimeUS : 9039716, I : 2, MagX : 224, MagY : 80, MagZ : -528, OfsX : 5, OfsY : 13, OfsZ : -18, MOX : 0, MOY : 0, MOZ : 0, Health : 1, S : 9039716}
Board,plane
MatekF405,-16

Description

Moves the implementation from A to B - same pattern we use for the baro library.

Doing this to simplify a PR moving logging around.

@@ -1861,7 +1861,7 @@ Compass::read(void)
#endif
#if HAL_LOGGING_ENABLED
if (any_healthy && _log_bit != (uint32_t)-1 && AP::logger().should_log(_log_bit)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is a existing problem, but I really want logs if my compass is not healthy.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will review and almost certainly approve a PR which logs compasses even if they are all unhealthy.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

909e5d6 - we used to not log any unless the first was healthy!

@peterbarker peterbarker force-pushed the pr-claude/move-write-compass-to-AP_Compass_Logging branch from bb20400 to 29bf985 Compare May 18, 2026 00:41
@peterbarker peterbarker force-pushed the pr-claude/move-write-compass-to-AP_Compass_Logging branch from 29bf985 to 6ad301f Compare May 20, 2026 08:40
@peterbarker peterbarker force-pushed the pr-claude/move-write-compass-to-AP_Compass_Logging branch from 6ad301f to c4f9232 Compare May 25, 2026 06:00
@peterbarker peterbarker merged commit 06bd4be into ArduPilot:master May 26, 2026
109 checks passed
@github-project-automation github-project-automation Bot moved this from ReadyForDevCall to Done in Peter's ArduPilot 4.8 Queue May 26, 2026
@peterbarker peterbarker deleted the pr-claude/move-write-compass-to-AP_Compass_Logging branch May 27, 2026 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants