tf2::fromMsg cause "Undefined reference"
Hi all,
I want to convert geometry_msgs::Point
into tf2::Vector3
to do some computation. There has an API void tf2::fromMsg (const geometry_msgs::Point &in, tf2::Vector3 &out) to do so, but it causes undefined reference
, below is the error when I build my package.
undefined reference to 'void tf2::fromMsg<geometry_msgs::Point_<std::allocator<void> >, tf2::Vector3>(geometry_msgs::Point_<std::allocator<void> > const&, tf2::Vector3&)'
collect2: error: ld returned 1 exit status
Below is my CMakeLists.txt:
cmake_minimum_required(VERSION 2.8.3)
project(clean_viz)
find_package(catkin REQUIRED COMPONENTS
geometry_msgs
roscpp
std_msgs
tf2_geometry_msgs
tf2_ros
visualization_msgs
)
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS
geometry_msgs
roscpp
std_msgs
tf2_geometry_msgs
tf2_ros
visualization_msgs
)
include_directories(
include
${catkin_INCLUDE_DIRS}
)
add_executable(clean_viz src/clean_viz.cpp)
target_link_libraries(
clean_viz
${catkin_LIBRARIES}
Anybody know how to solve it? Thanks in advance.
Could you show your CMakelists.txt?