mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 04:33:33 +08:00
MindPX: Remove hardcode for sensors rotation.
This commit is contained in:
committed by
Lorenz Meier
parent
f17dc2f2a6
commit
b280e28623
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2015, 2016 Airmind Development Team. All rights reserved.
|
||||
* Copyright (c) 2015, 2016 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -1719,9 +1719,6 @@ MPU6500::measure()
|
||||
report.gyro_z = int16_t_from_bytes(mpu_report.gyro_z);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (report.accel_x == 0 &&
|
||||
report.accel_y == 0 &&
|
||||
report.accel_z == 0 &&
|
||||
@@ -1749,29 +1746,6 @@ MPU6500::measure()
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_ARCH_BOARD_MINDPX_V2)
|
||||
/*
|
||||
* Swap axes and negate z
|
||||
*/
|
||||
int16_t accel_xt = report.accel_y;
|
||||
int16_t accel_yt = report.accel_x;
|
||||
int16_t accel_zt = ((report.accel_z == -32768) ? 32767 : -report.accel_z);
|
||||
|
||||
int16_t gyro_xt = report.gyro_y;
|
||||
int16_t gyro_yt = report.gyro_x;
|
||||
int16_t gyro_zt = ((report.gyro_z == -32768) ? 32767 : -report.gyro_z);
|
||||
|
||||
/*
|
||||
* Apply the swap
|
||||
*/
|
||||
report.accel_x = accel_xt;
|
||||
report.accel_y = accel_yt;
|
||||
report.accel_z = accel_zt;
|
||||
report.gyro_x = gyro_xt;
|
||||
report.gyro_y = gyro_yt;
|
||||
report.gyro_z = gyro_zt;
|
||||
|
||||
#else
|
||||
/*
|
||||
* Swap axes and negate y
|
||||
*/
|
||||
@@ -1788,7 +1762,7 @@ MPU6500::measure()
|
||||
report.accel_y = accel_yt;
|
||||
report.gyro_x = gyro_xt;
|
||||
report.gyro_y = gyro_yt;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Report buffers.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user