mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 18:47:21 +08:00
Startup: don't configure anything if definitions are missing
This commit is contained in:
@@ -464,16 +464,20 @@ then
|
|||||||
|
|
||||||
if [ $MIXER == none ]
|
if [ $MIXER == none ]
|
||||||
then
|
then
|
||||||
# Set default mixer for multicopter if not defined
|
echo "Default mixer for multicopter not defined"
|
||||||
set MIXER quad_x
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $MAV_TYPE == none ]
|
if [ $MAV_TYPE == none ]
|
||||||
then
|
then
|
||||||
# Use MAV_TYPE = 2 (quadcopter) if not defined
|
|
||||||
set MAV_TYPE 2
|
|
||||||
|
|
||||||
# Use mixer to detect vehicle type
|
# Use mixer to detect vehicle type
|
||||||
|
if [ $MIXER == FMU_quad_x -o $MIXER == FMU_quad_+ ]
|
||||||
|
then
|
||||||
|
set MAV_TYPE 2
|
||||||
|
fi
|
||||||
|
if [ $MIXER == FMU_quad_w ]
|
||||||
|
then
|
||||||
|
set MAV_TYPE 2
|
||||||
|
fi
|
||||||
if [ $MIXER == FMU_hexa_x -o $MIXER == FMU_hexa_+ ]
|
if [ $MIXER == FMU_hexa_x -o $MIXER == FMU_hexa_+ ]
|
||||||
then
|
then
|
||||||
set MAV_TYPE 13
|
set MAV_TYPE 13
|
||||||
@@ -488,7 +492,13 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Still no MAV_TYPE found
|
||||||
|
if [ $MAV_TYPE == none ]
|
||||||
|
then
|
||||||
|
echo "Unknown MAV_TYPE"
|
||||||
|
else
|
||||||
param set MAV_TYPE $MAV_TYPE
|
param set MAV_TYPE $MAV_TYPE
|
||||||
|
fi
|
||||||
|
|
||||||
# Load mixer and configure outputs
|
# Load mixer and configure outputs
|
||||||
sh /etc/init.d/rc.interface
|
sh /etc/init.d/rc.interface
|
||||||
@@ -502,10 +512,8 @@ then
|
|||||||
#
|
#
|
||||||
if [ $VEHICLE_TYPE == none ]
|
if [ $VEHICLE_TYPE == none ]
|
||||||
then
|
then
|
||||||
echo "[init] Vehicle type: GENERIC"
|
echo "[init] Vehicle type: No autostart ID found"
|
||||||
|
|
||||||
# Load mixer and configure outputs
|
|
||||||
sh /etc/init.d/rc.interface
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start any custom addons
|
# Start any custom addons
|
||||||
|
|||||||
Reference in New Issue
Block a user