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 apply sensor rotation before scaling #11713

Merged
merged 2 commits into from
Mar 24, 2019

Conversation

dagar
Copy link
Member

@dagar dagar commented Mar 24, 2019

@dagar dagar added the bug label Mar 24, 2019
@dagar dagar added this to the Release v1.9.0 milestone Mar 24, 2019
@dagar dagar requested review from julianoes and RomanBapst March 24, 2019 17:45
 - prevents loss of numerical precision
 - fixes #11695
@dagar dagar force-pushed the pr-accel_rotation_precision branch from b36f828 to 370ff38 Compare March 24, 2019 17:46
 - prevents loss of numerical precision
@dagar
Copy link
Member Author

dagar commented Mar 24, 2019

This is also worth noting for downstream of the sensor drivers where board rotations are applied on the scaled floating point data (SENS_BOARD_ROT, SENS_BOARD_{X, Y, Z}_OFF.

  • sensors module
  • calibration
  • mc_att_control

https://github.com/PX4/Firmware/blob/f402f68fb19b96152486ef95e1fa2b5cbc91b39d/src/modules/sensors/voted_sensors_update.cpp#L135-L138

Switching to double precision floating point on newer platforms like px4_fmu-v5 would be one relatively easy solution.

@bresch
Copy link
Member

bresch commented Mar 24, 2019

Nice!

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.0215, lp:  -0.0282 mean dev:  -0.0034 RMS:   0.0589 conf:   1.0000
INFO  [ecl/validation] 	val:   0.0272, lp:   0.0396 mean dev:  -0.0001 RMS:   0.0180 conf:   1.0000
INFO  [ecl/validation] 	val:  -9.8133, lp:  -9.8210 mean dev:   0.0008 RMS:   0.0385 conf:   1.0000
INFO  [ecl/validation] sensor #1, prio: 99, state: OK
INFO  [ecl/validation] 	val:  -0.1556, lp:  -0.1544 mean dev:  -0.0014 RMS:   0.0308 conf:   1.0000
INFO  [ecl/validation] 	val:   0.0821, lp:   0.0560 mean dev:  -0.0003 RMS:   0.0237 conf:   1.0000
INFO  [ecl/validation] 	val:  -9.7675, lp:  -9.7904 mean dev:   0.0002 RMS:   0.0456 conf:   1.0000

@LorenzMeier LorenzMeier merged commit 3d27124 into master Mar 24, 2019
@LorenzMeier LorenzMeier deleted the pr-accel_rotation_precision branch March 24, 2019 22:34
@LorenzMeier
Copy link
Member

@bresch Could you please work with @dagar on looking at the other options to see if we miss out on the other locations?

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.

Accelerometer calibration problem on FMUV5
3 participants