ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Linking errors with message_filters in Hydro

asked 2013-12-05 18:10:47 -0600

dpkoch gravatar image

updated 2013-12-05 18:14:45 -0600

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<message_filters::sync_policies::approximatetime<sensor_msgs::image_<std::allocator<void> >, sensor_msgs::Image_<std::allocator<void> >, sensor_msgs::CameraInfo_<std::allocator<void> >, 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<message_filters::sync_policies::approximatetime<sensor_msgs::image_<std::allocator<void> >, sensor_msgs::Image_<std::allocator<void> >, sensor_msgs::CameraInfo_<std::allocator<void> >, 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<sensor_msgs::image_<std::allocator<void> > >::registerCallback<ros::messageevent<sensor_msgs::image_<std::allocator<void> > const> const&>(boost::function<void (ros::messageevent<sensor_msgs::image_<std::allocator<void=""> > const> const&)> const&)':
ros_server.cpp:(.text._ZN15message_filters12SimpleFilterIN11sensor_msgs6Image_ISaIvEEEE16registerCallbackIRKN3ros12MessageEventIKS4_EEEENS_10ConnectionERKN5boost8functionIFvT_EEE[message_filters::Connection message_filters::SimpleFilter<sensor_msgs::image_<std::allocator<void> > >::registerCallback<ros::messageevent<sensor_msgs::image_<std::allocator<void> > const> const&>(boost::function<void (ros::messageevent<sensor_msgs::image_<std::allocator<void=""> > const> const&)> const&)]+0x9a): undefined reference to `message_filters::Connection::Connection(boost::function<void ()=""> const&)'
CMakeFiles/vo_rgbd_node.dir/src/ros_server.cpp.o: In function `message_filters::Connection message_filters::SimpleFilter<sensor_msgs::camerainfo_<std::allocator<void> > >::registerCallback<ros::messageevent<sensor_msgs::camerainfo_<std::allocator<void> > const> const&>(boost::function<void (ros::messageevent<sensor_msgs::camerainfo_<std::allocator<void=""> > const> const&)> const&)':
ros_server.cpp:(.text._ZN15message_filters12SimpleFilterIN11sensor_msgs11CameraInfo_ISaIvEEEE16registerCallbackIRKN3ros12MessageEventIKS4_EEEENS_10ConnectionERKN5boost8functionIFvT_EEE[message_filters::Connection message_filters::SimpleFilter<sensor_msgs::camerainfo_<std::allocator<void> > >::registerCallback<ros::messageevent<sensor_msgs::camerainfo_<std::allocator<void> > const> const&>(boost::function<void (ros::messageevent<sensor_msgs::camerainfo_<std::allocator<void=""> > const> const&)> const&)]+0x9a): undefined reference to `message_filters::Connection::Connection(boost::function<void ()=""> 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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
7

answered 2013-12-05 18:48:15 -0600

lindzey gravatar image

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

edit flag offensive delete link more

Comments

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!

dpkoch gravatar image dpkoch  ( 2013-12-05 19:17:11 -0600 )edit
1

Also, you misspelled Eigen in the include directories

smishra gravatar image smishra  ( 2013-12-10 07:57:19 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2013-12-05 18:10:47 -0600

Seen: 3,669 times

Last updated: Dec 05 '13