Skip to content

DEV-875 Generalise the non-wear derived-sensor bit to the LSM6DS family (LSM6DSX) - #278

Closed
marknolan wants to merge 2 commits into
masterfrom
DEV-875_lsm6dsv_nonwear
Closed

DEV-875 Generalise the non-wear derived-sensor bit to the LSM6DS family (LSM6DSX)#278
marknolan wants to merge 2 commits into
masterfrom
DEV-875_lsm6dsv_nonwear

Conversation

@marknolan

@marknolan marknolan commented Jul 14, 2026

Copy link
Copy Markdown
Member

Stacked on #277 — merge that first, then retarget/merge this. Jira: DEV-875.

Renames DerivedSensorsBitMask.NON_WEAR_DETECTION_LSM6DS3 to NON_WEAR_DETECTION_LSM6DSX (same bit, 1<<1) so a single non-wear algorithm variant can cover both the gen-1 LSM6DS3 and the gen-2 LSM6DSV:

  • The two IMUs never coexist on one board (gen-1 vs gen-2), so the shared bit is unambiguous; the LIS2DW12 keeps its own bit 0.
  • The Verisense derived-sensors mask is an in-process enable key that is never persisted — payload/op-config bytes carry the enabled-sensors bitmap only, the cloud RDS stores non-wear results without a bitmask column, and the frozen "must not change" contract applies only to the separate Shimmer3 namespace (infomem/SD headers).
  • A @Deprecated alias keeps source compatibility for consumers of the published jar.

The algorithm-side change (merged ALGO_NON_WEAR_DETECTION_LSM6DSX with SENSOR_CHECK_METHOD.ANY) is in the companion ASM_PC PR on branch DEV-875_lsm6dsv_nonwear.

🤖 Generated with Claude Code

…6DS family

Non-wear detection is being extended to the second-generation LSM6DSV accel
(SR68-9/10, SR61-5/6). The LSM6DS3 and LSM6DSV never coexist on one board, and
the Verisense derived-sensors mask is a purely in-process enable key (never
written to config bytes, DB, or cloud - unlike the frozen Shimmer3 namespace),
so the existing bit 1 is renamed NON_WEAR_DETECTION_LSM6DSX and shared by both
IMU generations rather than consuming a new bit. The old constant remains as a
deprecated alias for source compatibility with consumers of the published jar.

The algorithm-side change (merged LSM6DSX AlgorithmDetails with
SENSOR_CHECK_METHOD.ANY) lives in the ASM_PC repo.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Generalises the Verisense derived-sensors bitmask for non-wear detection so the same enable bit can be used across the LSM6DS IMU family (gen-1 LSM6DS3 and gen-2 LSM6DSV), while preserving source compatibility via a deprecated alias.

Changes:

  • Rename DerivedSensorsBitMask.NON_WEAR_DETECTION_LSM6DS3 to NON_WEAR_DETECTION_LSM6DSX (same bit: 1 << 1).
  • Add JavaDoc clarifying the shared-bit rationale and introduce a @Deprecated alias for the old constant name.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ShimmerDriver/src/main/java/com/shimmerresearch/driver/Configuration.java Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Base automatically changed from DEV-793_LSM6DSV_gen2_file_parser to master July 30, 2026 06:51

jyong15 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Closing as superseded. The DEV-875 driver-side change already landed on master via a different design: commit 0381fe4 (part of #277, merged 2026-07-17) keeps NON_WEAR_DETECTION_LSM6DS3 = 1<<1 untouched and adds a separate NON_WEAR_DETECTION_LSM6DSV = 1<<10, rather than unifying the family under one LSM6DSX bit as this PR does. This branch was cut one commit before 0381fe4, which is why the overlap went unnoticed.

The two designs can't coexist: this PR auto-merges into master cleanly (verified with git merge-tree — no conflict, no compile error), producing two different bits both documented as the gen-2 non-wear bit. So it needs to be closed rather than left open, since nothing mechanical would catch an accidental merge.

Worth recording from review before closing:

  • The unified-bit premise ("LSM6DS3 and LSM6DSV never coexist on one board") doesn't hold at the driver's compat layer — svoVerisenseImu (SR61) appears in both listOfCompatibleVersionInfoLSM6DS3 and ...LSM6DSV (Configuration.java:2720/2742), so a SENSOR_CHECK_METHOD.ANY variant can't tell which IMU's non-wear is enabled on SR61. The separate-bit design on master doesn't have this ambiguity.
  • The rename itself was verified behaviour-neutral: NON_WEAR_DETECTION_LSM6DS3 has no consumer anywhere in this repo, and the constant is compile-time-inlined, so already-built consumers are unaffected either way.

Companion ASM_PC PR ShimmerResearch/ASM_PC#354 is being closed for the same reason — the consumer-side port landed on ASM_PC main via d0011b1.


Generated by Claude Code

@jyong15 jyong15 closed this Aug 4, 2026
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.

3 participants