mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 06:11:37 +08:00
Migrate px4io logic into rc.io.
This commit is contained in:
@@ -1,17 +1,16 @@
|
|||||||
|
#!nsh
|
||||||
#
|
#
|
||||||
# Init PX4IO interface
|
# PX4IO interface init script.
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
if px4io start
|
||||||
# Allow PX4IO to recover from midair restarts.
|
|
||||||
#
|
|
||||||
px4io recovery
|
|
||||||
|
|
||||||
#
|
|
||||||
# Adjust PX4IO update rate limit
|
|
||||||
#
|
|
||||||
set PX4IO_LIMIT 400
|
|
||||||
|
|
||||||
if px4io limit ${PX4IO_LIMIT}
|
|
||||||
then
|
then
|
||||||
|
# Allow PX4IO to recover from midair restarts.
|
||||||
|
px4io recovery
|
||||||
|
|
||||||
|
# Adjust PX4IO update rate limit.
|
||||||
|
px4io limit 400
|
||||||
|
else
|
||||||
|
echo "PX4IO start failed" >> $LOG_FILE
|
||||||
|
tune_control play -m ${TUNE_ERR}
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -470,27 +470,6 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $OUTPUT_MODE == io -o $OUTPUT_MODE == uavcan_esc ]
|
|
||||||
then
|
|
||||||
if px4io start
|
|
||||||
then
|
|
||||||
sh /etc/init.d/rc.io
|
|
||||||
else
|
|
||||||
echo "PX4IO start failed" >> $LOG_FILE
|
|
||||||
tune_control play -m ${TUNE_ERR}
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $OUTPUT_MODE == fmu ]
|
|
||||||
then
|
|
||||||
if fmu mode_$FMU_MODE $FMU_ARGS
|
|
||||||
then
|
|
||||||
else
|
|
||||||
echo "FMU start failed" >> $LOG_FILE
|
|
||||||
tune_control play -m ${TUNE_ERR}
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $OUTPUT_MODE == mkblctrl ]
|
if [ $OUTPUT_MODE == mkblctrl ]
|
||||||
then
|
then
|
||||||
if [ $MKBLCTRL_MODE == x ]
|
if [ $MKBLCTRL_MODE == x ]
|
||||||
@@ -523,6 +502,21 @@ else
|
|||||||
set FMU_MODE rcin
|
set FMU_MODE rcin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $OUTPUT_MODE == fmu ]
|
||||||
|
then
|
||||||
|
if fmu mode_$FMU_MODE $FMU_ARGS
|
||||||
|
then
|
||||||
|
else
|
||||||
|
echo "FMU start failed" >> $LOG_FILE
|
||||||
|
tune_control play -m ${TUNE_ERR}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $OUTPUT_MODE == io -o $OUTPUT_MODE == uavcan_esc ]
|
||||||
|
then
|
||||||
|
sh /etc/init.d/rc.io
|
||||||
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# Start IO or FMU for RC PPM input if needed.
|
# Start IO or FMU for RC PPM input if needed.
|
||||||
#
|
#
|
||||||
@@ -530,13 +524,7 @@ else
|
|||||||
then
|
then
|
||||||
if [ $OUTPUT_MODE != io ]
|
if [ $OUTPUT_MODE != io ]
|
||||||
then
|
then
|
||||||
if px4io start
|
sh /etc/init.d/rc.io
|
||||||
then
|
|
||||||
sh /etc/init.d/rc.io
|
|
||||||
else
|
|
||||||
echo "PX4IO start failed" >> $LOG_FILE
|
|
||||||
tune_control play -m ${TUNE_ERR}
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ $OUTPUT_MODE != fmu ]
|
if [ $OUTPUT_MODE != fmu ]
|
||||||
|
|||||||
Reference in New Issue
Block a user