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 16:26:03 +02:00
committed by Lorenz Meier
parent 5ddd69c872
commit 05bc9acfb7
4 changed files with 13 additions and 11 deletions
+2 -1
View File
@@ -325,7 +325,8 @@ MissionBlock::is_mission_item_reached()
}
/* check if the MAV was long enough inside the waypoint orbit */
if (now - _time_first_inside_orbit >= (hrt_abstime)_mission_item.time_inside * 1e6f) {
if ((Navigator::get_time_inside(_mission_item) < FLT_EPSILON) ||
(now - _time_first_inside_orbit >= (hrt_abstime)(Navigator::get_time_inside(_mission_item) * 1e6f))) {
// exit xtrack location
if (_mission_item.loiter_exit_xtrack &&