mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-16 22:21:36 +08:00
mission: on activation in fw mode make sure mission index > transition point index
Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -208,6 +208,15 @@ Mission::on_activation()
|
|||||||
cmd.param1 = -1.0f;
|
cmd.param1 = -1.0f;
|
||||||
cmd.param3 = 0.0f;
|
cmd.param3 = 0.0f;
|
||||||
_navigator->publish_vehicle_cmd(&cmd);
|
_navigator->publish_vehicle_cmd(&cmd);
|
||||||
|
|
||||||
|
if (_navigator->get_vstatus()->is_vtol
|
||||||
|
&& _navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_FIXED_WING) {
|
||||||
|
// if we are already in fixed wing flight then make sure that the current active waypoint
|
||||||
|
// is after the transition to forward flight waypoint
|
||||||
|
if (_first_fixed_wing_waypoint_index > 0 && _current_mission_index < _first_fixed_wing_waypoint_index) {
|
||||||
|
set_current_mission_index(_first_fixed_wing_waypoint_index);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -585,8 +594,8 @@ Mission::update_mission()
|
|||||||
// if we are already in fixed wing flight then make sure that the current active waypoint
|
// if we are already in fixed wing flight then make sure that the current active waypoint
|
||||||
// is after the transition to forward flight waypoint
|
// is after the transition to forward flight waypoint
|
||||||
|
|
||||||
if (_current_mission_index < _first_fixed_wing_waypoint_index) {
|
if (_first_fixed_wing_waypoint_index > 0 && _current_mission_index < _first_fixed_wing_waypoint_index) {
|
||||||
_current_mission_index = _first_fixed_wing_waypoint_index;
|
set_current_mission_index(_first_fixed_wing_waypoint_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user