aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/hmc5883
diff options
context:
space:
mode:
authorJulian Oes <julian@oes.ch>2013-08-20 19:50:58 +0200
committerJulian Oes <julian@oes.ch>2013-08-20 20:00:16 +0200
commit307c9e52c775de2ce09ff4abf0bc1fb5db6dd41e (patch)
tree3a4046da663893769ada839d47e0a8a28ac15f3a /src/drivers/hmc5883
parentd2d59aa39278de9461ff72061cbd8a89d7e81f4b (diff)
downloadpx4-firmware-307c9e52c775de2ce09ff4abf0bc1fb5db6dd41e.tar.gz
px4-firmware-307c9e52c775de2ce09ff4abf0bc1fb5db6dd41e.tar.bz2
px4-firmware-307c9e52c775de2ce09ff4abf0bc1fb5db6dd41e.zip
Sorry, finally got the axes of the external mag right
Diffstat (limited to 'src/drivers/hmc5883')
-rw-r--r--src/drivers/hmc5883/hmc5883.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/hmc5883/hmc5883.cpp b/src/drivers/hmc5883/hmc5883.cpp
index 692f890bd..44304fc22 100644
--- a/src/drivers/hmc5883/hmc5883.cpp
+++ b/src/drivers/hmc5883/hmc5883.cpp
@@ -861,10 +861,10 @@ HMC5883::collect()
} else {
#endif
/* the standard external mag by 3DR has x pointing to the right, y pointing backwards, and z down,
- * therefore switch and invert x and y */
+ * therefore switch x and y and invert y */
_reports[_next_report].x = ((((report.y == -32768) ? 32767 : -report.y) * _range_scale) - _scale.x_offset) * _scale.x_scale;
/* flip axes and negate value for y */
- _reports[_next_report].y = ((((report.x == -32768) ? 32767 : -report.x) * _range_scale) - _scale.y_offset) * _scale.y_scale;
+ _reports[_next_report].y = ((report.x * _range_scale) - _scale.y_offset) * _scale.y_scale;
/* z remains z */
_reports[_next_report].z = ((report.z * _range_scale) - _scale.z_offset) * _scale.z_scale;
#ifdef PX4_I2C_BUS_ONBOARD