mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 01:53:34 +08:00
Clean up UAVCAN startup
This commit is contained in:
@@ -3,26 +3,10 @@
|
|||||||
# UAVCAN initialization script.
|
# UAVCAN initialization script.
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# Mirriring the UAVCAN_ENABLE param value to an eponymous environment variable.
|
|
||||||
# TODO there should be a smarter way.
|
|
||||||
#
|
|
||||||
set UAVCAN_ENABLE 0
|
|
||||||
if param compare UAVCAN_ENABLE 1
|
|
||||||
then
|
|
||||||
set UAVCAN_ENABLE 1
|
|
||||||
fi
|
|
||||||
if param compare UAVCAN_ENABLE 2
|
|
||||||
then
|
|
||||||
set UAVCAN_ENABLE 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "[i] UAVCAN_ENABLE is $UAVCAN_ENABLE"
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Starting stuff according to UAVCAN_ENABLE value
|
# Starting stuff according to UAVCAN_ENABLE value
|
||||||
#
|
#
|
||||||
if [ $UAVCAN_ENABLE -ge 1 ]
|
if param greater UAVCAN_ENABLE 0
|
||||||
then
|
then
|
||||||
if uavcan start
|
if uavcan start
|
||||||
then
|
then
|
||||||
@@ -33,7 +17,7 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $UAVCAN_ENABLE -ge 2 ]
|
if param greater UAVCAN_ENABLE 1
|
||||||
then
|
then
|
||||||
if uavcan start fw
|
if uavcan start fw
|
||||||
then
|
then
|
||||||
@@ -43,10 +27,3 @@ then
|
|||||||
tone_alarm $TUNE_ERR
|
tone_alarm $TUNE_ERR
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $UAVCAN_ENABLE -ge 1 ]
|
|
||||||
then
|
|
||||||
# First sensor publisher to initialize takes lowest instance ID
|
|
||||||
# This delay ensures that UAVCAN-interfaced sensors will be allocated on lowest instance IDs
|
|
||||||
sleep 8
|
|
||||||
fi
|
|
||||||
|
|||||||
Reference in New Issue
Block a user