无人机系统图
一个高性能的飞控软件需要哪些模块?
- 提供实时操作系统,创建子任务后有互不干扰;
- 运行驱动程序,驱动外设硬件,包括加速度计、角速度计、磁罗盘、GPS、测距传感器、光流传感器、空速计、温度传感器,可控制的吊舱、相机、吊运系统等等;
- 完善的中间件库,如参数库,分布式收发的信息交互,与地面站、机载计算机或其他设备通信的协议库,数学库、控制库,日志记录等;
- 各种上层app,如导航app,控制app,制导app,机型管理,模式切换,健康监测,余度管理等
软件架构图
PX4可以运行的硬件
参考 https://docs.px4.io/master/en/flight_controller/
PX4支持的RTOS
从源代码platforms上可看出,PX4支持多种运行平台,包括Nuttx,Linux,Qurt。其中QuRT是高通自研RTOS,专门匹配其自家芯片。
常用的pixhawk使用nuttx RTOS。
以下是计算密集型任务的自动驾驶仪
硬件 | 描述 | RTOS |
Qualcomm Snapdragon Flight | 一台高端自动驾驶仪计算机,在DSP上运行PX4(在QuRT RTOS上)。 它包括一个相机和WiFi。 | QuRT |
Intel® Aero Ready to Fly Drone | UAS开发平台,集成了功能强大的Linux计算机,NuttX上的PX4和单个包中的摄像头。 | Linux |
Raspberry Pi 2/3 Navio2 | RaPi可以连接到自动驾驶仪并用作配套计算机。 | Linux |
PX4上运行的app
nsh> help
help usage: help [-v] [<cmd>]
. cd env free mkfatfs rm test usleep
[ cp exec help mount rmdir time
? date exit kill mv set true
break df export ls ps sleep umount
cat echo false mkdir pwd source unset
Builtin Apps:
ekf2 nanoradar_mr72
rgbled mappydot
gpio bl_update
px4io i2cdetect
pca9685 batt_smbus
lis2mdl landing_target_estimator
bmp280 lps22hb
adis16448 pwm_input
ak09916 lps33hw
flight_mode_manager lis3mdl
tune_control nsh
ms5611 gyro_calibration
reflect sensors
dataman mtd
temperature_compensation land_detector
send_event serdis
bst camera_trigger
lightware_laser_i2c roboclaw
rc_update dps310
ads1115 mc_hover_thrust_estimator
icm20602 system_time
ak8963 perf
rm3100 sih
ina226 uavcan
param safety_button
mft motor_ramp
motor_test led_control
mixer hott_sensors
pwm_out uuv_att_control
heater pca9685_pwm_out
camera_capture pwm
hmc5883 top
local_position_estimator gps
esc_calib uorb
ll40ls_pwm rc_input
bmm150 vl53l0x
sh nshterm
camera_feedback airspeed_selector
upatch_radar ms4525_airspeed
hardfault_log uuv_pos_control
sd_bench mb12xx
qmc5883l pmw3901
frsky_telemetry icm20689
lightware_laser_serial sercon
vl53l1x logger
cm8jl65 ets_airspeed
attitude_estimator_q mc_att_control
pwm_out_sim irlock
serial_test mavlink
bmi055 fw_pos_control_l1
vmount ulanding_radar
ver rover_pos_control
icm20948_i2c_passthrough paw3902
vcm1193l gy_us42
pga460 gyro_fft
thoneflow dshot
ist8308 fake_gps
srf02 lsm303agr
bmp388 rgbled_ncp5623c
board_adc tfmini
sdp3x_airspeed load_mon
pcf8583 fw_att_control
px4flow battery_status
dumpfile mc_pos_control
work_queue vtol_att_control
ll40ls pacecat_lds50c2a
batmon ms5525_airspeed
listener ist8310
rgbled_pwm atxxxx
esc_battery tone_alarm
reboot commander
leddar_one teraranger
dmesg hott_telemetry
navigator mc_rate_control
usb_connected icm20948
各模块功能整理如下:
app/指令 | 作用 |
adis16448 | IMU |
ads1115 | ADC驱动 |
airspeed_selector | 空速选择 |
ak09916 | 磁传感器 |
ak8963 | 磁传感器 |
attitude_estimator_q | 导航算法 |
atxxxx | OSD相关 |
batmon | BatMon module for Smart Battery utilizing SBS 1.1 specifications |
batt_smbus | battery monitor connected via SMBus (I2C). |
battery_status | 监测电池电压电流状态 |
bl_update | bootloader升级 |
bmi055 | IMU |
bmm150 | IMU |
bmp280 | 气压计 |
bmp388 | 气压计 |
board_adc | 板载ADC |
bst | Black Sheep Telemetry driver 黑羊数传驱动 |
camera_capture | 触发相机,aux通道 |
camera_feedback | Online and offline geotagging from camera feedback |
camera_trigger | 就相机触发时的位置、姿态信息记录一下 |
cm8jl65 | Lanbao PSK-CM8JL65-CC5距离传感器,接近开关,电感式传感器 |
commander | 飞行指令 |
dataman | src/modules/dataman/dataman.h 存储mission文件 |
dmesg | INFO WARN ERR msg |
dps310 | 气压计 |
dshot | 数字协议,PWM协议 |
dumpfile | 把内部文件输出到stdout nsh> dumpfile /fs/mtd_params File size: 16384 bytes ERROR [dumpfile] failed setting stdout attributes |
ekf2 | 导航模块 |
esc_battery | ? |
esc_calib | 电调校准 |
ets_airspeed | 空速计 |
fake_gps | 仿真GPS |
flight_mode_manager | flighttasks管理模块 |
frsky_telemetry | ? |
fw_att_control | 固定翼姿态控制 |
fw_pos_control_l1 | 固定翼横侧向制导算法 |
gpio | 直接读取和设置GPIO端口 |
gps | GPS模块 |
gy_us42 | Driver for the GY-US42 sonar range finder on I2C. |
gyro_calibration | 陀螺仪校准 |
gyro_fft | 陀螺仪fft |
hardfault_log | 硬件故障 |
heater | imu加热 |
hmc5883 | 磁罗盘 |
hott_sensors | Graupner HoTT sensor driver implementation. |
hott_telemetry | ? |
i2cdetect | Simple tool to scan an I2C bus. |
icm20602 | Driver for the Invensense ICM20602 IMU connected via SPI. Accel/Gyro |
icm20689 | Driver for the Invensense ICM20689 connected via SPI. Accel/Gyro |
icm20948 | Driver for the Invensense ICM20948 connected via SPI. IMU |
icm20948_i2c_passthrough | Driver for the Invensense ICM20948 connected via SPI. IMU |
ina226 | 电源监测 iic |
irlock | Driver for an IR-Lock and Pixy vision sensor connected via I2C. |
ist8308 | 磁罗盘 |
ist8310 | 磁罗盘 |
land_detector | 落地检测 |
landing_target_estimator | 精准着陆,落地目标估计 |
led_control | led控制 |
leddar_one | 测距传感器 |
lightware_laser_i2c | 测距传感器 |
lightware_laser_serial | 测距传感器 |
lis2mdl | 磁罗盘 |
lis3mdl | 磁罗盘 |
listener | uorb的监听器 |
ll40ls | 测距传感器 |
ll40ls_pwm | 测距传感器 |
load_mon | 检查stack、ram和cpu的使用情况,2hz,发布到cpuload主题,使用top指令后将各信息发布到task_stack_info主题 |
local_position_estimator | 位置估计器 |
logger | 日志 |
lps22hb | 气压计 |
lps33hw | 气压计 |
lsm303agr | 磁罗盘 |
mappydot | 测距传感器 |
mavlink | mavlink |
mb12xx | 测距传感器 |
mc_att_control | 多旋翼姿态控制 |
mc_hover_thrust_estimator | 多旋翼悬停油门估计 |
mc_pos_control | 多旋翼位置控制 |
mc_rate_control | 多旋翼角速度控制 |
mft | mtd service and utility app. ? |
mixer | 混控器 |
motor_ramp | |
motor_test | 电机测试 |
ms4525_airspeed | 空速计 |
ms5525_airspeed | 空速计 |
ms5611 | 气压计 |
mtd | mtd service and utility app.? |
nanoradar_mr72 | 测距传感器 |
navigator | 制导模块 |
nsh | nsh shell |
nshterm | 在某个设备上开一个shell端口,例如 nshterm /dev/ttyACM0 & |
param | 参数模块 |
paw3902 | 光流 |
pca9685 | IIC转PWM,16路 |
pca9685_pwm_out | IIC转PWM,16路 |
pcf8583 | Driver for Main Rotor frequency sensor using PCF8583 I2C counter. 转速频率转换器,方波转IIC |
perf | Tool to print performance counters |
pga460 | 测距传感器 |
pmw3901 | 光流 |
pwm | pwm指令,可控制fmu和io的两个pwm输出 |
pwm_input | 输入捕获,fmu的某个通道 |
pwm_out | fmu的pwm输出控制模块 |
pwm_out_sim | 在设备/dev/pwm_output0上的模拟输出 |
px4flow | 光流+超声波测距 |
px4io | PX4IO-与io mcu交互的模块 |
qmc5883l | 磁罗盘 |
rc_input | 遥控器信号输入模块 |
rc_update | 输入rc_input,发布manual_control_switches,manual_control_setpoint,actuator_group_3 The rc_update module handles RC channel mapping: read the raw input channels (`input_rc`), then apply the calibration, map the RC channels to the configured channels & mode switches and then publish as `rc_channels` and `manual_control_setpoint`. |
reboot | 重启 |
reflect | simple data reflector for load testing terminals (especially USB) |
rgbled | Driver for the onboard RGB LED controller (TCA62724FMG) connected via I2C. |
rgbled_ncp5623c | Driver for the onboard RGB LED controller (NCP5623B or NCP5623C) connected via I2C. |
rgbled_pwm | Driver for the onboard RGB LED controller by PWM. this driver is based the PX4 led driver |
rm3100 | 磁罗盘 |
roboclaw | 机械爪控制 |
rover_pos_control | 小车位置控制 |
safety_button | 安全开关 |
sd_bench | Test the speed of an SD Card |
sdp3x_airspeed | 空速计 |
send_event | |
sensors | 传感器的综合处理 |
sercon | Start CDC/ACM serial driver. |
serdis | Disconnect the mass storage device to the host.与上面是一对命令。 |
serial_test | 串口测试 |
sh | |
sih | sih仿真 |
srf02 | 测距传感器 |
system_time | 系统时间 |
temperature_compensation | acc gyro baro的温度补偿 |
teraranger | 测距传感器 |
tfmini | 测距传感器 |
thoneflow | 光流模块 |
tone_alarm | Low Level Driver for the PX4 audio alarm port.订阅tune_control,并在硬件上播放 |
top | shell命令,监测所有线程执行情况 |
tune_control | 控制语音播放 |
uavcan | uavcan |
ulanding_radar | 测距传感器 |
uorb | 中间件,线程间沟通的中介 |
usb_connected | 判断USB是否连接 |
uuv_att_control | 水下机器人BlueROV2姿态控制器 |
uuv_pos_control | 水下机器人BlueROV2位置控制器 |
vcm1193l | 磁罗盘 |
ver | src/systemcmds/ver/ver.c 版本指令,showing versions of HW, SW, Build, GCC |
vl53l0x | 测距传感器 |
vl53l1x | 测距传感器 |
vmount | 控制云台或者舵机 |
vtol_att_control | 垂起姿态控制 |
work_queue | 工作队列 |