mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 15:38:52 +08:00
icm42688p: fix comment about gyro and accel bits
This really confused me. Signed-off-by: Julian Oes <julian@oes.ch>
This commit is contained in:
@@ -642,7 +642,7 @@ void ICM42688P::ProcessAccel(const hrt_abstime ×tamp_sample, const FIFO::DA
|
|||||||
accel.timestamp_sample = timestamp_sample;
|
accel.timestamp_sample = timestamp_sample;
|
||||||
accel.samples = 0;
|
accel.samples = 0;
|
||||||
|
|
||||||
// 18-bits of accelerometer data
|
// 18-bits of accelerometer data, sent as 20-bits, 2 least significant bits always 0
|
||||||
bool scale_20bit = false;
|
bool scale_20bit = false;
|
||||||
|
|
||||||
// first pass
|
// first pass
|
||||||
@@ -738,7 +738,7 @@ void ICM42688P::ProcessGyro(const hrt_abstime ×tamp_sample, const FIFO::DAT
|
|||||||
gyro.timestamp_sample = timestamp_sample;
|
gyro.timestamp_sample = timestamp_sample;
|
||||||
gyro.samples = 0;
|
gyro.samples = 0;
|
||||||
|
|
||||||
// 20-bits of gyroscope data
|
// 19-bits of gyroscope data sent as 20-bits, LSB bit is 0
|
||||||
bool scale_20bit = false;
|
bool scale_20bit = false;
|
||||||
|
|
||||||
// first pass
|
// first pass
|
||||||
@@ -775,6 +775,7 @@ void ICM42688P::ProcessGyro(const hrt_abstime ×tamp_sample, const FIFO::DAT
|
|||||||
scale_20bit = true;
|
scale_20bit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// shift by 1 (least significant bit is always 0)
|
||||||
gyro.x[gyro.samples] = gyro_x / 2;
|
gyro.x[gyro.samples] = gyro_x / 2;
|
||||||
gyro.y[gyro.samples] = gyro_y / 2;
|
gyro.y[gyro.samples] = gyro_y / 2;
|
||||||
gyro.z[gyro.samples] = gyro_z / 2;
|
gyro.z[gyro.samples] = gyro_z / 2;
|
||||||
|
|||||||
Reference in New Issue
Block a user