Plane: quadplane: improve mav_type reporting

This commit is contained in:
TsuyoshiKawamura 2022-09-01 03:51:06 +09:00 committed by tajisoft
parent f192d2644c
commit 0368353cfe
1 changed files with 11 additions and 2 deletions

View File

@ -3789,10 +3789,19 @@ bool QuadPlane::using_wp_nav(void) const
*/
MAV_TYPE QuadPlane::get_mav_type(void) const
{
if (mav_type.get() == 0) {
if (mav_type.get() != 0) {
return MAV_TYPE(mav_type.get());
}
if (!available()) {
return MAV_TYPE_FIXED_WING;
}
return MAV_TYPE(mav_type.get());
if (tiltrotor.enabled()) {
return MAV_TYPE_VTOL_TILTROTOR;
}
if (motors->get_frame_mav_type() == MAV_TYPE_QUADROTOR) {
return MAV_TYPE_VTOL_QUADROTOR;
}
return motors->get_frame_mav_type();
}
/*