Sensors: Do not update calibration when armed. Run at lower priority than attitude control and estimator

This ensures that the massive (several hundred params if temperature compensation is enabled) param load is not done in flight. We also lower the priority to ensure that attitude controllers and estimators which might consume sensor data directly execute immediately, which should reduce their latency.
This commit is contained in:
Lorenz Meier 2017-07-09 19:18:11 +02:00
parent 3bdd0e95dd
commit df173d4d8a

View File

@ -311,6 +311,10 @@ Sensors::~Sensors()
int
Sensors::parameters_update()
{
if (_armed) {
return 0;
}
/* read the parameter values into _parameters */
int ret = update_parameters(_parameter_handles, _parameters);
@ -709,7 +713,7 @@ Sensors::start()
/* start the task */
_sensors_task = px4_task_spawn_cmd("sensors",
SCHED_DEFAULT,
SCHED_PRIORITY_MAX - 5,
SCHED_PRIORITY_MAX - 6,
2000,
(px4_main_t)&Sensors::task_main_trampoline,
nullptr);