Skip to content

Commit

Permalink
sensors/vehicle_acceleration: update loop limit iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
dagar committed Mar 4, 2024
1 parent 197fa14 commit b2a8579
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit b2a8579

Please sign in to comment.