Ask Your Question
0

navsat_transform_node: Tf has two or more unconnected trees.

asked 2017-04-20 11:41:31 -0500

Pietro gravatar image

Hi, I'm new in ROS

I use robot_localisation Package for Fusing imu, gps, odometry but i have problem with navsat_transform_node

when i launch the launch file i receive this warning:

the topic odometry/gps is empty no message are publish

I don’t understood how i can fix

launch file: https://www.dropbox.com/s/anjvbz7n5w6...

Bag: https://www.dropbox.com/s/6lwmhr3abc2...

Tanks in advance

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2017-04-20 19:16:57 -0500

Geoff gravatar image

updated 2017-04-27 19:21:09 -0500

I took a look at your bag and launch files. It is true that the navsat_transform node is not publishing any messages to /odometry/gps, even though it is getting input data. One possible cause is the error in your task tree that is being reported: the transform from imu0 to base_link is unknown. You have a static_transform_publisher for this in your launch file on line 10, but you have the frames around the wrong way, which means that it is saying that base_link is a child of imu0. Swap the frames on this line.

To fix the problem with nmea_navsat_driver prefixing its task frame with a slash, you need to use a version of the driver with the change specified in this pull request applied.

Until that change is applied you will need to patch the driver yourself, which requires adding a local copy of it to your workspace to override the version installed with ROS.

In your workspace's src directory, clone a copy of the driver's source:

git clone https://github.com/ros-drivers/nmea_navsat_driver.git

Here is the patch that will stop it adding the slash. Save that file as no_to_slashes.patch, go to <your workspace>/src/nmea_navsat_driver, and then run the following command (modifying the path to no_to_slashes.patch as necessary):

patch -p1 < no_to_slashes.patch

(The -p1 strips the first directory from the paths specified in the path file, in this case a/ and b/; without this the patch command won't be able to find the file to modify.)

Then you should be able to compile your workspace and when you use the nmea_navsat_driver it will use your local, patched copy.

Once that pull request goes through, you will not need your modified version of the driver any more. But until a release is made of the fixed version you will still need to keep a copy of the driver source (cloned from Github without modifications) in your workspace so that the fixed version overrides the broken version installed using apt.

edit flag offensive delete link more

Comments

i have this: <node pkg="tf2_ros" type="static_transform_publisher" name="bl_imu" args="0 0 0 0 0 0 1 imu0 base_link"/>

Pietro gravatar imagePietro ( 2017-04-21 02:23:56 -0500 )edit

but i receive this warning: Could not obtain transform from imu0 to base_link. Error was Could not find a connection between 'base_link' and 'imu0' because they are not part of the same tree.Tf has two or more unconnected trees.

Pietro gravatar imagePietro ( 2017-04-21 02:24:23 -0500 )edit

You're right, you do. Sorry, I missed that in your launch file. Anyway, the problem there is that you have the frames around the wrong way. You are telling tf that base_link is a child of imu0. Try swapping the frames.

Geoff gravatar imageGeoff ( 2017-04-21 03:02:20 -0500 )edit

tank you, but now i have this warn:

[ WARN] : Could not obtain transform from /gps to base_link. Error was Invalid argument "/gps" passed to lookupTransform argument source_frame in tf2 frame_ids cannot start with a '/' like

i try to add a node for transformation but not working

Pietro gravatar imagePietro ( 2017-04-26 10:33:42 -0500 )edit

In tf2, frames are no longer allowed to start with a slash. I looked in your bag file and some of your topics are using the frame /gps. What published the /fix0, /fix1 and /vel topics when you recorded your bag file?

Geoff gravatar imageGeoff ( 2017-04-26 21:26:11 -0500 )edit

/fix0 and /fix1 are message from two different GPS for /vel I ask and I let you know Thanks

Pietro gravatar imagePietro ( 2017-04-27 02:47:47 -0500 )edit

OK, you need to check what the frames for those are set to in their driving nodes. If the frame starts with a slash, remove the slash. The same goes for whatever is publishing /vel.

Geoff gravatar imageGeoff ( 2017-04-27 03:02:55 -0500 )edit

for gps i use this node: rosrun nmea_navsat_driver nmea_serial_driver _port:=/dev/ttyACM0 fix:=fix0 __name:=gps0 rosrun nmea_navsat_driver nmea_serial_driver _port:=/dev/ttyACM1 fix:=fix1 __name:=gps1

Pietro gravatar imagePietro ( 2017-04-27 03:35:30 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-04-20 11:41:31 -0500

Seen: 523 times

Last updated: Apr 27 '17