aboutsummaryrefslogtreecommitdiff
path: root/ROMFS/px4fmu_common/init.d/rcS
diff options
context:
space:
mode:
Diffstat (limited to 'ROMFS/px4fmu_common/init.d/rcS')
-rw-r--r--ROMFS/px4fmu_common/init.d/rcS50
1 files changed, 47 insertions, 3 deletions
diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS
index 94c462439..5748fe2b5 100644
--- a/ROMFS/px4fmu_common/init.d/rcS
+++ b/ROMFS/px4fmu_common/init.d/rcS
@@ -28,9 +28,6 @@ then
tone_alarm start
else
set LOG_FILE /dev/null
- echo "[i] No microSD card found"
- # Play SOS
- tone_alarm error
fi
#
@@ -555,6 +552,45 @@ then
fi
#
+ # VTOL setup
+ #
+ if [ $VEHICLE_TYPE == vtol ]
+ then
+ echo "[init] Vehicle type: VTOL"
+
+ if [ $MIXER == none ]
+ then
+ echo "Default mixer for vtol not defined"
+ fi
+
+ if [ $MAV_TYPE == none ]
+ then
+ # Use mixer to detect vehicle type
+ if [ $MIXER == FMU_caipirinha_vtol ]
+ then
+ set MAV_TYPE 19
+ fi
+ fi
+
+ # Still no MAV_TYPE found
+ if [ $MAV_TYPE == none ]
+ then
+ echo "Unknown MAV_TYPE"
+ else
+ param set MAV_TYPE $MAV_TYPE
+ fi
+
+ # Load mixer and configure outputs
+ sh /etc/init.d/rc.interface
+
+ # Start standard vtol apps
+ if [ $LOAD_DEFAULT_APPS == yes ]
+ then
+ sh /etc/init.d/rc.vtol_apps
+ fi
+ fi
+
+ #
# Start the navigator
#
navigator start
@@ -585,6 +621,14 @@ then
fi
unset EXIT_ON_END
+ # Run no SD alarm last
+ if [ $LOG_FILE == /dev/null ]
+ then
+ echo "[i] No microSD card found"
+ # Play SOS
+ tone_alarm error
+ fi
+
# End of autostart
fi