aboutsummaryrefslogtreecommitdiff
path: root/apps/drivers
diff options
context:
space:
mode:
authorJulian Oes <joes@student.ethz.ch>2013-04-08 23:29:24 -0700
committerJulian Oes <joes@student.ethz.ch>2013-04-08 23:29:24 -0700
commit8c70f4412d7e55f22cffa60e0ea953751780f462 (patch)
treefede7038d2a9c848ceebb6e3f45ae45aed4bcceb /apps/drivers
parentf562a279765a7d90bad7b07963995148de4b2af2 (diff)
downloadpx4-firmware-8c70f4412d7e55f22cffa60e0ea953751780f462.tar.gz
px4-firmware-8c70f4412d7e55f22cffa60e0ea953751780f462.tar.bz2
px4-firmware-8c70f4412d7e55f22cffa60e0ea953751780f462.zip
Fixed axis in L3GD20 driver
Diffstat (limited to 'apps/drivers')
-rw-r--r--apps/drivers/l3gd20/l3gd20.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/drivers/l3gd20/l3gd20.cpp b/apps/drivers/l3gd20/l3gd20.cpp
index 6227df72a..c7f433dd4 100644
--- a/apps/drivers/l3gd20/l3gd20.cpp
+++ b/apps/drivers/l3gd20/l3gd20.cpp
@@ -684,9 +684,10 @@ L3GD20::measure()
* 74 from all measurements centers them around zero.
*/
report->timestamp = hrt_absolute_time();
- /* XXX adjust for sensor alignment to board here */
- report->x_raw = raw_report.x;
- report->y_raw = raw_report.y;
+
+ /* swap x and y and negate y */
+ report->x_raw = raw_report.y;
+ report->y_raw = ((raw_report.x == -32768) ? 32767 : -raw_report.x);
report->z_raw = raw_report.z;
report->x = ((report->x_raw * _gyro_range_scale) - _gyro_scale.x_offset) * _gyro_scale.x_scale;