mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 10:46:33 +08:00
adis16497: fix TEMP_OUT conversion according to the datasheet
This commit is contained in:
committed by
Lorenz Meier
parent
89bc68e12b
commit
33fe69a3e8
@@ -613,7 +613,7 @@ ADIS16497::publish_accel(const hrt_abstime &t, const ADISReport &report)
|
||||
arb.y_integral = aval_integrated(1);
|
||||
arb.z_integral = aval_integrated(2);
|
||||
|
||||
arb.temperature = report.TEMP_OUT * 0.0125f - 25.0f; // 1 LSB = 0.0125°C, 0x0000 at 25°C
|
||||
arb.temperature = (int16_t(report.TEMP_OUT) * 0.0125f) + 25.0f; // 1 LSB = 0.0125°C, 0x0000 at 25°C
|
||||
|
||||
orb_publish(ORB_ID(sensor_accel), _accel_topic, &arb);
|
||||
}
|
||||
@@ -662,7 +662,7 @@ ADIS16497::publish_gyro(const hrt_abstime &t, const ADISReport &report)
|
||||
grb.y_integral = gval_integrated(1);
|
||||
grb.z_integral = gval_integrated(2);
|
||||
|
||||
grb.temperature = report.TEMP_OUT * 0.0125f - 25.0f; // 1 LSB = 0.0125°C, 0x0000 at 25°C
|
||||
grb.temperature = (int16_t(report.TEMP_OUT) * 0.0125f) + 25.0f; // 1 LSB = 0.0125°C, 0x0000 at 25°C
|
||||
|
||||
orb_publish(ORB_ID(sensor_gyro), _gyro->_gyro_topic, &grb);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user