From ad417446700e3ddb5a7933573c287d3c6a0f96e5 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Wed, 1 Aug 2018 14:59:02 -0400 Subject: [PATCH] wind_estimator add param to enable and start --- ROMFS/px4fmu_common/init.d/rcS | 5 +++++ src/modules/wind_estimator/wind_estimator_main.cpp | 9 ++++++++- src/modules/wind_estimator/wind_estimator_params.c | 9 +++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 59d1410c74..95e8778965 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -489,6 +489,11 @@ else # navigator start + # + # Start the standalone wind estimator. + # + wind_estimator start + # # Start a thermal calibration if required. # diff --git a/src/modules/wind_estimator/wind_estimator_main.cpp b/src/modules/wind_estimator/wind_estimator_main.cpp index a939987401..fbe32ebd65 100644 --- a/src/modules/wind_estimator/wind_estimator_main.cpp +++ b/src/modules/wind_estimator/wind_estimator_main.cpp @@ -330,5 +330,12 @@ extern "C" __EXPORT int wind_estimator_main(int argc, char *argv[]); int wind_estimator_main(int argc, char *argv[]) { - return WindEstimatorModule::main(argc, argv); + int32_t wind_estimator_enabled = 0; + param_get(param_find("WEST_EN"), &wind_estimator_enabled); + + if (wind_estimator_enabled == 1) { + return WindEstimatorModule::main(argc, argv); + } + + return PX4_OK; } diff --git a/src/modules/wind_estimator/wind_estimator_params.c b/src/modules/wind_estimator/wind_estimator_params.c index 42ae79f464..eb4f71b0f9 100644 --- a/src/modules/wind_estimator/wind_estimator_params.c +++ b/src/modules/wind_estimator/wind_estimator_params.c @@ -1,3 +1,12 @@ +/** + * Enable Wind estimator + * + * @boolean + * @reboot_required true + * @group Wind Estimator + */ +PARAM_DEFINE_INT32(WEST_EN, 0); + /** * Wind estimator wind process noise. *