mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-23 15:07:34 +08:00
sensors/vehicle_acceleration: sensor update loop limit iterations
This commit is contained in:
@@ -231,9 +231,12 @@ void VehicleAcceleration::Run()
|
||||
}
|
||||
|
||||
// process all outstanding messages
|
||||
int sensor_sub_updates = 0;
|
||||
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};
|
||||
|
||||
if (accel_raw.isAllFinite()) {
|
||||
|
||||
Reference in New Issue
Block a user