# TF is broken when using robot_localization package with only IMU sensor, how to assure that the measured velocity is the one from the robot?

Im using thisrobot_lokalization robot_localization package for the linear velocity. As only sensor input in my case is IMU. I configure the parameters and set the frames as follow

map_frame: map
odom_frame: odom
world_frame: odom


The launch file is the following one

<launch>
<node pkg="robot_localization" type="ekf_localization_node" name="ekf_se" clear_params="true">
<rosparam command="load" file="$(find robot_localization)/params/ekf_template.yaml" /> <param name="odom_used" value="false"/> </node> <node pkg="tf" type="static_transform_publisher" name="base_link_to_imu" args="0 0 0 0 0 0 /thrbot/base_link /thrbot/imu_link 100" /> </launch>  The robot base_link frame is thrbot/base_link the IMU is thrbot/imu_link Here is the photo of the TF without using the package . But when using the package my TF is broken as can see from the photo here . Any help how to fix the TF and correctly use the package with IMU as only sensor input? To fix the TF i change the configure the parameters in ekf_template.yaml as follow odom_frame: odom base_link_frame: /thrbot/base_footprint world_frame: odom  and the launch file to follow <launch> <node pkg="robot_localization" type="ekf_localization_node" name="ekf_se" clear_params="true"> <rosparam command="load" file="$(find robot_localization)/params/ekf_template.yaml" />
<param name="frame_id" value="odom"/>
</node>

<node pkg="tf" type="static_transform_publisher" name="base_link_to_odom" args="0 0 0 0 0 0 /odom /thrbot/base_footprint 100" />

</launch>


Now the TF looks good as can see . Than following parameters are configure in ekf_template.yaml:

imu0: /thrbot/imu
imu0_config: [false, false, false,
true, true, true,
false, false, false,
true,  true,  true,
true,  true,  true]

imu0_remove_gravitational_acceleration: true
imu0_nodelay: false
imu0_differential: false
imu0_relative: true
imu0_queue_size: 5
imu0_pose_rejection_threshold: 0.8
imu0_twist_rejection_threshold: 0.8
imu0_linear_acceleration_rejection_threshold: 0.8


My question is now as that correct configuration for underwater UUV to get linear velocity?

Based on your configuration, you are trying to create map -> odom -> /thrbot/base_link. But you do not have a map frame. Looking at your oroginal TF, you should instead create world -> odom -> base_footprint.

I think your configuration should be:

odom_frame: odom
world_frame: world


EDIT: as pointed out,

world_frame: odom

• Ok. So what should I put in map_frame: ? just leave it empty?
– bob
Sep 27 at 5:36
• with odom_frame: odom base_link_frame: /thrbot/base_footprint world_frame: world I got ERROR Odometry message frame_id was world, expected map or odom . I think in the launch file need to specify parent and child frame correctly. Is this static transform in the above launch file ok?  <node pkg="tf" type="static_transform_publisher" name="base_link_to_imu" args="0 0 0 0 0 0 /thrbot/base_link /thrbot/imu_link 100" />
– bob
Sep 27 at 6:19
• also in the ekf_template.yaml Im not sure about odom parameters settings such as; odom0: example/odom . is that correct? what should i put in odom parameters?
– bob
Sep 27 at 6:48
• ok. Fix the TF . I update the question with the new settings and launch file, but have several doubts. . How to be sure that everything is in local frame and how to assure that the velocity is the real velocity of the robot? ( i know there will be error regarding the integration and will accumulate with time) but I like to know that with the parameters settings Im estimation the velocity of the robot and not something else. Please can you help with that?
– bob
Sep 27 at 12:54
• Since you do not have a map, you can leave the map_frame empty, or just skip that tag. You are correct, the world_frame should be odom. My bad! In your example, you only have an IMU right? If so, you should not populate odom0. Sep 27 at 14:12