mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-10-06 09:02:52 +08:00
fix(init): start the estimator right before logging
The estimator was started near the top of the script and logging at the very end, so its startup - the alignment and the first resets - was never in the log and an ekf2 replay could not reproduce it. Assisted-by: Claude:claude-opus-5[1m] Signed-off-by: bresch <brescianimathieu@gmail.com>
This commit is contained in:
committed by
Mathieu Bresciani
parent
b16eebf1fe
commit
7526943204
@@ -281,23 +281,6 @@ manual_control start
|
||||
sensors start
|
||||
commander start
|
||||
|
||||
#
|
||||
# state estimator selection
|
||||
if param compare -s EKF2_EN 1
|
||||
then
|
||||
ekf2 start &
|
||||
fi
|
||||
|
||||
if param compare -s LPE_EN 1
|
||||
then
|
||||
local_position_estimator start
|
||||
fi
|
||||
|
||||
if param compare -s ATT_EN 1
|
||||
then
|
||||
attitude_estimator_q start
|
||||
fi
|
||||
|
||||
if ! pwm_out_sim start -m sim
|
||||
then
|
||||
tune_control play error
|
||||
@@ -382,6 +365,28 @@ fi
|
||||
# execute autostart post script if any
|
||||
[ -e "$autostart_file".post ] && . "$autostart_file".post
|
||||
|
||||
#
|
||||
# State estimator selection.
|
||||
#
|
||||
# Started last, right before logging: every estimator update published before the logger opens the
|
||||
# file is lost, and ekf2 replay needs the log to cover the filter from its very first update. The
|
||||
# logger cannot move up instead - it drops optional topics that are not advertised yet, and most of
|
||||
# the modules above own one.
|
||||
if param compare -s EKF2_EN 1
|
||||
then
|
||||
ekf2 start &
|
||||
fi
|
||||
|
||||
if param compare -s LPE_EN 1
|
||||
then
|
||||
local_position_estimator start
|
||||
fi
|
||||
|
||||
if param compare -s ATT_EN 1
|
||||
then
|
||||
attitude_estimator_q start
|
||||
fi
|
||||
|
||||
# Run script to start logging
|
||||
if param compare -s EKF2_EN 1
|
||||
then
|
||||
|
||||
Reference in New Issue
Block a user