Skip to content

Commit 316df2d

Browse files
committed
DEV-922 Comment corrections from skeptic re-review
- The applied-form WARNING now covers both directions: the write path (generateCalParamByteArray) also skips inversion, so writing calibration to a gen-2 device would send driver-form matrices where the firmware and console expect applied form. - The no-hardware-gate javadoc no longer implies the FW/HW pairing is enforced; a gen-1 board flashed with gen-2 firmware would get this frame too. - 666.67 LSB/Gauss is itself a rounding of 2000/3, not an exact value. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WaUPkLZVnndWPEixyHcbVy
1 parent 7b83b81 commit 316df2d

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

ShimmerDriver/src/main/java/com/shimmerresearch/verisense/sensors/SensorLSM6DSV.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@
5454
* for firmware payload design v13 and above (see
5555
* {@code VerisenseDevice.sensorAndConfigMapsCreate()}), i.e. second-generation
5656
* firmware, and every second-generation mounting (SR61 rev &gt;= 5, SR68 rev
57-
* &gt;= 9) shares this frame. Offsets are zero.
57+
* &gt;= 9) shares this frame. Note the FW/HW pairing itself is not enforced
58+
* anywhere: a first-generation board flashed with gen-2 firmware would get this
59+
* frame too. Offsets are zero.
5860
*
5961
* @author Mark Nolan
6062
*/
@@ -259,6 +261,9 @@ public static final class DatabaseConfigHandle {
259261
// UtilCalibration applies AM^-1. Neither path is used for this sensor today;
260262
// if gen-2 per-unit calibration is ever enabled, the loaded alignment must be
261263
// inverted to driver form at load or calibration will be applied backwards.
264+
// The trap is bidirectional: generateCalParamByteArray() likewise writes the
265+
// driver-form AM out uninverted, so writing calibration TO a gen-2 device
266+
// would send the inverse of the applied form the firmware and console expect.
262267
/** Applied sensor->ASM alignment for the LSM6DSV accel + gyro; det +1 (a proper rotation). */
263268
public static final double[][] APPLIED_ALIGNMENT_LSM6DSV_ACCEL_GYRO = {{0,1,0},{0,0,1},{1,0,0}};
264269
/** Applied sensor->ASM alignment for the LIS2MDL mag; its frame is left-handed, so det -1 (a reflection). */
@@ -297,8 +302,8 @@ public static final class DatabaseConfigHandle {
297302
public static final double[][] SENS_GYRO_2000DPS = {{14.285714286,0,0},{0,14.285714286,0},{0,0,14.285714286}};
298303

299304
// Mag sensitivity: taken from the LIS2MDL's own sensor class rather than
300-
// re-declared here, because it is a property of the chip (1.5 mGauss/LSB, i.e.
301-
// 666.67 LSB/Gauss exactly; 667 is the established Shimmer rounding) and not
305+
// re-declared here, because it is a property of the chip (1.5 mGauss/LSB =
306+
// 2000/3 = 666.67 LSB/Gauss; 667 is the established Shimmer rounding) and not
302307
// of the LSM6DSV sensor hub the samples arrive through. 667 LSB/Gauss, matching
303308
// the firmware calibration seed (SC_LIS2MDL_MAG_SENS), the web SDK catalog, and
304309
// every other Shimmer magnetometer (LSM303DLHC etc. are all LSB/Gauss).

0 commit comments

Comments
 (0)