navigator: Wrap get time inside into function call and set time inside to zero

This ensures that the dual-use of the pitch_min / time_inside field is handled
properly between takeoff and non-takeoff items. Flight tested in SITL.
This commit is contained in:
Lorenz Meier
2016-10-23 11:40:08 +02:00
committed by Lorenz Meier
parent 5ddd69c872
commit 05bc9acfb7
4 changed files with 13 additions and 11 deletions
+2 -2
View File
@@ -271,8 +271,8 @@ RTL::set_rtl_item()
_navigator->set_can_loiter_at_sp(true);
if (autoland && (_mission_item.time_inside > FLT_EPSILON)) {
mavlink_log_info(_navigator->get_mavlink_log_pub(), "RTL: loiter %.1fs", (double)_mission_item.time_inside);
if (autoland && (Navigator::get_time_inside(_mission_item) > FLT_EPSILON)) {
mavlink_log_info(_navigator->get_mavlink_log_pub(), "RTL: loiter %.1fs", (double)Navigator::get_time_inside(_mission_item));
} else {
mavlink_log_info(_navigator->get_mavlink_log_pub(), "RTL: completed, loiter");