df_hmc5883_wrapper: get the var swapping right

This commit is contained in:
Julian Oes
2016-03-12 12:22:05 +01:00
committed by Lorenz Meier
parent 09dd88ec01
commit 65947346eb
@@ -171,8 +171,9 @@ int DfHmc9250Wrapper::_publish(struct mag_sensor_data &data)
/* The standard external mag by 3DR has x pointing to the
* right, y pointing backwards, and z down, therefore switch x
* and y and invert y. */
const float tmp = data.field_x_ga;
data.field_x_ga = -data.field_y_ga;
data.field_y_ga = data.field_x_ga;
data.field_y_ga = tmp;
// TODO: remove these (or get the values)
mag_report.x_raw = NAN;