Skip to content
Snippets Groups Projects
Commit f0140a62 authored by Dennis Mannhart's avatar Dennis Mannhart Committed by Dennis Mannhart
Browse files

loiter: remove yaw_mode param and logic

parent 2302c640
No related branches found
No related tags found
No related merge requests found
......@@ -112,7 +112,6 @@ Loiter::set_loiter_position()
pos_sp_triplet->next.valid = false;
_navigator->set_can_loiter_at_sp(pos_sp_triplet->current.type == position_setpoint_s::SETPOINT_TYPE_LOITER);
_navigator->set_position_setpoint_triplet_updated();
}
......@@ -139,26 +138,7 @@ Loiter::reposition()
memcpy(&pos_sp_triplet->current, &rep->current, sizeof(rep->current));
pos_sp_triplet->next.valid = false;
// set yaw (depends on the value of parameter MIS_YAWMODE):
// MISSION_YAWMODE_NONE: do not change yaw setpoint
// MISSION_YAWMODE_FRONT_TO_WAYPOINT: point to next waypoint
if (_param_yawmode.get() != MISSION_YAWMODE_NONE) {
float travel_dist = get_distance_to_next_waypoint(_navigator->get_global_position()->lat,
_navigator->get_global_position()->lon,
pos_sp_triplet->current.lat, pos_sp_triplet->current.lon);
if (travel_dist > 1.0f) {
// calculate direction the vehicle should point to.
pos_sp_triplet->current.yaw = get_bearing_to_next_waypoint(
_navigator->get_global_position()->lat,
_navigator->get_global_position()->lon,
pos_sp_triplet->current.lat,
pos_sp_triplet->current.lon);
}
}
_navigator->set_can_loiter_at_sp(pos_sp_triplet->current.type == position_setpoint_s::SETPOINT_TYPE_LOITER);
_navigator->set_position_setpoint_triplet_updated();
// mark this as done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment