Skip to content

AP_Camera: avoid SITL panic if pic taken with no pos estimate #29558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

rmackay9
Copy link
Contributor

This resolves issue #29530 by checking that the current_loc has been initialised before attempting to get the altitude from it.

This fix is thanks to @blaab2 and the commit is co-authored with him, thanks!

I've lightly tested this in SITL by performing a before/after test to confirm the issue occurs before this fix and does not afterwards.

BTW, the issue can be reproduced in SITL by doing this:

  1. rm eeprom.bin file
  2. start SITL
  3. param set LOG_DISARMED 1
  4. param set GPS1_TYPE 0
  5. restart SITL
  6. right-mouse-button click on MP's map and select, "Trigger Camera NOW"

Below is a screenshot of what appears in the LOGS which is a mostly zero message
image

Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

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

LGTM

@peterbarker peterbarker merged commit bcc7886 into ArduPilot:master Mar 18, 2025
102 checks passed
@rmackay9 rmackay9 removed this from 4.6 Backports Mar 18, 2025
@rmackay9 rmackay9 deleted the camera-nopos-sitl branch March 18, 2025 23:16
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