QGC代码架构解析:飞行前检查(起飞条件)

QGC中,飞行状态指示器(Flight Status Indicator)显示的状态列表:

状态名称 说明
准备好飞速 (_绿色背景) 载具已准备就绪,可以起飞
准备好飞行 (_黄色背景) 载具已准备好在当前飞行模式下飞行,但有些警告可能造成问题
尚未准备好 载具没有准备好飞行,也不会起飞
解锁 载具已解锁并准备起飞。
飞行 载具正在飞行
着陆 载具正在着陆
通信丢失 QGC已失去与载具的通信

更多信息,参考飞行视图工具栏

1. 解锁检查项

  • 气压计(Barometer)
  • 指南针(Compass)
  • GPS 锁定(GPS lock)
  • 惯性导航系统(INS)
  • 参数(Parameters)
  • 遥控通道(RC Channels)
  • 电路板电压(Board voltage)
  • 电池电量(Battery Level)
  • 空速(Airspeed)
  • 日志记录可用(Logging Available)
  • 硬件安全开关(Hardware safety switch)
  • GPS 配置(GPS Configuration)
  • 系统(System) :Safety Setup (ArduPilot)

检查实现函数:HealthAndArmingCheckReport::update

QGC提供了可选的飞行前检查清单功能:Pre Flight Checklist

备注:

  • 通常情况下,不需要手动解锁飞机。简单地起飞或开始执行任务时,飞行器会自动解锁。
  • 不同的飞行器类型(多旋翼、固定翼、地面车、潜水器)可能有略微不同的解锁检查项,但核心检查项是相似的。

2. MAV_MODE

MAV_MODE枚举定义了飞行器的标准飞行模式。不同的飞行模式决定了飞行器的行为和控制方式,设置命令是MAV_CMD_DO_SET_MODE

// common/common.h
typedef enum MAV_MODE
{
   MAV_MODE_PREFLIGHT=0, /* System is not ready to fly, booting, calibrating, etc. No flag is set. | */
   MAV_MODE_MANUAL_DISARMED=64, /* System is allowed to be active, under manual (RC) control, no stabilization | */
   MAV_MODE_TEST_DISARMED=66, /* UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | */
   MAV_MODE_STABILIZE_DISARMED=80, /* System is allowed to be active, under assisted RC control. | */
   MAV_MODE_GUIDED_DISARMED=88, /* System is allowed to be active, under autonomous control, manual setpoint | */
   MAV_MODE_AUTO_DISARMED=92, /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints) | */
   MAV_MODE_MANUAL_ARMED=192, /* System is allowed to be active, under manual (RC) control, no stabilization | */
   MAV_MODE_TEST_ARMED=194, /* UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | */
   MAV_MODE_STABILIZE_ARMED=208, /* System is allowed to be active, under assisted RC control. | */
   MAV_MODE_GUIDED_ARMED=216, /* System is allowed to be active, under autonomous control, manual setpoint | */
   MAV_MODE_AUTO_ARMED=220, /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints) | */
   MAV_MODE_ENUM_END=221, /*  | */
} MAV_MODE;

结合文章QGC代码架构解析:MAVLink Mission Protocol,以及 QGC 航点管理查看MAV_CMD相关命令。




    Enjoy Reading This Article?

    Here are some more articles you might like to read next:

  • al-folio 本地部署记录(Ubuntu 24.04)
  • C++ Traits
  • 道格拉斯-普克算法(Douglas–Peucker algorithm)
  • CMake支持库收集
  • QGC代码架构解析:MAVLink Mission Protocol,以及 QGC 航点管理