diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2013-11-26 15:24:16 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2013-11-26 15:24:16 +0100 |
commit | 126b0567feb7384ce30997f01a5e9eb873e018aa (patch) | |
tree | d708378673d95ef66deb894c5c0f6c59dede13c2 /src/modules/navigator | |
parent | 9a79ad4cdb72bfa8a878eb522d17b51ff640b002 (diff) | |
download | px4-firmware-126b0567feb7384ce30997f01a5e9eb873e018aa.tar.gz px4-firmware-126b0567feb7384ce30997f01a5e9eb873e018aa.tar.bz2 px4-firmware-126b0567feb7384ce30997f01a5e9eb873e018aa.zip |
add safety check for orbit in navigator. Prevents issues with old qgc versions
Diffstat (limited to 'src/modules/navigator')
-rw-r--r-- | src/modules/navigator/navigator_main.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/navigator/navigator_main.cpp b/src/modules/navigator/navigator_main.cpp index 399985442..936e0589c 100644 --- a/src/modules/navigator/navigator_main.cpp +++ b/src/modules/navigator/navigator_main.cpp @@ -952,13 +952,14 @@ Navigator::check_mission_item_reached() uint64_t now = hrt_absolute_time(); float orbit; - if (_mission_item_triplet.current.nav_cmd == NAV_CMD_WAYPOINT) { + if (_mission_item_triplet.current.nav_cmd == NAV_CMD_WAYPOINT && _mission_item_triplet.current.radius > 0.01f) { orbit = _mission_item_triplet.current.radius; } else if (_mission_item_triplet.current.nav_cmd == NAV_CMD_LOITER_TURN_COUNT || _mission_item_triplet.current.nav_cmd == NAV_CMD_LOITER_TIME_LIMIT || - _mission_item_triplet.current.nav_cmd == NAV_CMD_LOITER_UNLIMITED) { + _mission_item_triplet.current.nav_cmd == NAV_CMD_LOITER_UNLIMITED && + _mission_item_triplet.current.loiter_radius > 0.01f) { orbit = _mission_item_triplet.current.loiter_radius; } else { |