IMU Integration#3739
Merged
StarrryNight merged 35 commits intoMay 27, 2026
Merged
Conversation
ce3cd8e to
437a9a8
Compare
nycrat
reviewed
May 23, 2026
Member
nycrat
left a comment
There was a problem hiding this comment.
Looks alright so far, left some comments
Comment on lines
+82
to
+94
| static const uint8_t WHOAMI_REG = 0xf; | ||
| static const uint8_t ACCEL_CONTROL_REG = 0x10; | ||
| static const uint8_t GYRO_CONTROL_REG = 0x11; | ||
| static const uint8_t CTRL4_C = 0x13; | ||
| static const uint8_t CTRL6_C = 0x15; | ||
| static const uint8_t CTRL8_XL = 0x17; | ||
|
|
||
| // Device path for the IMU | ||
| inline static const std::string IMU_DEVICE = "/dev/i2c-1"; | ||
|
|
||
| // Gyroscope Z-axis (Yaw) Output Data Registers | ||
| static constexpr uint8_t GYRO_LEAST_SIG_REG = 0x26; // OUTZ_L_G | ||
| static constexpr uint8_t GYRO_MOST_SIG_REG = 0x27; // OUTZ_H_G |
Member
There was a problem hiding this comment.
to be consistent, we should just use static constexpr for all the constants
| */ | ||
| ImuService(); | ||
|
|
||
| std::optional<ImuData> poll(); |
Comment on lines
+40
to
+44
| /* | ||
| * Polls the latest IMU reading of the angular velocity of the robot on the z axis | ||
| * @return the current angular velocty of the robot on the z axis | ||
| */ | ||
| std::optional<AngularVelocity> pollAngularVelocity(); |
Member
There was a problem hiding this comment.
doc comment should start with /**
b55fedd to
c17b251
Compare
a5d8345 to
6eeb1e8
Compare
1cacd82 to
be15a2a
Compare
fedfd88 to
e8c5377
Compare
77303b5 to
849f823
Compare
Andrewyx
reviewed
May 26, 2026
Contributor
Andrewyx
left a comment
There was a problem hiding this comment.
Looks solid, left some minor comments
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Port iintegration of IMU from #3716 , and added linear acceleration polling for future uses. Follow up PR will implement angular acceleration calculations and IMU calibration scripts. Also renamed some variables for clarity.
Testing Done
Resolved Issues
#3703
Length Justification and Key Files to Review
Review Checklist
It is the reviewers responsibility to also make sure every item here has been covered
.hfile) should have a javadoc style comment at the start of them. For examples, see the functions defined inthunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.TODO(or similar) statements should either be completed or associated with a github issue