mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 04:23:34 +08:00
df_hmc5883_wrapper: get the var swapping right
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user