in mc auto: do not reset the position sp while near the waypoint, should make switching to manual pos control smoother

This commit is contained in:
Andreas Antener
2015-12-19 07:39:48 +01:00
committed by Lorenz Meier
parent 5a009ce4c8
commit 09b5bdb1ee
5 changed files with 14 additions and 3 deletions
+1 -2
View File
@@ -84,12 +84,11 @@ Takeoff::on_activation()
struct position_setpoint_triplet_s *pos_sp_triplet = _navigator->get_position_setpoint_triplet();
pos_sp_triplet->previous.valid = false;
mission_item_to_position_setpoint(&_mission_item, &pos_sp_triplet->current);
pos_sp_triplet->current.type = position_setpoint_s::SETPOINT_TYPE_LOITER;
pos_sp_triplet->current.yaw = _navigator->get_home_position()->yaw;
pos_sp_triplet->current.yaw_valid = true;
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_can_loiter_at_sp(true);
_navigator->set_position_setpoint_triplet_updated();
}