diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-09-07 09:50:37 -0700 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-09-07 09:50:37 -0700 |
commit | 751c026469f1504e94f46884a641a2838a4015ad (patch) | |
tree | a5675ef6dc09057078909d6346cbd7822f0faae8 /src/modules/mavlink/waypoints.c | |
parent | b599a32c1695d429849d41b398c1b4a586300ee9 (diff) | |
parent | 127832b8fdec4a81b81d332e68f20d62e609023e (diff) | |
download | px4-firmware-751c026469f1504e94f46884a641a2838a4015ad.tar.gz px4-firmware-751c026469f1504e94f46884a641a2838a4015ad.tar.bz2 px4-firmware-751c026469f1504e94f46884a641a2838a4015ad.zip |
Merge pull request #381 from PX4/waypoint_loiter
Have systems loiter at the last waypoint
Diffstat (limited to 'src/modules/mavlink/waypoints.c')
-rw-r--r-- | src/modules/mavlink/waypoints.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/mavlink/waypoints.c b/src/modules/mavlink/waypoints.c index 16a7c2d35..c6c2eac68 100644 --- a/src/modules/mavlink/waypoints.c +++ b/src/modules/mavlink/waypoints.c @@ -417,6 +417,7 @@ void check_waypoints_reached(uint64_t now, const struct vehicle_global_position_ } if (time_elapsed) { + if (cur_wp->autocontinue) { cur_wp->current = 0; @@ -425,9 +426,10 @@ void check_waypoints_reached(uint64_t now, const struct vehicle_global_position_ if (wpm->current_active_wp_id == wpm->size - 1 && wpm->size > 1) { /* the last waypoint was reached, if auto continue is - * activated restart the waypoint list from the beginning + * activated keep the system loitering there. */ - wpm->current_active_wp_id = 0; + cur_wp->command = MAV_CMD_NAV_LOITER_UNLIM; + cur_wp->param3 = 15.0f; // XXX magic number 15 m loiter radius } else { if ((uint16_t)(wpm->current_active_wp_id + 1) < wpm->size) |