Skip to content

Refactor average mimu to accepts goups of 10 rate data#127

Open
patkenneally wants to merge 18 commits into
developfrom
feature/average-mimu-accepts-packets
Open

Refactor average mimu to accepts goups of 10 rate data#127
patkenneally wants to merge 18 commits into
developfrom
feature/average-mimu-accepts-packets

Conversation

@patkenneally

@patkenneally patkenneally commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator
  • Tickets addressed: ema-gnc-2065
  • Review: By commit
  • Merge strategy: Merge (no squash)

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

@patkenneally patkenneally force-pushed the feature/average-mimu-accepts-packets branch 5 times, most recently from 0036376 to 06c7324 Compare April 25, 2026 20:27
@patkenneally patkenneally self-assigned this Apr 25, 2026
@patkenneally patkenneally force-pushed the feature/average-mimu-accepts-packets branch 5 times, most recently from 71d2870 to 2f18d6e Compare April 29, 2026 21:06
@patkenneally patkenneally force-pushed the feature/average-mimu-accepts-packets branch from 5e3faee to 9e8bb9d Compare May 4, 2026 22:01
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.
@patkenneally patkenneally force-pushed the feature/average-mimu-accepts-packets branch from 9e8bb9d to f3b99ce Compare May 18, 2026 17:30
@patkenneally patkenneally force-pushed the feature/average-mimu-accepts-packets branch from f3b99ce to f1f052d Compare June 4, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant