Ask Your Question
0

Why tf is not linked on indigo?

asked 2014-11-09 06:46:50 -0500

gernot gravatar image

Hi!

I've the problem that on ROS indigo tf is not linked to my executable even if I specify it in find_package and as dependency in package.xml.

Below is a stripped down example that shows the problem.

On ROS Hydro the package compiles fine. On ROS Indigo i get the linker error: undefined reference to `tf::TransformBroadcaster::TransformBroadcaster()'

This are the only files in the package:

tf_broadcaster.cpp:

#include <ros/ros.h>
#include <tf/transform_broadcaster.h>
int main(int argc, char** argv){
    tf::TransformBroadcaster br;
    return 0;
};

CMakeLists.cpp:

cmake_minimum_required(VERSION 2.8.3)
project(tmptest)
find_package(catkin REQUIRED COMPONENTS
  roscpp
  tf
)
add_executable(tf_broadcaster src/tf_broadcaster.cpp)
target_link_libraries(tf_broadcaster ${catkin_LIBRARIES})

Package.xml:

<?xml version="1.0"?>
<package>
  <name>tmptest</name>
  <version>0.0.0</version>
  <description>The tmptest package</description>
  <maintainer email="a@b.cd">me</maintainer>
  <license>TODO</license>
  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>roscpp</build_depend>
  <build_depend>tf</build_depend>
  <run_depend>roscpp</run_depend>
  <run_depend>tf</run_depend>
</package>

If I take a closer look at ${catkin_LIBRARIES}, libtf.so is not contained on Indigo, but it is on Hydro. Is this a bug or am I missing something that has changed from Hydro to Indigo.

Thx!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-11-10 00:57:57 -0500

gernot gravatar image

Don't know what went wrong, but I could finally solve this by removing the build and devel folder and reinitialize my workspace. Thx!

edit flag offensive delete link more
2

answered 2014-11-09 15:25:40 -0500

Andromeda gravatar image

I had the same problem. Try putting anothe include in your code:

#include <tf/transform_datatypes.h>
#include <tf/transform_listener.h>

and in your CMakeLists.txt:

find_package( catkin REQUIRED
    genmsg
    tf
)

I think there is another step too but I didn't remember right

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2014-11-09 06:46:50 -0500

Seen: 1,856 times

Last updated: Nov 10 '14