2018-08-25 12:02:37 -03:00
|
|
|
#!/bin/sh
|
2018-08-06 09:24:15 -03:00
|
|
|
# PX4 commands need the 'px4-' prefix in bash.
|
|
|
|
# (px4-alias.sh is expected to be in the PATH)
|
2018-09-27 14:54:09 -03:00
|
|
|
. px4-alias.sh
|
2018-08-06 09:24:15 -03:00
|
|
|
|
2018-07-24 01:04:47 -03:00
|
|
|
# config for fixed wing (FW)
|
|
|
|
# modified from ./px4.config, switch att/pos_control & mixer
|
|
|
|
|
2022-08-22 12:00:03 -03:00
|
|
|
param select parameters.bson
|
2021-12-23 13:29:35 -04:00
|
|
|
param import
|
2018-07-24 01:04:47 -03:00
|
|
|
|
2020-05-04 14:07:58 -03:00
|
|
|
param set CBRK_SUPPLY_CHK 894281
|
|
|
|
|
2018-07-24 01:04:47 -03:00
|
|
|
# Auto-start script index. Defines the auto-start script used to bootstrap the system.
|
|
|
|
# It seems that SYS_AUTOSTART does not work as intended on posix platform.
|
|
|
|
# For now, find the corresponding settings, and manually set them in ground control.
|
|
|
|
#
|
|
|
|
# 4001: Generic Quadrotor X; 4011: DJI Flame Wheel F450
|
|
|
|
param set SYS_AUTOSTART 4011
|
|
|
|
|
|
|
|
# DJI ESCs do not support calibration and need higher PWM_MIN
|
|
|
|
# http://www.dji.com/e2000/info indicates E2000 Operating Pulse Width: 1120 to 1920 μs
|
|
|
|
# It seems that all latest DJI ESC have the same range.
|
|
|
|
# Note that the setting here applies to all PWM channels.
|
2021-01-31 20:29:21 -04:00
|
|
|
# param set PWM_MAIN_MIN 1120
|
|
|
|
# param set PWM_MAIN_MAX 1920
|
2018-08-18 15:07:30 -03:00
|
|
|
# Not using DJI 430 LITE ESC anymore due to its hiccups:
|
2018-07-24 01:04:47 -03:00
|
|
|
# each random motor stop would cause a scary flip in the fly
|
|
|
|
# Replacing with 4 BLHeli32 (Wraith32 V2) ESCs solved the main problem in BBBlue porting
|
2019-11-19 18:03:11 -04:00
|
|
|
|
2018-07-24 01:04:47 -03:00
|
|
|
# Broadcast heartbeats on local network. This allows a ground control station
|
|
|
|
# to automatically find the drone on the local network.
|
|
|
|
|
|
|
|
# MAV_TYPE: 1 Fixed wing aircraft, 2 Quadrotor
|
|
|
|
param set MAV_TYPE 2
|
|
|
|
|
|
|
|
# Three possible main power battery sources for BBBlue:
|
|
|
|
# 1. onboard 2S LiPo battery connector, which is connect to ADC channel 6
|
|
|
|
# 2. onboard 9-18V DC Jack, which is connect to ADC channel 5. This is the board default.
|
2019-11-19 18:03:11 -04:00
|
|
|
# 3. other power source (e.g., LiPo battery more than 4S/18V).
|
2018-08-18 15:07:30 -03:00
|
|
|
# Scale the voltage to below 1.8V and connect it to ADC channel # 0, 1, 2 or 3.
|
2020-03-20 07:23:32 -03:00
|
|
|
param set BAT1_V_CHANNEL 5
|
2018-07-24 01:04:47 -03:00
|
|
|
|
|
|
|
# Battery voltage scale factor, from BBBlue schematics: (4.7K + 47K) / 4.7K = 11
|
2020-12-11 22:33:39 -04:00
|
|
|
param set BAT1_V_DIV 11.0
|
2018-07-24 01:04:47 -03:00
|
|
|
|
|
|
|
dataman start
|
|
|
|
|
2020-01-05 14:33:12 -04:00
|
|
|
bmp280 -I start
|
2018-07-24 01:04:47 -03:00
|
|
|
|
2020-07-26 22:38:35 -03:00
|
|
|
mpu9250_i2c -I start
|
2018-07-24 01:04:47 -03:00
|
|
|
# options: -R rotation
|
|
|
|
|
|
|
|
gps start -d /dev/ttyS2 -s -p ubx
|
|
|
|
|
2020-03-10 09:25:37 -03:00
|
|
|
#rgbled start -I -b 1
|
2020-01-07 12:08:37 -04:00
|
|
|
|
2020-09-08 00:09:20 -03:00
|
|
|
board_adc start
|
2020-01-07 12:08:37 -04:00
|
|
|
battery_status start
|
2018-07-24 01:04:47 -03:00
|
|
|
|
2019-11-24 14:25:11 -04:00
|
|
|
rc_update start
|
2018-07-24 01:04:47 -03:00
|
|
|
sensors start
|
|
|
|
commander start
|
|
|
|
navigator start
|
|
|
|
ekf2 start
|
2020-01-07 12:08:37 -04:00
|
|
|
land_detector start fixedwing
|
2018-07-24 01:04:47 -03:00
|
|
|
|
|
|
|
fw_att_control start
|
|
|
|
fw_pos_control_l1 start
|
|
|
|
|
2021-01-31 09:36:27 -04:00
|
|
|
mavlink start -n SoftAp -x -u 14556 -r 1000000 -p
|
2019-11-19 18:03:11 -04:00
|
|
|
# -n name of wifi interface: SoftAp, wlan or your custom interface,
|
2018-07-24 01:04:47 -03:00
|
|
|
# e.g., -n wlan . The default on BBBlue is SoftAp
|
|
|
|
|
|
|
|
sleep 1
|
|
|
|
|
2020-02-03 09:40:27 -04:00
|
|
|
# RC port is mapped to /dev/ttyS4 (auto-detected)
|
|
|
|
rc_input start -d /dev/ttyS4
|
2018-07-24 01:04:47 -03:00
|
|
|
|
2021-02-25 03:51:05 -04:00
|
|
|
linux_pwm_out start
|
|
|
|
mixer load /dev/pwm_out etc/mixers/AETRFG.main.mix
|
2018-07-24 01:04:47 -03:00
|
|
|
|
|
|
|
logger start -t -b 200
|
2020-01-07 12:08:37 -04:00
|
|
|
|
2018-07-24 01:04:47 -03:00
|
|
|
mavlink boot_complete
|