mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 11:06:04 +08:00
mission: keep current heading if close to ROI while heading sp is invalid
This commit is contained in:
committed by
Julian Oes
parent
a9dacae57e
commit
08fdc90175
@@ -1321,6 +1321,7 @@ Mission::heading_sp_update()
|
|||||||
case vehicle_roi_s::ROI_TARGET:
|
case vehicle_roi_s::ROI_TARGET:
|
||||||
case vehicle_roi_s::ROI_ENUM_END:
|
case vehicle_roi_s::ROI_ENUM_END:
|
||||||
default: {
|
default: {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1339,6 +1340,13 @@ Mission::heading_sp_update()
|
|||||||
_mission_item.yaw = yaw;
|
_mission_item.yaw = yaw;
|
||||||
pos_sp_triplet->current.yaw = _mission_item.yaw;
|
pos_sp_triplet->current.yaw = _mission_item.yaw;
|
||||||
pos_sp_triplet->current.yaw_valid = true;
|
pos_sp_triplet->current.yaw_valid = true;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (!pos_sp_triplet->current.yaw_valid) {
|
||||||
|
_mission_item.yaw = _navigator->get_local_position()->yaw;
|
||||||
|
pos_sp_triplet->current.yaw = _mission_item.yaw;
|
||||||
|
pos_sp_triplet->current.yaw_valid = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// we set yaw directly so we can run this in parallel to the FOH update
|
// we set yaw directly so we can run this in parallel to the FOH update
|
||||||
|
|||||||
Reference in New Issue
Block a user