0
$\begingroup$

Rosanswers logo

I am migrating a node from Fuerte to Hydro that uses the message_filters ApproximateTime sync policy. The code being used for this is functionally identical to the example on the message_filters wiki page, and worked great in Fuerte. But now when I try to build, I get the following linker errors:

CMakeFiles/vo_rgbd_node.dir/src/ros_server.cpp.o: In function `message_filters::Synchronizer >, sensor_msgs::Image_ >, sensor_msgs::CameraInfo_ >, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType> >::disconnectAll()':
ros_server.cpp:(.text._ZN15message_filters12SynchronizerINS_13sync_policies15ApproximateTimeIN11sensor_msgs6Image_ISaIvEEES6_NS3_11CameraInfo_IS5_EENS_8NullTypeES9_S9_S9_S9_S9_EEE13disconnectAllEv[message_filters::Synchronizer >, sensor_msgs::Image_ >, sensor_msgs::CameraInfo_ >, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType> >::disconnectAll()]+0x41): undefined reference to `message_filters::Connection::disconnect()'
CMakeFiles/vo_rgbd_node.dir/src/ros_server.cpp.o: In function `message_filters::Connection message_filters::SimpleFilter > >::registerCallback > const> const&>(boost::function > const> const&)> const&)':
ros_server.cpp:(.text._ZN15message_filters12SimpleFilterIN11sensor_msgs6Image_ISaIvEEEE16registerCallbackIRKN3ros12MessageEventIKS4_EEEENS_10ConnectionERKN5boost8functionIFvT_EEE[message_filters::Connection message_filters::SimpleFilter > >::registerCallback > const> const&>(boost::function > const> const&)> const&)]+0x9a): undefined reference to `message_filters::Connection::Connection(boost::function const&)'
CMakeFiles/vo_rgbd_node.dir/src/ros_server.cpp.o: In function `message_filters::Connection message_filters::SimpleFilter > >::registerCallback > const> const&>(boost::function > const> const&)> const&)':
ros_server.cpp:(.text._ZN15message_filters12SimpleFilterIN11sensor_msgs11CameraInfo_ISaIvEEEE16registerCallbackIRKN3ros12MessageEventIKS4_EEEENS_10ConnectionERKN5boost8functionIFvT_EEE[message_filters::Connection message_filters::SimpleFilter > >::registerCallback > const> const&>(boost::function > const> const&)> const&)]+0x9a): undefined reference to `message_filters::Connection::Connection(boost::function const&)'
collect2: ld returned 1 exit status

The contents of my CMakeLists.txt are as follows:

cmake_minimum_required(VERSION 2.8.3)
project(vo_rgbd)

find_package(catkin REQUIRED COMPONENTS
  cv_bridge
  geometry_msgs
  relative_nav_msgs
  roscpp
  sensor_msgs
)

find_package(Boost REQUIRED)
find_package(Eigen REQUIRED)
find_package(OpenCV REQUIRED)

catkin_package()

include_directories(
  include
  ${catkin_INCLUDE_DIRS}
  ${Boost_INCLUDE_DIRS}
  ${Eigne_INCLUDE_DIRS}
  ${OpenCV_INCLUDE_DIRS}
)

add_executable(vo_rgbd_node src/vo_rgbd_node.cpp src/ros_server.cpp src/pose_estimator.cpp)
add_dependencies(vo_rgbd_node relative_nav_msgs_generate_messages_cpp)
target_link_libraries(vo_rgbd_node
  ${catkin_LIBRARIES}
  ${Boost_LIBRARIES}
  ${Eigen_LIBRARIES}
  ${OpenCV_LIBRARIES}
)

Am I possibly missing something in my CMakeLists.txt that could be causing these errors, or might there be a different cause?

Thanks


Originally posted by dpkoch on ROS Answers with karma: 132 on 2013-12-05

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

In your CMakeLists.txt'sfind_package, you left off message_filters.


Originally posted by lindzey with karma: 1780 on 2013-12-05

This answer was ACCEPTED on the original site

Post score: 7


Original comments

Comment by dpkoch on 2013-12-05:
Ah, I had thought that message_filters was part of roscpp, but I now see that those are both separate packages within the ros_comm stack. Adding message_filters to the find_package(catkin REQUIRED COMPONENTS ...) and as a dependency in package.xml fixed the problem. Thanks!

Comment by smishra on 2013-12-10:
Also, you misspelled Eigen in the include directories

$\endgroup$

Your Answer

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