Yaw problem for IMU fusinon in robot_localization
EDIT1: The Yaw feedback from Mti-300 is a didital compass that in ENU frame. So it is not the same with /odom source. If I fusion data with IMU's Yaw, the result is very bad. If I only fusion with the yaw angular velocity, the result is acceptable. Is it correct? and Could anyone please tell me how to deal with the absolute yaw value? @M@t @Moderator
EDIT2 I've got a GPS and a Mti-300 IMU producing IMU message at 400HZ. I am trying to use ekf_fusion to estimate the robot's position. Firstly, when I tried to use only one IMU & odom without the GPS, the result is very very bad. But I tried the testbag1, it works fine. Here is my simple launch file. The other launch file for the IMU node is omitted.
<node pkg="rosbag" type="play" name="rosbagplay" args="$(find robot_localization)/test_turtlebot/1202.bag --clock -d 5" required="true"/>
<node name="test_ekf_localization_node_bag2_ekf" pkg="robot_localization" type="ekf_localization_node" clear_params="true" >
<param name="frequency" value="30"/>
<param name="sensor_timeout" value="0.1"/>
<param name="odom0" value="/odom"/>
<param name="imu0" value="/imu/data"/>
<param name="map_frame" value="map"/>
<param name="odom_frame" value="odom"/>
<param name="base_link_frame" value="base_footprint"/>
<param name="world_frame" value="odom"/>
<rosparam param="odom0_config">[false, false, false,
false, false, false,
true, true, true,
false, false, false,
false, false, false]</rosparam>
<rosparam param="imu0_config">[false, false, false,
true, true, true,
false, false, false,
true, true, true,
true, true, true]</rosparam>
<param name="odom0_queue_size" value="10"/>
<param name="imu0_queue_size" value="10"/>
<param name="imu0_remove_gravitational_acceleration" value="true"/>
I found the problem maybe caused by the yaw output from my IMU. Change the configuration matrix to
<rosparam param="odom0_config">[false, false, false,
false, false, true,
true, true, true,
false, false, false,
false, false, false]</rosparam>
<rosparam param="imu0_config">[false, false, false,
true, true, false,
false, false, false,
true, true, true,
true, true, true]</rosparam>
The result is better,about 1 m error after 200m testing. However I know it is not corrct for using yaw from /odom. But it sems like I cannot use the yaw(from compass) from IMU.
@Tom Moore Thnks very much, here are my sample messages.
/odom: ---
header:
seq: 5419
stamp:
secs: 1480672217
nsecs: 320610941
frame_id: odom
child_frame_id: base_footprint
pose:
pose:
position:
x: 4.18018921507
y: -0.135587119981
z: 0.0
orientation:
x: 0.0
y: 0.0
z: -0.0435322037951
w: 0.999052024287
covariance: [0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.7976931348623157e+308, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.7976931348623157e+308, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.7976931348623157e+308, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.05]
twist:
twist:
linear:
x: 0.347565259959
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
covariance ...
Could you please format your code copy/pastes using the Preformatted Text button next time (it's the one with
101010
on it)? Select the code/launch file/console text and press the button (or usectrl+k
).Thanks.
@gvdhoorn Thanks for reminder.
Can you please also post sample input messages for each of your inputs?
Can you also confirm that your IMU conforms to REP 103? I.e does the yaw increases CCW and read 0.0 when facing East? If you could post some links to some short bagfiles that would help as well.
@M@t Yes the IMU conforms to REP103 with ENU frame. I will prepare a small bag asap.
Awesome. I suggest you drive it in a small square, say 5x5m. Start and finish at the same point. Then we can see how the EKF responds going in straight lines with different headings, and how it responds when turning on the spot. Also make sure your robot is away from any large metal objects.