Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PX4Accelerometer/PX4Gyroscope: fix calibration offset for integrated FIFO case #14765

Merged
merged 1 commit into from
Apr 26, 2020

Conversation

dagar
Copy link
Member

@dagar dagar commented Apr 26, 2020

This is a quick follow up fix to #14752. In the case of FIFO data (new IMU drivers) the calibration offset wasn't being applied correctly to the result of integrating the FIFO samples.

This slipped through unnoticed with the offsets zeroed (simple bench testing, the test rack, and SITL CI).

@dagar dagar added the bug label Apr 26, 2020
@dagar dagar requested a review from mhkabir April 26, 2020 16:21
@dagar dagar force-pushed the pr-imu_fifo_cal_fix branch from ddcf31b to 120c5e7 Compare April 26, 2020 16:27
Copy link
Member

@mhkabir mhkabir left a comment

Choose a reason for hiding this comment

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

Looks good. Tested and works with real CALs.

@dagar
Copy link
Member Author

dagar commented Apr 26, 2020

nsh> param show CAL_ACC*
Symbols: x = used, + = saved, * = unsaved
x   CAL_ACC0_EN [36,62] : 1
x + CAL_ACC0_ID [37,63] : 3670026
x + CAL_ACC0_XOFF [38,64] : -0.0008
x + CAL_ACC0_XSCALE [39,65] : 0.9909
x + CAL_ACC0_YOFF [40,66] : -0.0544
x + CAL_ACC0_YSCALE [41,67] : 1.0108
x + CAL_ACC0_ZOFF [42,68] : -0.0835
x + CAL_ACC0_ZSCALE [43,69] : 1.0101
x   CAL_ACC1_EN [44,70] : 1
x + CAL_ACC1_ID [45,71] : 3932170
x + CAL_ACC1_XOFF [46,72] : 0.0770
x + CAL_ACC1_XSCALE [47,73] : 0.9886
x + CAL_ACC1_YOFF [48,74] : 0.1238
x + CAL_ACC1_YSCALE [49,75] : 1.0110
x + CAL_ACC1_ZOFF [50,76] : -0.3014
x + CAL_ACC1_ZSCALE [51,77] : 0.9991
x   CAL_ACC2_EN [52,78] : 1
x + CAL_ACC2_ID [53,79] : 4259850
x + CAL_ACC2_XOFF [54,80] : 0.4906
x + CAL_ACC2_XSCALE [55,81] : 0.9741
x + CAL_ACC2_YOFF [56,82] : 0.0353
x + CAL_ACC2_YSCALE [57,83] : 1.0021
x + CAL_ACC2_ZOFF [58,84] : 0.0967
x + CAL_ACC2_ZSCALE [59,85] : 1.0004
x + CAL_ACC_PRIME [60,86] : 3670026

nsh> param show CAL_GYRO*
Symbols: x = used, + = saved, * = unsaved
x   CAL_GYRO0_EN [64,90] : 1
x + CAL_GYRO0_ID [65,91] : 3670026
x + CAL_GYRO0_XOFF [66,92] : 0.0051
x + CAL_GYRO0_YOFF [67,93] : -0.0097
x + CAL_GYRO0_ZOFF [68,94] : 0.0045
x   CAL_GYRO1_EN [69,95] : 1
x + CAL_GYRO1_ID [70,96] : 3932170
x + CAL_GYRO1_XOFF [71,97] : 0.0144
x + CAL_GYRO1_YOFF [72,98] : 0.0190
x + CAL_GYRO1_ZOFF [73,99] : 0.0018
x   CAL_GYRO2_EN [74,100] : 1
x + CAL_GYRO2_ID [75,101] : 4325386
x + CAL_GYRO2_XOFF [76,102] : 0.0040
x + CAL_GYRO2_YOFF [77,103] : 0.0051
x + CAL_GYRO2_ZOFF [78,104] : 0.0016
x + CAL_GYRO_PRIME [79,105] : 3670026


