Skip to content

Fix some data races - #14

Merged
nkhedekar merged 2 commits into
ntnu-arl:mainfrom
ovaag:races
Feb 27, 2026
Merged

Fix some data races#14
nkhedekar merged 2 commits into
ntnu-arl:mainfrom
ovaag:races

Conversation

@ovaag

@ovaag ovaag commented Feb 25, 2026

Copy link
Copy Markdown
Contributor
  1. Add buffer_mutex to getNumMeasurementsBetween to guard against this method reading data while the imu thread is writing to buffer.
  2. I noticed when adding a new barometer manager that the imu preintegration started crashing.
    This was because some random baro measurements would have exact same nanosecond stamp as a given imu measurement because they shard hw clock.
    This should now be better handled in dd1672f
    Removed the two-step mutex acqusition in setPropagationBaseState to reduce complexity. This will be catched up by next imu callback anyway?

To guard against this method reading data while the imu thread is writing to buffer.
Can happen for sensors sharing same hw clock as imu
@nkhedekar

Copy link
Copy Markdown
Contributor

Thanks for the PR. I'd fixed this locally but hadn't pushed anywhere. Will check the differences between that and this and report back.

@nkhedekar

Copy link
Copy Markdown
Contributor

Changes look good, thank you! :)

@nkhedekar
nkhedekar merged commit a1a8b4c into ntnu-arl:main Feb 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants