loiter: remove yaw_mode param and logic

This commit is contained in:
Dennis Mannhart
2018-08-03 08:24:34 +02:00
committed by Dennis Mannhart
parent 2302c64004
commit f0140a6290
-20
View File
@@ -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