mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 12:13:34 +08:00
loiter: remove yaw_mode param and logic
This commit is contained in:
committed by
Dennis Mannhart
parent
2302c64004
commit
f0140a6290
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user