mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-05 10:40:35 +08:00
abort front transition in vtol module instead of in navigator/rtl.cpp
This commit is contained in:
@@ -229,8 +229,7 @@ void RTL::find_RTL_destination()
|
||||
}
|
||||
|
||||
if (_param_rtl_cone_half_angle_deg.get() > 0
|
||||
&& _navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING
|
||||
&& !_navigator->get_vstatus()->in_transition_to_fw) {
|
||||
&& _navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING) {
|
||||
_rtl_alt = calculate_return_alt_from_cone_half_angle((float)_param_rtl_cone_half_angle_deg.get());
|
||||
|
||||
} else {
|
||||
@@ -242,15 +241,6 @@ void RTL::on_activation()
|
||||
{
|
||||
_rtl_state = RTL_STATE_NONE;
|
||||
|
||||
// send a back transition command in case we're doing a front transition to abort the FT
|
||||
if (_navigator->get_vstatus()->in_transition_to_fw) {
|
||||
vehicle_command_s cmd {};
|
||||
cmd.command = vehicle_command_s::VEHICLE_CMD_DO_VTOL_TRANSITION;
|
||||
cmd.param1 = (float)(vtol_vehicle_status_s::VEHICLE_VTOL_STATE_MC);
|
||||
cmd.param2 = 0.0f;
|
||||
_navigator->publish_vehicle_cmd(&cmd);
|
||||
}
|
||||
|
||||
// if a mission landing is desired we should only execute mission navigation mode if we currently are in fw mode
|
||||
// In multirotor mode no landing pattern is required so we can just navigate to the land point directly and don't need to run mission
|
||||
_should_engange_mission_for_landing = (_destination.type == RTL_DESTINATION_MISSION_LANDING)
|
||||
|
||||
Reference in New Issue
Block a user