nsh> sensors status
INFO  [sensors] gyro status:
INFO  [ecl/validation] validator: best: 0, prev best: 0, failsafe: NO (0 events)
INFO  [ecl/validation] sensor #0, prio: 100, state: OK
INFO  [ecl/validation]  val:   0.0046, lp:   0.0053 mean dev:   0.0000 RMS:   0.0010 conf:   1.0000
INFO  [ecl/validation]  val:  -0.0042, lp:  -0.0039 mean dev:  -0.0000 RMS:   0.0011 conf:   1.0000
INFO  [ecl/validation]  val:  -0.0001, lp:   0.0000 mean dev:   0.0000 RMS:   0.0012 conf:   1.0000
INFO  [ecl/validation] sensor #1, prio: 99, state: OK
INFO  [ecl/validation]  val:  -0.0012, lp:  -0.0002 mean dev:  -0.0000 RMS:   0.0039 conf:   1.0000
INFO  [ecl/validation]  val:  -0.0025, lp:   0.0013 mean dev:   0.0000 RMS:   0.0047 conf:   1.0000
INFO  [ecl/validation]  val:   0.0025, lp:   0.0002 mean dev:   0.0000 RMS:   0.0029 conf:   1.0000
INFO  [ecl/validation] sensor #2, prio: 100, state: OK
INFO  [ecl/validation]  val:  -0.0016, lp:  -0.0019 mean dev:   0.0000 RMS:   0.0012 conf:   1.0000
INFO  [ecl/validation]  val:   0.0067, lp:   0.0067 mean dev:   0.0000 RMS:   0.0013 conf:   1.0000
INFO  [ecl/validation]  val:  -0.0015, lp:  -0.0008 mean dev:   0.0000 RMS:   0.0011 conf:   1.0000
INFO  [sensors] accel status:
INFO  [ecl/validation] validator: best: 0, prev best: 0, failsafe: NO (0 events)
INFO  [ecl/validation] sensor #0, prio: 100, state: OK
INFO  [ecl/validation]  val:  -0.0219, lp:  -0.0279 mean dev:  -0.0001 RMS:   0.0143 conf:   1.0000
INFO  [ecl/validation]  val:  -0.0049, lp:   0.0206 mean dev:  -0.0001 RMS:   0.0136 conf:   1.0000
INFO  [ecl/validation]  val:  -9.8618, lp:  -9.8686 mean dev:  -0.0001 RMS:   0.0107 conf:   1.0000
INFO  [ecl/validation] sensor #1, prio: 99, state: OK
INFO  [ecl/validation]  val:  -0.0672, lp:  -0.0529 mean dev:  -0.0002 RMS:   0.0256 conf:   1.0000
INFO  [ecl/validation]  val:  -0.1331, lp:  -0.1213 mean dev:   0.0026 RMS:   0.0353 conf:   1.0000
INFO  [ecl/validation]  val:  -9.8829, lp:  -9.8698 mean dev:  -0.0004 RMS:   0.0300 conf:   1.0000
INFO  [ecl/validation] sensor #2, prio: 100, state: OK
INFO  [ecl/validation]  val:  -0.1538, lp:  -0.1463 mean dev:   0.0000 RMS:   0.0191 conf:   1.0000
INFO  [ecl/validation]  val:  -0.1138, lp:  -0.1257 mean dev:  -0.0000 RMS:   0.0186 conf:   1.0000
INFO  [ecl/validation]  val:  -9.7799, lp:  -9.8087 mean dev:  -0.0002 RMS:   0.0193 conf:   1.0000

@LorenzMeier LorenzMeier requested a review from bresch April 26, 2020 16:42
@dagar dagar merged commit 3832214 into master Apr 26, 2020
@dagar dagar deleted the pr-imu_fifo_cal_fix branch April 26, 2020 17:24
@TSC21 TSC21 added this to the Release v1.11.0 milestone May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants