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: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
/imu
header:
seq: 26753
stamp:
secs: 1480672257
nsecs: 346966028
frame_id: imu_link
orientation:
x: 0.0027948294582
y: -0.0135141274958
z: -0.988287867583
w: 0.151975814111
orientation_covariance: [0.017453292519943295, 0.0, 0.0, 0.0, 0.017453292519943295, 0.0, 0.0, 0.0, 0.15707963267948966]
angular_velocity:
x: -0.0103946747258
y: -0.00381026370451
z: 0.306645005941
angular_velocity_covariance: [0.0004363323129985824, 0.0, 0.0, 0.0, 0.0004363323129985824, 0.0, 0.0, 0.0, 0.0004363323129985824]
linear_acceleration:
x: -0.331079125404
y: 0.683972775936
z: 10.7696285248
linear_acceleration_covariance: [0.0004, 0.0, 0.0, 0.0, 0.0004, 0.0, 0.0, 0.0, 0.0004]
Clearly, if yaw angle comes from IMU, the initial value is not zero, but the yaw angle from /odom is 0.
EDIT3: @M@t @Tom Moore I ran turtlebot at a 4X4 square, here is the bag file link. [https://drive.google.com/file/d/0ByqC7Wzoqm1GSjdKWEZRRW4xdGc/view?usp=sharing] The result is briefly shown here:
[https://drive.google.com/file/d/0ByqC7Wzoqm1GNG9FZm82QlJvVFU/view?usp=sharing]
The blue one is the original /odom from the turtlebot. The red one is from EKF fusion with IMU. The red one cannot come back to the origin. Is it because my IMU isn't good enough? The yaw angle cann't keep all the time?
Originally posted by jerryzhchao on ROS Answers with karma: 13 on 2016-11-29
Post score: 1
Original comments
Comment by gvdhoorn on 2016-11-29:
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 use ctrl+k
).
Thanks.
Comment by jerryzhchao on 2016-11-29:
@gvdhoorn Thanks for reminder.
Comment by Tom Moore on 2016-12-19:
Can you please also post sample input messages for each of your inputs?
Comment by M@t on 2016-12-19:
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.
Comment by jerryzhchao on 2016-12-19:
@M@t Yes the IMU conforms to REP103 with ENU frame. I will prepare a small bag asap.
Comment by M@t on 2016-12-19:
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.