mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-01 01:30:35 +08:00
limit vehicle_command subscription updates per cycle
- this is a precaution to eliminate the possibility of getting stuck in a loop trying to keep up with a high rate publication that could be coming from a higher priority task
This commit is contained in:
@@ -194,7 +194,10 @@ void TemperatureCompensationModule::Run()
|
||||
perf_begin(_loop_perf);
|
||||
|
||||
// Check if user has requested to run the calibration routine
|
||||
while (_vehicle_command_sub.updated()) {
|
||||
int vehicle_command_updates = 0;
|
||||
|
||||
while (_vehicle_command_sub.updated() && (vehicle_command_updates < vehicle_command_s::ORB_QUEUE_LENGTH)) {
|
||||
vehicle_command_updates++;
|
||||
vehicle_command_s cmd;
|
||||
|
||||
if (_vehicle_command_sub.copy(&cmd)) {
|
||||
|
||||
Reference in New Issue
Block a user