mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-18 18:09:05 +08:00
Fix VTOL_LAND to have correct SETPOINT_TYPE
This commit is contained in:
parent
aafeab63d5
commit
240c8fbee1
@ -561,7 +561,7 @@ Mission::set_mission_items()
|
||||
/* ignore yaw for landing items */
|
||||
/* XXX: if specified heading for landing is desired we could add another step before the descent
|
||||
* that aligns the vehicle first */
|
||||
if (_mission_item.nav_cmd == NAV_CMD_LAND) {
|
||||
if (_mission_item.nav_cmd == NAV_CMD_LAND || _mission_item.nav_cmd == NAV_CMD_VTOL_LAND ) {
|
||||
_mission_item.yaw = NAN;
|
||||
}
|
||||
|
||||
@ -762,8 +762,9 @@ void
|
||||
Mission::heading_sp_update()
|
||||
{
|
||||
/* we don't want to be yawing during takeoff, landing or aligning for a transition */
|
||||
if (_mission_item.nav_cmd == NAV_CMD_TAKEOFF
|
||||
if (_mission_item.nav_cmd == NAV_CMD_TAKEOFF
|
||||
|| _mission_item.nav_cmd == NAV_CMD_LAND
|
||||
|| _mission_item.nav_cmd == NAV_CMD_VTOL_LAND
|
||||
|| _work_item_type == WORK_ITEM_TYPE_ALIGN) {
|
||||
return;
|
||||
}
|
||||
@ -854,7 +855,9 @@ Mission::altitude_sp_foh_update()
|
||||
|
||||
/* Don't do FOH for landing and takeoff waypoints, the ground may be near
|
||||
* and the FW controller has a custom landing logic */
|
||||
if (_mission_item.nav_cmd == NAV_CMD_LAND || _mission_item.nav_cmd == NAV_CMD_TAKEOFF) {
|
||||
if (_mission_item.nav_cmd == NAV_CMD_LAND
|
||||
|| _mission_item.nav_cmd == NAV_CMD_VTOL_LAND
|
||||
|| _mission_item.nav_cmd == NAV_CMD_TAKEOFF) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -93,7 +93,8 @@ MissionBlock::is_mission_item_reached()
|
||||
case NAV_CMD_DO_SET_SERVO:
|
||||
return true;
|
||||
|
||||
case NAV_CMD_LAND:
|
||||
case NAV_CMD_LAND: /* fall through */
|
||||
case NAV_CMD_VTOL_LAND:
|
||||
return _navigator->get_vstatus()->condition_landed;
|
||||
|
||||
/* TODO: count turns */
|
||||
@ -358,10 +359,12 @@ MissionBlock::mission_item_to_position_setpoint(const struct mission_item_s *ite
|
||||
break;
|
||||
|
||||
case NAV_CMD_TAKEOFF:
|
||||
case NAV_CMD_VTOL_TAKEOFF:
|
||||
sp->type = position_setpoint_s::SETPOINT_TYPE_TAKEOFF;
|
||||
break;
|
||||
|
||||
case NAV_CMD_LAND:
|
||||
case NAV_CMD_VTOL_LAND:
|
||||
sp->type = position_setpoint_s::SETPOINT_TYPE_LAND;
|
||||
if(_navigator->get_vstatus()->is_vtol && _param_vtol_wv_land.get()){
|
||||
sp->disable_mc_yaw_control = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user