Startup scripts: Corrected cases where commander was not started, updated several outdated scripts

This commit is contained in:
Julian Oes
2013-11-05 16:59:34 +01:00
parent d3b267c06e
commit 857c3d2efd
15 changed files with 147 additions and 174 deletions
+7 -28
View File
@@ -52,8 +52,6 @@ then
# Start MAVLink (depends on orb) # Start MAVLink (depends on orb)
mavlink start mavlink start
commander start
sh /etc/init.d/rc.io sh /etc/init.d/rc.io
# Limit to 100 Hz updates and (implicit) 50 Hz PWM # Limit to 100 Hz updates and (implicit) 50 Hz PWM
px4io limit 100 px4io limit 100
@@ -61,46 +59,27 @@ else
# Start MAVLink (on UART1 / ttyS0) # Start MAVLink (on UART1 / ttyS0)
mavlink start -d /dev/ttyS0 mavlink start -d /dev/ttyS0
commander start
fmu mode_pwm fmu mode_pwm
param set BAT_V_SCALING 0.004593 param set BAT_V_SCALING 0.004593
set EXIT_ON_END yes set EXIT_ON_END yes
fi fi
#
# Start the sensors and test them.
#
sh /etc/init.d/rc.sensors
#
# Start logging (depends on sensors)
#
sh /etc/init.d/rc.logging
#
# Start GPS interface (depends on orb)
#
gps start
#
# Start the attitude and position estimator
#
att_pos_estimator_ekf start
# #
# Load mixer and start controllers (depends on px4io) # Load mixer and start controllers (depends on px4io)
# #
if [ -f /fs/microsd/etc/mixers/FMU_RET.mix ] if [ -f /fs/microsd/etc/mixers/FMU_RET.mix ]
then then
echo "Using FMU_RET mixer from sd card" echo "Using /fs/microsd/etc/mixers/FMU_RET.mix"
mixer load /dev/pwm_output /fs/microsd/etc/mixers/FMU_RET.mix mixer load /dev/pwm_output /fs/microsd/etc/mixers/FMU_RET.mix
else else
echo "Using standard FMU_RET mixer" echo "Using /etc/mixers/FMU_RET.mix"
mixer load /dev/pwm_output /etc/mixers/FMU_RET.mix mixer load /dev/pwm_output /etc/mixers/FMU_RET.mix
fi fi
fw_att_control start
fw_pos_control_l1 start #
Start common fixedwing apps
#
sh /etc/init.d/rc.fixedwing
if [ $EXIT_ON_END == yes ] if [ $EXIT_ON_END == yes ]
then then
+13 -27
View File
@@ -52,8 +52,6 @@ then
# Start MAVLink (depends on orb) # Start MAVLink (depends on orb)
mavlink start mavlink start
commander start
sh /etc/init.d/rc.io sh /etc/init.d/rc.io
# Limit to 100 Hz updates and (implicit) 50 Hz PWM # Limit to 100 Hz updates and (implicit) 50 Hz PWM
px4io limit 100 px4io limit 100
@@ -61,39 +59,27 @@ else
# Start MAVLink (on UART1 / ttyS0) # Start MAVLink (on UART1 / ttyS0)
mavlink start -d /dev/ttyS0 mavlink start -d /dev/ttyS0
commander start
fmu mode_pwm fmu mode_pwm
param set BAT_V_SCALING 0.004593 param set BAT_V_SCALING 0.004593
set EXIT_ON_END yes set EXIT_ON_END yes
fi fi
#
# Start the sensors and test them.
#
sh /etc/init.d/rc.sensors
#
# Start logging (depends on sensors)
#
sh /etc/init.d/rc.logging
#
# Start GPS interface (depends on orb)
#
gps start
#
# Start the attitude and position estimator
#
att_pos_estimator_ekf start
# #
# Load mixer and start controllers (depends on px4io) # Load mixer and start controllers (depends on px4io)
# #
mixer load /dev/pwm_output /etc/mixers/FMU_AERT.mix if [ -f /fs/microsd/etc/mixers/FMU_AERT.mix ]
fw_att_control start then
fw_pos_control_l1 start echo "Using /fs/microsd/etc/mixers/FMU_AERT.mix"
mixer load /dev/pwm_output /fs/microsd/etc/mixers/FMU_AERT.mix
else
echo "Using /etc/mixers/FMU_Q.mix"
mixer load /dev/pwm_output /etc/mixers/FMU_AERT.mix
fi
#
Start common fixedwing apps
#
sh /etc/init.d/rc.fixedwing
if [ $EXIT_ON_END == yes ] if [ $EXIT_ON_END == yes ]
then then
+1 -4
View File
@@ -59,10 +59,7 @@ then
mavlink start mavlink start
usleep 5000 usleep 5000
commander start
sh /etc/init.d/rc.io sh /etc/init.d/rc.io
# Set PWM values for DJI ESCs
else else
# Start MAVLink (on UART1 / ttyS0) # Start MAVLink (on UART1 / ttyS0)
mavlink start -d /dev/ttyS0 mavlink start -d /dev/ttyS0
@@ -83,7 +80,7 @@ mixer load /dev/pwm_output /etc/mixers/FMU_quad_x.mix
pwm rate -c 1234 -r 400 pwm rate -c 1234 -r 400
# #
# Set disarmed, min and max PWM signals # Set disarmed, min and max PWM signals (for DJI ESCs)
# #
pwm disarmed -c 1234 -p 900 pwm disarmed -c 1234 -p 900
pwm min -c 1234 -p 1200 pwm min -c 1234 -p 1200
+1 -1
View File
@@ -73,7 +73,7 @@ pwm min -c 1234 -p 1200
pwm max -c 1234 -p 1800 pwm max -c 1234 -p 1800
# #
# Start common for all multirotors apps # Start common multirotor apps
# #
sh /etc/init.d/rc.multirotor sh /etc/init.d/rc.multirotor
+9 -6
View File
@@ -61,10 +61,6 @@ then
usleep 5000 usleep 5000
sh /etc/init.d/rc.io sh /etc/init.d/rc.io
# Set PWM values for DJI ESCs
px4io idle 900 900 900 900 900 900
px4io min 1200 1200 1200 1200 1200 1200
px4io max 1900 1900 1900 1900 1900 1900
else else
# Start MAVLink (on UART1 / ttyS0) # Start MAVLink (on UART1 / ttyS0)
mavlink start -d /dev/ttyS0 mavlink start -d /dev/ttyS0
@@ -77,12 +73,19 @@ fi
# #
# Load mixer # Load mixer
# #
mixer load /dev/pwm_output $MIXER mixer load /dev/pwm_output /etc/mixers/FMU_hex_x.mix
# #
# Set PWM output frequency to 400 Hz # Set PWM output frequency to 400 Hz
# #
pwm -u 400 -m 0xff pwm rate -c 123456 -r 400
#
# Set disarmed, min and max PWM signals
#
pwm disarmed -c 123456 -p 900
pwm min -c 123456 -p 1100
pwm max -c 123456 -p 1900
# #
# Start common for all multirotors apps # Start common for all multirotors apps
+3 -5
View File
@@ -43,8 +43,6 @@ then
mavlink start mavlink start
usleep 5000 usleep 5000
commander start
sh /etc/init.d/rc.io sh /etc/init.d/rc.io
else else
# Start MAVLink (on UART1 / ttyS0) # Start MAVLink (on UART1 / ttyS0)
@@ -66,11 +64,11 @@ mixer load /dev/pwm_output /etc/mixers/FMU_quad_w.mix
pwm rate -c 1234 -r 400 pwm rate -c 1234 -r 400
# #
# Set disarmed, min and max PWM signals (for DJI ESCs) # Set disarmed, min and max PWM signals
# #
pwm disarmed -c 1234 -p 900 pwm disarmed -c 1234 -p 900
pwm min -c 1234 -p 1200 pwm min -c 1234 -p 1100
pwm max -c 1234 -p 1800 pwm max -c 1234 -p 1900
# #
# Start common for all multirotors apps # Start common for all multirotors apps
-2
View File
@@ -43,8 +43,6 @@ then
mavlink start mavlink start
usleep 5000 usleep 5000
commander start
sh /etc/init.d/rc.io sh /etc/init.d/rc.io
else else
# Start MAVLink (on UART1 / ttyS0) # Start MAVLink (on UART1 / ttyS0)
+13 -27
View File
@@ -30,8 +30,6 @@ then
# Start MAVLink (depends on orb) # Start MAVLink (depends on orb)
mavlink start mavlink start
commander start
sh /etc/init.d/rc.io sh /etc/init.d/rc.io
# Limit to 100 Hz updates and (implicit) 50 Hz PWM # Limit to 100 Hz updates and (implicit) 50 Hz PWM
px4io limit 100 px4io limit 100
@@ -39,39 +37,27 @@ else
# Start MAVLink (on UART1 / ttyS0) # Start MAVLink (on UART1 / ttyS0)
mavlink start -d /dev/ttyS0 mavlink start -d /dev/ttyS0
commander start
fmu mode_pwm fmu mode_pwm
param set BAT_V_SCALING 0.004593 param set BAT_V_SCALING 0.004593
set EXIT_ON_END yes set EXIT_ON_END yes
fi fi
#
# Start the sensors and test them.
#
sh /etc/init.d/rc.sensors
#
# Start logging (depends on sensors)
#
sh /etc/init.d/rc.logging
#
# Start GPS interface (depends on orb)
#
gps start
#
# Start the attitude and position estimator
#
att_pos_estimator_ekf start
# #
# Load mixer and start controllers (depends on px4io) # Load mixer and start controllers (depends on px4io)
# #
mixer load /dev/pwm_output /etc/mixers/FMU_Q.mix if [ -f /fs/microsd/etc/mixers/FMU_Q.mix ]
fw_att_control start then
fw_pos_control_l1 start 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
#
Start common fixedwing apps
#
sh /etc/init.d/rc.fixedwing
if [ $EXIT_ON_END == yes ] if [ $EXIT_ON_END == yes ]
then then
+13 -27
View File
@@ -52,8 +52,6 @@ then
# Start MAVLink (depends on orb) # Start MAVLink (depends on orb)
mavlink start mavlink start
commander start
sh /etc/init.d/rc.io sh /etc/init.d/rc.io
# Limit to 100 Hz updates and (implicit) 50 Hz PWM # Limit to 100 Hz updates and (implicit) 50 Hz PWM
px4io limit 100 px4io limit 100
@@ -61,39 +59,27 @@ else
# Start MAVLink (on UART1 / ttyS0) # Start MAVLink (on UART1 / ttyS0)
mavlink start -d /dev/ttyS0 mavlink start -d /dev/ttyS0
commander start
fmu mode_pwm fmu mode_pwm
param set BAT_V_SCALING 0.004593 param set BAT_V_SCALING 0.004593
set EXIT_ON_END yes set EXIT_ON_END yes
fi fi
#
# Start the sensors and test them.
#
sh /etc/init.d/rc.sensors
#
# Start logging (depends on sensors)
#
sh /etc/init.d/rc.logging
#
# Start GPS interface (depends on orb)
#
gps start
#
# Start the attitude and position estimator
#
att_pos_estimator_ekf start
# #
# Load mixer and start controllers (depends on px4io) # Load mixer and start controllers (depends on px4io)
# #
mixer load /dev/pwm_output /etc/mixers/FMU_Q.mix if [ -f /fs/microsd/etc/mixers/FMU_Q.mix ]
fw_att_control start then
fw_pos_control_l1 start 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
#
Start common fixedwing apps
#
sh /etc/init.d/rc.fixedwing
if [ $EXIT_ON_END == yes ] if [ $EXIT_ON_END == yes ]
then then
+5 -26
View File
@@ -30,8 +30,6 @@ then
# Start MAVLink (depends on orb) # Start MAVLink (depends on orb)
mavlink start mavlink start
commander start
sh /etc/init.d/rc.io sh /etc/init.d/rc.io
# Limit to 100 Hz updates and (implicit) 50 Hz PWM # Limit to 100 Hz updates and (implicit) 50 Hz PWM
px4io limit 100 px4io limit 100
@@ -39,33 +37,11 @@ else
# Start MAVLink (on UART1 / ttyS0) # Start MAVLink (on UART1 / ttyS0)
mavlink start -d /dev/ttyS0 mavlink start -d /dev/ttyS0
commander start
fmu mode_pwm fmu mode_pwm
param set BAT_V_SCALING 0.004593 param set BAT_V_SCALING 0.004593
set EXIT_ON_END yes set EXIT_ON_END yes
fi fi
#
# Start the sensors and test them.
#
sh /etc/init.d/rc.sensors
#
# Start logging (depends on sensors)
#
sh /etc/init.d/rc.logging
#
# Start GPS interface (depends on orb)
#
gps start
#
# Start the attitude and position estimator
#
att_pos_estimator_ekf start
# #
# Load mixer and start controllers (depends on px4io) # Load mixer and start controllers (depends on px4io)
# #
@@ -77,8 +53,11 @@ else
echo "Using /etc/mixers/FMU_Q.mix" echo "Using /etc/mixers/FMU_Q.mix"
mixer load /dev/pwm_output /etc/mixers/FMU_Q.mix mixer load /dev/pwm_output /etc/mixers/FMU_Q.mix
fi fi
fw_att_control start
fw_pos_control_l1 start #
Start common fixedwing apps
#
sh /etc/init.d/rc.fixedwing
if [ $EXIT_ON_END == yes ] if [ $EXIT_ON_END == yes ]
then then
+29 -10
View File
@@ -1,6 +1,6 @@
#!nsh #!nsh
echo "[init] 666_fmu_q_x550: PX4FMU Quad X550 with PWM outputs" echo "[init] 666_fmu_q_x550: PX4FMU Quad X550 with or without IO"
# #
# Load default params for this platform # Load default params for this platform
@@ -34,16 +34,26 @@ fi
# #
param set MAV_TYPE 2 param set MAV_TYPE 2
# set EXIT_ON_END no
# Start MAVLink
#
mavlink start -d /dev/ttyS0 -b 57600
usleep 5000
# #
# Start PWM output # Start and configure PX4IO or FMU interface
# #
fmu mode_pwm if px4io detect
then
# Start MAVLink (depends on orb)
mavlink start
usleep 5000
sh /etc/init.d/rc.io
else
# Start MAVLink (on UART1 / ttyS0)
mavlink start -d /dev/ttyS0
usleep 5000
fmu mode_pwm
param set BAT_V_SCALING 0.004593
set EXIT_ON_END yes
fi
# #
# Load mixer # Load mixer
@@ -55,10 +65,19 @@ mixer load /dev/pwm_output /etc/mixers/FMU_quad_x.mix
# #
pwm rate -c 1234 -r 400 pwm rate -c 1234 -r 400
#
# Set disarmed, min and max PWM signals
#
pwm disarmed -c 1234 -p 900
pwm min -c 1234 -p 1100
pwm max -c 1234 -p 1900
# #
# Start common for all multirotors apps # Start common for all multirotors apps
# #
sh /etc/init.d/rc.multirotor sh /etc/init.d/rc.multirotor
# Exit, because /dev/ttyS0 is needed for MAVLink if [ $EXIT_ON_END == yes ]
exit then
exit
fi
@@ -84,10 +84,10 @@ then
sh /etc/init.d/rc.io sh /etc/init.d/rc.io
else else
fmu mode_pwm
# Start MAVLink (on UART1 / ttyS0) # Start MAVLink (on UART1 / ttyS0)
mavlink start -d /dev/ttyS0 mavlink start -d /dev/ttyS0
usleep 5000 usleep 5000
fmu mode_pwm
param set BAT_V_SCALING 0.004593 param set BAT_V_SCALING 0.004593
set EXIT_ON_END yes set EXIT_ON_END yes
fi fi
@@ -61,8 +61,6 @@ then
mavlink start -d /dev/ttyS1 -b 57600 mavlink start -d /dev/ttyS1 -b 57600
usleep 5000 usleep 5000
commander start
sh /etc/init.d/rc.io sh /etc/init.d/rc.io
else else
fmu mode_pwm fmu mode_pwm
+39
View File
@@ -0,0 +1,39 @@
#!nsh
#
# Standard everything needed for fixedwing except mixer, actuator output and mavlink
#
#
# Start the Commander
#
commander start
#
# Start the sensors and test them.
#
sh /etc/init.d/rc.sensors
#
# Start logging (depends on sensors)
#
sh /etc/init.d/rc.logging
#
# Start GPS interface (depends on orb)
#
gps start
#
# Start the attitude and position estimator
#
att_pos_estimator_ekf start
#
# Start attitude controller
#
fw_att_control start
#
# Start the position controller
#
fw_pos_control_l1 start
+6 -1
View File
@@ -1,8 +1,13 @@
#!nsh #!nsh
# #
# Standard everything needed for multirotors except mixer, output and mavlink # Standard everything needed for multirotors except mixer, actuator output and mavlink
# #
#
# Start the Commander
#
commander start
# #
# Start the sensors and test them. # Start the sensors and test them.
# #