Refactor average mimu to accepts goups of 10 rate data#127
Open
patkenneally wants to merge 18 commits into
Open
Refactor average mimu to accepts goups of 10 rate data#127patkenneally wants to merge 18 commits into
patkenneally wants to merge 18 commits into
Conversation
0036376 to
06c7324
Compare
71d2870 to
2f18d6e
Compare
5e3faee to
9e8bb9d
Compare
Adds parallel isValid arrays to InputPktsData and InputPktsData_c. The module wrapper sets every slot true so today's behavior is preserved; the algorithm itself still ignores the field.
A slot is skipped when isValid is false or measTime is zero, both when finding the newest time tag and when accumulating the mean. Zero-measTime slots are treated as unfilled, so the first cycles after power-up no longer pollute the output; update() returns zero if no slot is fresh.
Three gtests that would have failed before the staleness rule: one valid slot with 119 zero-init slots (must equal dcm_BP*slot0), a fully unfilled buffer (must be zero), and isValid=true with measTime=0 (must be stale).
Without these typemaps, SWIG re-wraps MimuPacketGroupF32Payload and AccPktDataMsgF32Payload in the averageMimuDataF32 module with default array handling -- the `samples` field gets a getter that returns a single pointer instead of a Python list. Loading averageMimuDataF32 then overrides the messaging-module wrappers via swigregister, breaking `mimu_pkt.packets[p].samples[s]` access in any test that imports it after another test has loaded the messaging module.
9e8bb9d to
f3b99ce
Compare
f3b99ce to
f1f052d
Compare
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
This PR refactors the averageMimuData algorithm to take as input 4 "packets" of 10 mimu data samples. These time stamped samples are those which are averaged over.
Verification
The tests are updated to exercise new packets being written into the 4 packet buffer.
Documentation
The documentation is updated to reflect the 4 packet ring buffer.
Future work
None