This page shows you how you can tune the parameters of the EKF2 estimator by using the replay feature on a real flight log.
A developer has the possibility to enable onboard logging of the EKF2 estimator input sensor data. This allows him to tune the parameters of the estimator offline by running a replay on the logged data trying out different sets of parameters. The remainder of this page will explain which parameters have to be set in order to benefit from this feature and how to correctly deploy it.
Once you have a real flight log then you can run a replay on it by using the following command in the root directory of your PX4 Firmware
make posix_sitl_replay replay logfile=absolute_path_to_log_file/my_log_file.px4log
where 'absolute_path_to_log_file/my_log_file.px4log' is a placeholder for the absolute path of the log file you want to run the replay on. Once the command has executed check the terminal for the location and name of the replayed log file.
You can set the estimator parameter values for the replay in the file replay_params.txt located in the same directory as your replayed log file, e.g. build_posix_sitl_replay/src/firmware/posix/rootfs/replay_params.txt. When running the replay for the first time (e.g. after a make clean) this file will be autogenerated and filled with the default EKF2 parameter values taken from the flight log. After that you can change any EKF2 parameter value by changing the corresponing number in the text file. Setting the noise value for the gyro bias would require the following line.