Integrate an IMU sensor with robot_localization
Hello,
I'm trying to integrate an IMU sensor to my mobile robot no holonomic.
I follow the robot_localization tutorial to do that, but I'm a little confused with some questions.
First, how should be my resulting tf tree? I think the frame "odom_ekf" provided from ekf_localization node would be at the top of the tree. The base_link frame would be down. So when I called the set_pose service provided from ekf_localization node, this service could changed the values of transformed between "odom_ekf" frame and "base_link" frame. Is that correct?
Second, only starting to fuse the IMU sensor with the odometry, how the launch file of robot_localization should be?
<launch> <node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization" clear_params="true" output="screen"> <param name="frequency" value="30"/> <param name="sensor_timeout" value="0.1"/> <param name="odom_frame" value="odom_ekf"/> <param name="base_link_frame" value="base_link"/> <param name="world_frame" value="odom_ekf"/> <param name="odom0" value="/myOdomTopic"/> <param name="imu0" value="/myImuTopic"/> <rosparam param="odom0_config">[false, false, true, true, true, true, true, true,true, true, true, true, true, true, true]</rosparam> <rosparam param="imu0_config">[false, false, false, true, true, true, false, false, false, false, false, false, true, true, true]</rosparam> <param name="imu0_remove_gravitational_acceleration" value="true"/> <param name="odom0_remove_gravitational_acceleration" value="true"/> <param name="odom0_differential" value="true"/> <param name="imu0_differential" value="false"/> <remap from="/odometry/filtered" to="/odometry/odom_imu" /> </node> </launch>
With this launch, the tf between odom_ekf and base_link is published and the topic /odometry/filtered shows correctly the robot position. But:
- The topic /odometry/filtered doesn't take into a count the changes at orientation. The position is more or less fine, but the orientation doesn't change. - The remap to /odometry/odom_imu is not working. - When the robot_localization is running these warnings appears constantly:
"[ WARN] [1417095211.082070235]: MessageFilter [target=odom_ekf ]: Dropped 100.00% of messages so far. Please turn the [ros.robot_localization.message_notifier] rosconsole logger to DEBUG for more information. I think first I have to solve this problems and then integrate the GPS sensor.
I'm not sure what I'm doing wrong. Some help would be greatly appreciated.
UPDATE 1:
Here is my frames.pdf
I've corrected some errors with the tf and now the robot_localization node doesn't show any errors.
The problem now is that the odometry/filetered isn't given the correct position and orientation. This is my launch file:
<launch>
<node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization" clear_params="true" output="screen">
<param name="frequency" value="30"/>
<param name="sensor_timeout" value="0.1"/>
<param name="odom_frame" value="summit_a/odom"/>
<param name="base_link_frame" value="summit_a/base_footprint"/>
<param name="world_frame" value="summit_a/odom"/>
<param name="odom0" value="summit_xl_controller/odom"/>
<rosparam param="odom0_config">[true, true, false,
false, false, true,
true, true, false,
false, false, true,
false, false, false]
</rosparam>
<rosparam param="imu0_config">[false, false, false,
false, false, false,
false, false, false,
false, false, true,
false, false, false]</rosparam>
<param name="two_d_mode" value="true"/>
<param name="odom0_differential" value="true"/>
<param name="imu0_differential" value="true"/>
</node>
</launch>
The odometry of odom0 is ...
Question before I update the answer: is this robot holonomic? It doesn't look it, but I know the Summit XLs can have omnidirectional wheels.
Comment in response to update 3: I'll take a look at this. Just so I'm clear, for the path that you drove, the robot's real-world start and end locations were exactly the same, correct?
One more thing: I keep getting errors when I attempt to filter your ROS bag files. This happened for the last file as well. The error is long, but here's the last line of it:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 4080: ordinal not in range(128)
The path that I drove finished more or less at the same location that started. Just the odometry (red) is so reliable, the odometry_filtered (green) should be very similiar to odometry(red).
I don't have any problem playing my bagfiles. I'm using hydro, maybe you're using indigo and something at bagfiles changed?
Great! I'm glad it's working for you. Do you mind if I use your bag file for generating new integration tests? I ask because it would likely become part of the package, at least until I locate some web space for storing them.
Of course. Feel free to use my bag file.
ASoriano, Do you have the file where you have fill the imu msg? I use rosserial_arduino to do that but I want to compare other methods. Thank you.