mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 03:23:33 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user