Continued work to group/condense/consolidate logic in rcS.

This commit is contained in:
mcsauder
2018-07-19 10:35:18 +02:00
committed by Beat Küng
parent ee9a336d62
commit 1fa2a6d26e
+68 -60
View File
@@ -241,14 +241,6 @@ else
# End Setup for board specific configurations. # # End Setup for board specific configurations. #
############################################################################### ###############################################################################
#
# Set USE_IO flag.
#
if param compare SYS_USE_IO 1
then
set USE_IO yes
fi
if param compare SYS_FMU_TASK 1 if param compare SYS_FMU_TASK 1
then then
set FMU_ARGS "-t" set FMU_ARGS "-t"
@@ -263,19 +255,6 @@ else
sh /etc/init.d/rc.autostart sh /etc/init.d/rc.autostart
fi fi
#
# If mount (gimbal) control is enabled and output mode is AUX, set the aux
# mixer to mount (override the airframe-specific MIXER_AUX setting).
#
if param compare MNT_MODE_IN -1
then
else
if param compare MNT_MODE_OUT 0
then
set MIXER_AUX mount
fi
fi
# #
# Override parameters from user configuration file. # Override parameters from user configuration file.
# #
@@ -314,6 +293,7 @@ else
fi fi
param set SYS_AUTOCONFIG 0 param set SYS_AUTOCONFIG 0
param save
fi fi
# #
@@ -361,20 +341,20 @@ else
fi fi
fi fi
#
# Set USE_IO flag.
#
if param compare SYS_USE_IO 1
then
set USE_IO yes
fi
if [ $USE_IO == yes -a $IO_PRESENT == no ] if [ $USE_IO == yes -a $IO_PRESENT == no ]
then then
echo "PX4IO not found" >> $LOG_FILE echo "PX4IO not found" >> $LOG_FILE
tune_control play -m ${TUNE_ERR} tune_control play -m ${TUNE_ERR}
fi fi
#
# Waypoint storage.
# REBOOTWORK this needs to start in parallel.
#
if dataman start $DATAMAN_OPT
then
fi
# #
# Sensors System (start before Commander so Preflight checks are properly run). # Sensors System (start before Commander so Preflight checks are properly run).
# Commander Needs to be this early for in-air-restarts. # Commander Needs to be this early for in-air-restarts.
@@ -395,13 +375,9 @@ else
commander start commander start
fi fi
send_event start
load_mon start
# #
# Check if UAVCAN is enabled, default to it for ESCs. # Check if UAVCAN is enabled, default to it for ESCs.
# #
if param greater UAVCAN_ENABLE 0 if param greater UAVCAN_ENABLE 0
then then
# Start core UAVCAN module. # Start core UAVCAN module.
@@ -431,7 +407,7 @@ else
set FMU_MODE pwm4 set FMU_MODE pwm4
set AUX_MODE pwm4 set AUX_MODE pwm4
fi fi
if param greater TRIG_MODE 0 if param greater TRIG_MODE 0
then then
# We ONLY support trigger on pins 5 and 6 when simultanously using AUX for actuator output. # We ONLY support trigger on pins 5 and 6 when simultanously using AUX for actuator output.
@@ -444,12 +420,36 @@ else
set FMU_MODE none set FMU_MODE none
set AUX_MODE none set AUX_MODE none
fi fi
camera_trigger start
camera_trigger start
param set CAM_FBACK_MODE 1 param set CAM_FBACK_MODE 1
camera_feedback start camera_feedback start
fi fi
#
# If mount (gimbal) control is enabled and output mode is AUX, set the aux
# mixer to mount (override the airframe-specific MIXER_AUX setting).
#
if param compare MNT_MODE_IN -1
then
else
if param compare MNT_MODE_OUT 0
then
set MIXER_AUX mount
fi
fi
#
# Start vmount to control mounts such as gimbals, disabled by default.
#
if param compare MNT_MODE_IN -1
then
else
if vmount start
then
fi
fi
# #
# Set default output if not set. # Set default output if not set.
# #
@@ -559,18 +559,27 @@ else
fi fi
fi fi
#
# Waypoint storage.
# REBOOTWORK this needs to start in parallel.
#
dataman start $DATAMAN_OPT
#
# Start the socket communication send_event handler.
#
send_event start
#
# Start the resource load monitor.
#
load_mon start
# #
# Start mavlink streams. # Start mavlink streams.
# #
sh /etc/init.d/rc.mavlink sh /etc/init.d/rc.mavlink
if ver hwcmp PX4FMU_V2 PX4FMU_V4 PX4FMU_V4PRO MINDPX_V2 PX4FMU_V5 OMNIBUS_F4SD
then
# Check for flow sensor - as it is a background task, launch it last.
px4flow start &
fi
# #
# Configure vehicle type specific parameters. # Configure vehicle type specific parameters.
# Note: rc.vehicle_setup is the entry point for rc.interface, # Note: rc.vehicle_setup is the entry point for rc.interface,
@@ -583,34 +592,33 @@ else
# #
navigator start navigator start
# Start any custom addons.
if [ -f $FEXTRAS ]
then
echo "Addons script: ${FEXTRAS}"
sh $FEXTRAS
fi
# #
# Start a thermal calibration if required. # Start a thermal calibration if required.
# #
sh /etc/init.d/rc.thermal_cal sh /etc/init.d/rc.thermal_cal
#
# vmount to control mounts such as gimbals, disabled by default.
#
if param compare MNT_MODE_IN -1
then
else
if vmount start
then
fi
fi
# #
# Start the logger. # Start the logger.
# #
sh /etc/init.d/rc.logging sh /etc/init.d/rc.logging
#
# Launch the flow sensor as a background task.
#
if ver hwcmp PX4FMU_V2 PX4FMU_V4 PX4FMU_V4PRO MINDPX_V2 PX4FMU_V5 OMNIBUS_F4SD
then
px4flow start &
fi
#
# Start any custom addons.
#
if [ -f $FEXTRAS ]
then
echo "Addons script: ${FEXTRAS}"
sh $FEXTRAS
fi
# End of autostart. # End of autostart.
fi fi