You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.1 KiB
59 lines
1.1 KiB
12 years ago
|
#!nsh
|
||
12 years ago
|
|
||
12 years ago
|
echo "[init] PX4FMU v1, v2 with or without IO on Camflyer"
|
||
12 years ago
|
|
||
|
#
|
||
|
# Load default params for this platform
|
||
|
#
|
||
|
if param compare SYS_AUTOCONFIG 1
|
||
|
then
|
||
|
# Set all params here, then disable autoconfig
|
||
12 years ago
|
# TODO
|
||
|
|
||
12 years ago
|
param set SYS_AUTOCONFIG 0
|
||
12 years ago
|
param save
|
||
12 years ago
|
fi
|
||
12 years ago
|
|
||
|
#
|
||
|
# Force some key parameters to sane values
|
||
12 years ago
|
# MAV_TYPE 1 = fixed wing
|
||
12 years ago
|
#
|
||
|
param set MAV_TYPE 1
|
||
12 years ago
|
|
||
12 years ago
|
#
|
||
12 years ago
|
# Start and configure PX4IO or FMU interface
|
||
13 years ago
|
#
|
||
12 years ago
|
if px4io detect
|
||
|
then
|
||
|
# Start MAVLink (depends on orb)
|
||
|
mavlink start
|
||
12 years ago
|
|
||
12 years ago
|
sh /etc/init.d/rc.io
|
||
|
# Limit to 100 Hz updates and (implicit) 50 Hz PWM
|
||
|
px4io limit 100
|
||
|
else
|
||
|
# Start MAVLink (on UART1 / ttyS0)
|
||
|
mavlink start -d /dev/ttyS0
|
||
12 years ago
|
|
||
12 years ago
|
fmu mode_pwm
|
||
|
param set BAT_V_SCALING 0.004593
|
||
|
set EXIT_ON_END yes
|
||
|
fi
|
||
12 years ago
|
|
||
|
#
|
||
11 years ago
|
# Load mixer and start controllers (depends on px4io)
|
||
12 years ago
|
#
|
||
11 years ago
|
if [ -f /fs/microsd/etc/mixers/FMU_Q.mix ]
|
||
|
then
|
||
|
echo "Using /fs/microsd/etc/mixers/FMU_Q.mix"
|
||
|
mixer load /dev/pwm_output /fs/microsd/etc/mixers/FMU_Q.mix
|
||
|
else
|
||
|
echo "Using /etc/mixers/FMU_Q.mix"
|
||
|
mixer load /dev/pwm_output /etc/mixers/FMU_Q.mix
|
||
|
fi
|
||
12 years ago
|
|
||
12 years ago
|
#
|
||
11 years ago
|
# Start common fixedwing apps
|
||
12 years ago
|
#
|
||
11 years ago
|
sh /etc/init.d/rc.fixedwing
|