px4_work_queue: directly support SITL lockstep

- the purpose is to ensure that every WorkItem (and WorkItems scheduled
by WorkItems) is allowed to run to completion every step
 - per workqueue register a lockstep component whenever a work item is
added (if not already registered)
 - once the work queue is empty unregister component
This commit is contained in:
Daniel Agar
2021-01-04 09:38:05 +01:00
committed by Lorenz Meier
parent 8c71ecd97e
commit 98cff94702
10 changed files with 24 additions and 61 deletions
-10
View File
@@ -178,8 +178,6 @@ private:
VehicleIMU *_vehicle_imu_list[MAX_SENSOR_COUNT] {};
int _lockstep_component{-1};
/**
* Update our local parameter cache.
*/
@@ -282,8 +280,6 @@ Sensors::~Sensors()
}
perf_free(_loop_perf);
px4_lockstep_unregister_component(_lockstep_component);
}
bool Sensors::init()
@@ -626,12 +622,6 @@ void Sensors::Run()
parameter_update_poll();
}
if (_lockstep_component == -1) {
_lockstep_component = px4_lockstep_register_component();
}
px4_lockstep_progress(_lockstep_component);
perf_end(_loop_perf);
}