ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Could not obtain transform from base_footprint to base_link

asked 2019-04-11 05:06:39 -0600

the3kr gravatar image

updated 2022-08-28 10:58:22 -0600

lucasw gravatar image

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_treeimage description

Edit 2

image description

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 .......

edit retag flag offensive close merge delete

Comments

Can you add the TF tree image to your post?

billy gravatar image billy  ( 2019-04-11 08:19:10 -0600 )edit

@billy I've updated the question to include the tf tree.

the3kr gravatar image the3kr  ( 2019-04-11 11:38:13 -0600 )edit

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 gravatar image billy  ( 2019-04-11 16:48:43 -0600 )edit

@billy How do I do that ? The odom->base_link is generated using robot_localization package.

the3kr gravatar image the3kr  ( 2019-04-11 18:43:19 -0600 )edit

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.

the3kr gravatar image the3kr  ( 2019-04-11 18:57:11 -0600 )edit

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 gravatar image billy  ( 2019-04-11 19:40:21 -0600 )edit

@billy That's utm broadcasted by /navsat_transform.

the3kr gravatar image the3kr  ( 2019-04-11 20:53:18 -0600 )edit

@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.

the3kr gravatar image the3kr  ( 2019-04-11 21:46:46 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-04-13 18:17:20 -0600

billy gravatar image

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.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2019-04-11 05:06:39 -0600

Seen: 2,445 times

Last updated: Apr 13 '19