mirror of https://github.com/ArduPilot/ardupilot
Rover: auto navigates while stopped
This commit is contained in:
parent
70545be940
commit
3d342604f8
|
@ -76,21 +76,15 @@ void ModeAuto::update()
|
||||||
switch (_submode) {
|
switch (_submode) {
|
||||||
case Auto_WP:
|
case Auto_WP:
|
||||||
{
|
{
|
||||||
// check if we've reached the destination
|
// boats loiter once the waypoint is reached
|
||||||
if (!g2.wp_nav.reached_destination() || g2.wp_nav.is_fast_waypoint()) {
|
if (rover.is_boat() && g2.wp_nav.reached_destination() && !g2.wp_nav.is_fast_waypoint()) {
|
||||||
// update navigation controller
|
start_loiter();
|
||||||
navigate_to_waypoint();
|
|
||||||
} else {
|
|
||||||
// we have reached the destination so stay here
|
|
||||||
if (rover.is_boat()) {
|
|
||||||
if (!start_loiter()) {
|
|
||||||
start_stop();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
start_stop();
|
|
||||||
}
|
|
||||||
// update distance to destination
|
// update distance to destination
|
||||||
_distance_to_destination = rover.current_loc.get_distance(g2.wp_nav.get_destination());
|
_distance_to_destination = rover.current_loc.get_distance(g2.wp_nav.get_destination());
|
||||||
|
} else {
|
||||||
|
// update navigation controller
|
||||||
|
navigate_to_waypoint();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue