Could not obtain transform from base_footprint to base_link
I tried spawning my custom urdf in gazebo and rviz but I'm getting the warning
Could not obtain transform from base_footprint to base_link. Error was Could not find a connection between 'base_link' and 'base_footprint' because they are not part of the same tree.Tf has two or more unconnected trees.
and
no transform from /base_footprint to /map
error in rviz
I've tried using a static_transform_publisher but the warning and error persists. My base_footprint and base_link joint is straight forward.
<link name="base_footprint" />
<joint name="base_link_joint" type="fixed">
<parent link="base_footprint"/>
<child link="base_link"/>
<origin xyz="0 0 -1" rpy="0 0 0"/>
</joint>
<link name="base_link">
<visual>
<geometry>
<box size="4 5 .7"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0.05"/>
</visual>
<collision>
<geometry>
<box size="4 5 .7"/>
</geometry>
</collision>
<xacro:default_inertial mass="5" ixx="10.62" iyy="6.87" izz="17.08"/>
</link>
How can I fix this ?
Thanks
Edit
The tf_tree
Edit 2
ekf_se_odom: frequency: 30 sensor_timeout: 0.1 two_d_mode: true transform_time_offset: 0.0 transform_timeout: 0.0 print_diagnostics: true debug: false map_frame: map odom_frame: odom base_link_frame: base_footprint world_frame: odom .......
ekf_se_map: frequency: 30 sensor_timeout: 0.1 two_d_mode: true transform_time_offset: 0.0 transform_timeout: 0.0 print_diagnostics: true debug: false map_frame: map odom_frame: odom base_link_frame: base_footprint world_frame: map .......
Can you add the TF tree image to your post?
@billy I've updated the question to include the tf tree.
A child frame can have only one parent. Looks like your ODOM link is the base_link parent but you're trying to assign base_footprint as parent as well.
Try putting the ODOM as the parent to base_footprint in the ODOM TF.
@billy How do I do that ? The odom->base_link is generated using robot_localization package.
Thanks. I've set the base_link's parent to base_footprint. But I now have a new problem. The keyboard teleop moves my bot in the right direction in gazebo but the wrong direction in rviz. e.g the "i" key for moving forward moves the bot forward in gazebo but backward in rviz.
I've updated the question to show the new tf_tree and the fix I made for the first error is changing the base_link_frame in both ekf_se_odom and ekf_se_map to base_footprint as oppose to base_link as shown in the edit 2 of the updated question.
I have no experience with Gazebo so cannot help you with that. I am curious about the latest TF tree. I can't read what frame in on the left below map. It's just too blurry. What does it say?
@billy That's utm broadcasted by /navsat_transform.
@billy here is an unrelated question. Is /odom frame meant to move with the robot when /map frame is set as the fixed frame? My understanding is /odom frame is fixed and meant to be the origin of /base_link.