Skip to content

Commit

Permalink
AP_Camera: send mavlink camera feedback message even if no logger
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker authored and WickedShell committed Jan 28, 2020
1 parent cc5359d commit 8b20c82
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions libraries/AP_Camera/AP_Camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,19 +400,22 @@ void AP_Camera::setup_feedback_callback(void)
// log_picture - log picture taken and send feedback to GCS
void AP_Camera::log_picture()
{
if (!using_feedback_pin()) {
gcs().send_message(MSG_CAMERA_FEEDBACK);
}

AP_Logger *logger = AP_Logger::get_singleton();
if (logger == nullptr) {
return;
}
if (!logger->should_log(log_camera_bit)) {
return;
}

if (!using_feedback_pin()) {
gcs().send_message(MSG_CAMERA_FEEDBACK);
if (logger->should_log(log_camera_bit)) {
logger->Write_Camera(current_loc);
}
logger->Write_Camera(current_loc);
} else {
if (logger->should_log(log_camera_bit)) {
logger->Write_Trigger(current_loc);
}
logger->Write_Trigger(current_loc);
}
}

Expand Down

0 comments on commit 8b20c82

Please sign in to comment.