vectorize all functions to support arbitrary dimensions #58
ManuelPalermo
started this conversation in
Ideas
Replies: 1 comment
-
Excellent recommendation! I will finish the unit tests for these estimators, so that they can be easily tested. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
TLDR: It would be helpful if all functions supported vectorized operations (e.g for batch computation, fusing data from multiple sensors or in some cases across time).
Motivation
I've been using it for inertial pose estimation on wearable devices with multiple marg sensors (ex. 9, 17 marg sensors), and in multiple occasions have found it lacking in terms of support for vectorized operation, requiring extra lines of loop code to achieve the same results. I am aware that the library is intended for single AHRS data fusion, however, this change would not impact current functionality, while bringing big improvements in some cases.
Pitch
For applications were multiple ahrs sensors are used simultaneously (e.g. wearables), it would be beneficial to perform sensor fusion for all sensors in the same call. This can be easily achieved by using the vectorization provided by numpy, and perform operations only over the last axis in the arrays. This would decrease computation time when performing multiple sensor fusion and simplify the code in this cases. These benefits also extend to improved batch processing of multiple sequences of data, while maintaining current functionality.
For example, the TRIAD estimation can be vectorized as such:
Some example results:
Discussion
This changes would take some time to implement and test since almost all functions would need to be refactored, however, when creating new code, it can be implemented from the beginning to support vectorization, which does not take much more time. It would also not require any additional dependency, current code usage is still preserved and the overhead for processing a single sample is minimal. This also removes dimension checks in many functions.
Thank you a lot for this great library! Let me know what you think of these changes!
Beta Was this translation helpful? Give feedback.
All reactions