Skip to content

Commit

Permalink
ROMFS: Reset the estimator param to EKF2 if LPE fails to start
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzMeier committed Jun 4, 2017
1 parent 69ba69f commit c9a28fc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
9 changes: 9 additions & 0 deletions ROMFS/px4fmu_common/init.d/rc.fw_apps
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
# Standard apps for fixed wing
#

# LPE
if param compare SYS_MC_EST_GROUP 1
then
echo "ERROR [init] Estimator LPE not supported on fixed wing. Using EKF2"
param set SYS_MC_EST_GROUP 2
param save
ekf2 start
fi

#
# Start the attitude and position estimator
#
Expand Down
7 changes: 5 additions & 2 deletions ROMFS/px4fmu_common/init.d/rc.mc_apps
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# INAV (deprecated)
if param compare SYS_MC_EST_GROUP 0
then
echo "ERROR [init] Estimator INAV deprecated. Using LPE"
param set SYS_MC_EST_GROUP 1
echo "ERROR [init] Estimator INAV deprecated. Using EKF2"
param set SYS_MC_EST_GROUP 2
param save
fi

Expand All @@ -25,6 +25,9 @@ then
then
local_position_estimator start
else
echo "ERROR [init] Estimator LPE not available. Using EKF2"
param set SYS_MC_EST_GROUP 2
param save
ekf2 start
fi
fi
Expand Down
9 changes: 6 additions & 3 deletions ROMFS/px4fmu_common/init.d/rc.vtol_apps
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,23 @@
# INAV (deprecated)
if param compare SYS_MC_EST_GROUP 0
then
echo "ERROR [init] Estimator INAV deprecated. Using LPE"
param set SYS_MC_EST_GROUP 1
echo "ERROR [init] Estimator INAV deprecated. Using EKF2"
param set SYS_MC_EST_GROUP 2
param save
fi

# LPE
if param compare SYS_MC_EST_GROUP 1
then
# Try to start LPE. If it fails, start EKF2 as a default
# Unfortunately we do not build it on px4fmu-v2 duo to a limited flash.
# Unfortunately we do not build it on px4fmu-v2 due to a limited flash.
if attitude_estimator_q start
then
local_position_estimator start
else
echo "ERROR [init] Estimator LPE not available. Using EKF2"
param set SYS_MC_EST_GROUP 2
param save
ekf2 start
fi
fi
Expand Down

0 comments on commit c9a28fc

Please sign in to comment.