-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
[Feature] Implement pybricks.hubs.MoveHub.imu.tilt #539
Comments
I was able to use the existing API for the R2-D2 example without problems, so I would be fine not adding/changing anything. |
That sounds good. Also, I'm not going to have time to look at this any time soon, so let's not hang V3.1 on it. So 🚢 |
It should be feasible to implement As for base orientation specification, we can't use the |
This comment was marked as resolved.
This comment was marked as resolved.
This works quite nicely: https://github.com/pybricks/pybricks-micropython/tree/movehub-tilt But it takes up a bit too much space: 832 bytes. This is partly due to bringing in fix16 trigonometry. This may not be worth it unless we use it for other things like pybricks/pybricks-micropython#93 |
Now that Here's a new variant that is about +550 bytes. Out of that 200 bytes comes from an integer implementation for It works by interpolating a few points (green) on the positive side, and derives the full result from there (orange). It is quite close to the real result (blue). This is accurate enough for roll computation: The code for linear interpolation can be shared with approximations for other trigonometric functions if/when we have any. |
I'm going to give this a final push for this release:
|
Is your feature request related to a problem? Please describe.
The Move Hub has had an experimental IMU implementation for a while now. There's not enough space to implement something equivalent to the other hubs.
Since V3.1 may be the last release for Move Hub, we'll want to make sure this is working the way we want. And documented accordingly.
It may be useful to see if we can implement a crude version of tilt/roll measurement, as this is really the main use case for having the IMU enabled in the first place. The user can't really do this in their code since floating point support isn't enabled, and look-up tables in user code would take too much space.
Maybe we can use libfixmath.
The text was updated successfully, but these errors were encountered: