Can't copy same data than IMU with robot_localization
I have troubles with robot_localization. So I decided to test only data from the Madgwick filter obtained from my IMU.
However, results provided by robot_localization are far from these data.
Here is the launch file:
<?xml version="1.0"?>
<launch>
<node pkg="imu_filter_madgwick" type="imu_filter_node" name="imu_filter_madgwick" output="screen" respawn="false" >
<param name="fixed_frame" value="base_link" />
<param name="use_mag" value="true" />
<param name="use_magnetic_field_msg" value="true" />
<param name="publish_tf" value="true" />
</node>
<node pkg="nodelet" type="nodelet" name="imu_manager"
args="manager" output="screen" />
<node pkg="nodelet" type="nodelet" name="PhidgetsImuNodelet"
args="load phidgets_imu/PhidgetsImuNodelet imu_manager"
output="screen">
<param name="period" value="4"/>
</node>
<node pkg="tf2_ros" type="static_transform_publisher" name="baselink_imu" args="0 0 0.0 0 0 0 base_link imu" />
<node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization" clear_params="true" output="screen">
<param name="frequency" value="5"/>
<param name="sensor_timeout" value="0.1"/>
<param name="imu0" value="/imu/data"/>
<param name="two_d_mode" value="false"/>
<rosparam param="imu0_config">[false, false, false, true, true, true, false, false, false, true, true, true, true, true, true]</rosparam>
<param name="imu0_remove_gravitational_acceleration" value="true"/>
<param name="debug" value="true"/>
<param name="debug_out_file" value="~/debug_ekf_localization.txt"/>
<param name="publish_acceleration" value ="true"/>
<param name="publish_tf" value ="true"/>
<param name="odom_frame" value="odom"/>
<param name="base_link_frame" value="base_link"/>
<rosparam param="initial_estimate_covariance">
[1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100]</rosparam>
</node>
</launch>
Here is what I get from /imu/data:
---
header:
seq: 13861
stamp:
secs: 1525363752
nsecs: 950200058
frame_id: "imu"
orientation:
x: -0.348316741047
y: -0.602712667954
z: 0.590834173906
w: 0.407833135901
orientation_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
angular_velocity:
x: 0.00855211333477
y: 0.0 ...