0
$\begingroup$

Rosanswers logo

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


Originally posted by the3kr on ROS Answers with karma: 91 on 2019-04-11

Post score: 0


Original comments

Comment by billy on 2019-04-11:
Can you add the TF tree image to your post?

Comment by the3kr on 2019-04-11:
@billy I've updated the question to include the tf tree.

Comment by billy on 2019-04-11:
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.

Comment by the3kr on 2019-04-11:
@billy How do I do that ? The odom->base_link is generated using robot_localization package.

Comment by the3kr on 2019-04-11:
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.

Comment by billy on 2019-04-11:
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?

Comment by the3kr on 2019-04-11:
@billy That's utm broadcasted by /navsat_transform.

Comment by the3kr on 2019-04-11:
@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.

Comment by billy on 2019-04-11:
Yes, ODOM is where the robot thinks it is in the map, so it will move with the robot within the map. In your case it sounds the the ODOM tracks where the footprint is with base being some offset of from foot print (in Z I guess).

Comment by billy on 2019-04-13:
Since the TF tree issue is fixed, I'll convert my comment to answer for you to mark as correct for next person that has the question.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by billy with karma: 1850 on 2019-04-13

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.