Skip to content

Commit

Permalink
ArduCopter: support for Mount following the lead vehicle in follow mode
Browse files Browse the repository at this point in the history
  • Loading branch information
khanasif786 authored and magicrub committed May 26, 2023
1 parent d367483 commit edf9fbd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ArduCopter/mode_follow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ bool ModeFollow::init(const bool ignore_checks)
gcs().send_text(MAV_SEVERITY_WARNING, "Set FOLL_ENABLE = 1");
return false;
}

#if HAL_MOUNT_ENABLED
AP_Mount *mount = AP_Mount::get_singleton();
// follow the lead vehicle using sysid
if (g2.follow.option_is_enabled(AP_Follow::Option::MOUNT_FOLLOW_ON_ENTER) && mount != nullptr) {
mount->set_target_sysid(g2.follow.get_target_sysid());
}
#endif

// re-use guided mode
return ModeGuided::init(ignore_checks);
}
Expand Down

0 comments on commit edf9fbd

Please sign in to comment.