Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigator: Loiter: always establish new Loiter with center at current… #21798

Merged
merged 1 commit into from
Jul 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/modules/navigator/loiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Loiter::on_activation()
reposition();

} else {
// this is executed when the flight mode is switched to Hold manually, not through a reposition
set_loiter_position();
}

Expand Down Expand Up @@ -109,16 +110,11 @@ Loiter::set_loiter_position()
_mission_item.nav_cmd = NAV_CMD_IDLE;

} else {
if (pos_sp_triplet->current.valid && pos_sp_triplet->current.type == position_setpoint_s::SETPOINT_TYPE_LOITER) {
setLoiterItemFromCurrentPositionSetpoint(&_mission_item);
if (_navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING) {
setLoiterItemFromCurrentPositionWithBreaking(&_mission_item);

} else {
if (_navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING) {
setLoiterItemFromCurrentPositionWithBreaking(&_mission_item);

} else {
setLoiterItemFromCurrentPosition(&_mission_item);
}
setLoiterItemFromCurrentPosition(&_mission_item);
}

}
Expand Down
Loading