mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 10:21:35 +08:00
Merge branch 'waypoint_loiter' of github.com:PX4/Firmware into fixedwing_l1
This commit is contained in:
@@ -167,9 +167,9 @@ bool set_special_fields(float param1, float param2, float param3, float param4,
|
|||||||
sp->loiter_direction = (param3 >= 0) ? 1 : -1;
|
sp->loiter_direction = (param3 >= 0) ? 1 : -1;
|
||||||
|
|
||||||
sp->param1 = param1;
|
sp->param1 = param1;
|
||||||
sp->param1 = param2;
|
sp->param2 = param2;
|
||||||
sp->param1 = param3;
|
sp->param3 = param3;
|
||||||
sp->param1 = param4;
|
sp->param4 = param4;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -417,6 +417,7 @@ void check_waypoints_reached(uint64_t now, const struct vehicle_global_position_
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (time_elapsed) {
|
if (time_elapsed) {
|
||||||
|
|
||||||
if (cur_wp->autocontinue) {
|
if (cur_wp->autocontinue) {
|
||||||
cur_wp->current = 0;
|
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) {
|
if (wpm->current_active_wp_id == wpm->size - 1 && wpm->size > 1) {
|
||||||
/* the last waypoint was reached, if auto continue is
|
/* 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 {
|
} else {
|
||||||
if ((uint16_t)(wpm->current_active_wp_id + 1) < wpm->size)
|
if ((uint16_t)(wpm->current_active_wp_id + 1) < wpm->size)
|
||||||
|
|||||||
Reference in New Issue
Block a user