mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 07:43:34 +08:00
sensor_combined: replace accel & gyro integral with value, use float for dt
Reason: the value is easier to read & handle (for example plotting). In most places the value is needed, not the integral. Note that this breaks the replay format for sdlog2 replay
This commit is contained in:
@@ -204,14 +204,9 @@ void frsky_update_topics()
|
||||
void frsky_send_frame1(int uart)
|
||||
{
|
||||
/* send formatted frame */
|
||||
float acceleration[3];
|
||||
float accel_dt = sensor_combined->accelerometer_integral_dt / 1.e6f;
|
||||
acceleration[0] = sensor_combined->accelerometer_integral_m_s[0] / accel_dt;
|
||||
acceleration[1] = sensor_combined->accelerometer_integral_m_s[1] / accel_dt;
|
||||
acceleration[2] = sensor_combined->accelerometer_integral_m_s[2] / accel_dt;
|
||||
frsky_send_data(uart, FRSKY_ID_ACCEL_X, roundf(acceleration[0] * 1000.0f));
|
||||
frsky_send_data(uart, FRSKY_ID_ACCEL_Y, roundf(acceleration[1] * 1000.0f));
|
||||
frsky_send_data(uart, FRSKY_ID_ACCEL_Z, roundf(acceleration[2] * 1000.0f));
|
||||
frsky_send_data(uart, FRSKY_ID_ACCEL_X, roundf(sensor_combined->accelerometer_m_s2[0] * 1000.0f));
|
||||
frsky_send_data(uart, FRSKY_ID_ACCEL_Y, roundf(sensor_combined->accelerometer_m_s2[1] * 1000.0f));
|
||||
frsky_send_data(uart, FRSKY_ID_ACCEL_Z, roundf(sensor_combined->accelerometer_m_s2[2] * 1000.0f));
|
||||
|
||||
frsky_send_data(uart, FRSKY_ID_BARO_ALT_BP,
|
||||
sensor_combined->baro_alt_meter);
|
||||
|
||||
Reference in New Issue
Block a user