forked from Archive/PX4-Autopilot
sensors/vehicle_acceleration: sensor update loop limit iterations
This commit is contained in:
parent
87960c04d8
commit
2bf1eeb003
|
@ -231,9 +231,12 @@ void VehicleAcceleration::Run()
|
||||||
}
|
}
|
||||||
|
|
||||||
// process all outstanding messages
|
// process all outstanding messages
|
||||||
|
int sensor_sub_updates = 0;
|
||||||
sensor_accel_s sensor_data;
|
sensor_accel_s sensor_data;
|
||||||
|
|
||||||
while (_sensor_sub.update(&sensor_data)) {
|
while ((sensor_sub_updates < sensor_accel_s::ORB_QUEUE_LENGTH) && _sensor_sub.update(&sensor_data)) {
|
||||||
|
sensor_sub_updates++;
|
||||||
|
|
||||||
const Vector3f accel_raw{sensor_data.x, sensor_data.y, sensor_data.z};
|
const Vector3f accel_raw{sensor_data.x, sensor_data.y, sensor_data.z};
|
||||||
|
|
||||||
if (accel_raw.isAllFinite()) {
|
if (accel_raw.isAllFinite()) {
|
||||||
|
|
Loading…
Reference in New Issue