Created
September 21, 2025 03:36
-
-
Save tstarling/73bbf76f05a5b5b09bfb12879485d45c to your computer and use it in GitHub Desktop.
Update interval from TrueView IMU data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas | |
| import sys | |
| df = pandas.read_csv(sys.argv[1]) | |
| prevGyro = None | |
| prevUpdateFrame = 0 | |
| deltaHistogram = {} | |
| for index, row in df.iterrows(): | |
| gyro = row.loc[['gyro_x', 'gyro_y', 'gyro_z']] | |
| if prevGyro is None or (gyro != prevGyro).all(): | |
| delta = row['frame'] - prevUpdateFrame | |
| if (not delta in deltaHistogram): | |
| deltaHistogram[delta] = 0 | |
| deltaHistogram[delta] += 1 | |
| prevUpdateFrame = row['frame'] | |
| prevGyro = gyro | |
| for delta in sorted(deltaHistogram.keys()): | |
| print("# %d: %d" % (delta, deltaHistogram[delta])) | |
| # 0: 1 | |
| # 1: 522 | |
| # 2: 57 | |
| # 3: 5 | |
| # 4: 1970 | |
| # 5: 3951 | |
| # 6: 8 | |
| # 8: 8 | |
| # 9: 385 | |
| # 10: 204 | |
| # 13: 11 | |
| # 14: 71 | |
| # 15: 5 | |
| # 18: 5 | |
| # 19: 8 | |
| # 23: 1 | |
| # 24: 2 | |
| # 28: 1 | |
| # 29: 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment