-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pbio/imu: Implement 3D attitude and fusion of IMU data. #270
Open
laurensvalk
wants to merge
14
commits into
master
Choose a base branch
from
imu
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
These flags will later be used to test which calibration has been done already. We can use the same flag to optionally set settings, rather than use NAN to indicate nothing set.
Since this is done in quite a few functions, this should make the build size smaller and the code easier to follow.
Since this is done in quite a few functions, this should make the build size smaller and the code easier to follow.
When the hub first boots, it is good to have an initial value for the bias to help suppress drift during the first nonstationary seconds. As an estimate, we can use the bias first saved on the previous boot.
When starting from the latest sample as we did before, the odds are higher that we start on an outlier and have to restart, or allow larger errors.
Now that it is a bit less sensitive to outliers, we can reduce this value. See pybricks/support#1105
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.
This is an exciting update that implements 3D attitude estimation for the gyro with fusion of accelerometer data.
The main changes:
hub.imu.heading()
. Now heading will still be close to the correct value when you drive across ramps or lift it from the table.hub.imu.tilt()
to use the new fused gyro data. This should be much less noisy than the pure accelerometer result, and it is no longer affected by horizontal or vertical acceleration.hub.imu.orientation()
which gives you the rotation matrix of your robot. This is almost always more useful than some kind of (non-)singular angular representation. We'll add some examples to show why this is useful. You could always extract your favorite angular representation from the rotation matrix elements.Things that still need to be done:
hub.imu.update_heading_calibration()
with an interactive routine that estimates the 3D calibration constants.Other notes: