Navigator/FW Position Control: VTOL front towards specified transition heading if available

If the current yaw setpoint is valid we should use it to make the transition in this direction.
For a VTOL_TAKEOFF the yaw_setpoint is used to specify the transition direction (the
vehicle is aligned towards it and then transition is started). The current yaw can be
a bit off (e.g. because MIS_YAW_ERR is large), and it is better to track the actual setpoint.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2022-09-14 08:55:20 +02:00
parent 82b28bc72f
commit f9b6edab07
2 changed files with 14 additions and 4 deletions
+7 -1
View File
@@ -887,7 +887,13 @@ MissionBlock::set_vtol_transition_item(struct mission_item_s *item, const uint8_
item->nav_cmd = NAV_CMD_DO_VTOL_TRANSITION;
item->params[0] = (float) new_mode;
item->params[1] = 0.0f;
item->yaw = _navigator->get_local_position()->heading; // ideally that would be course and not heading
// Keep yaw from previous mission item if valid, as that is containing the transition heading.
// If not valid use current yaw as yaw setpoint
if (!PX4_ISFINITE(item->yaw)) {
item->yaw = _navigator->get_local_position()->heading; // ideally that would be course and not heading
}
item->autocontinue = true;
}