File tree 2 files changed +15
-0
lines changed
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -597,6 +597,11 @@ class Copter : public AP_Vehicle {
597
597
598
598
bool standby_active;
599
599
600
+ #if HAL_MOUNT_ENABLED
601
+ // true if the last time we checked the flightmode was landing:
602
+ bool was_landing;
603
+ #endif
604
+
600
605
static const AP_Scheduler::Task scheduler_tasks[];
601
606
static const AP_Param::Info var_info[];
602
607
static const struct LogStructure log_structure[];
Original file line number Diff line number Diff line change @@ -422,6 +422,16 @@ void Copter::update_flight_mode()
422
422
surface_tracking.invalidate_for_logging (); // invalidate surface tracking alt, flight mode will set to true if used
423
423
424
424
flightmode->run ();
425
+
426
+ #if HAL_MOUNT_ENABLED
427
+ {
428
+ const bool is_landing = flightmode->is_landing ();
429
+ if (is_landing && !was_landing) {
430
+ camera_mount.vehicle_has_started_to_land ();
431
+ }
432
+ was_landing = is_landing;
433
+ }
434
+ #endif
425
435
}
426
436
427
437
// exit_mode - high level call to organise cleanup as a flight mode is exited
You can’t perform that action at this time.
0 commit comments