IMU + Magnetometer points south - madgwick filter

asked 2021-02-19 05:23:18 -0500

Gherkins gravatar image

updated 2021-02-19 05:34:18 -0500

I have a um7 imu that publishes data in NED frame.

I then have a imu_transformer node that transforms it to enu in base_link

<node pkg="tf2_ros" type="static_transform_publisher" name="ned_publisher" args="0 0 0 0 0 3.1416  imu_link_ned imu_link_enu"/>

<node name="um7_transformer" pkg="imu_transformer" type="imu_transformer_node">
<remap from="imu_in" to="um7"/>
<remap from="imu_out/data" to="imu/data_raw"/>
<remap from="imu_out/mag" to="imu/mag"/>
<param name="target_frame" value="base_link"/>

And then finally a madgwick filter node:

<node name="madgwick_filter" pkg="imu_filter_madgwick" type="imu_filter_node">
<rosparam command="load" file="$(find robot_config)/config/madgwick_filter.yaml"/>

With the following parameters:

use_magnetic_field_msg: true
use_mag: true
mag_bias_x: 0
mag_bias_y: 0
mag_bias_z: 0
orientation_stddev: 0.001
gain: 0.01
zeta: 0.001
publish_tf: false

The robot is pointing north but when I view this with rviz_imu_plugin the green axis points towards south and the red axis points towards west. C:\fakepath\Screenshot from 2021-02-19 12-31-00.png imu_link_enu and visualised orientation with rviz_imu_plugin

How can I fix this?

edit retag flag offensive close merge delete