ROS中关于两个话题时间同步遇到的问题 message_filters
参考链接
CMakeFiles/imu_data.dir/src/imu_data.cpp.o:在函数‘message_filters::Synchronizer<message_filters::sync_policies::ApproximateTime<sensor_msgs::Imu_<std::allocator<void> >, sensor_msgs::Imu_<std::allocator<void> >, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType> >::disconnectAll()’中:
imu_data.cpp:(.text._ZN15message_filters12SynchronizerINS_13sync_policies15ApproximateTimeIN11sensor_msgs4Imu_ISaIvEEES6_NS_8NullTypeES7_S7_S7_S7_S7_S7_EEE13disconnectAllEv[_ZN15message_filters12SynchronizerINS_13sync_policies15ApproximateTimeIN11sensor_msgs4Imu_ISaIvEEES6_NS_8NullTypeES7_S7_S7_S7_S7_S7_EEE13disconnectAllEv]+0x43):对‘message_filters::Connection::disconnect()’未定义的引用
CMakeFiles/imu_data.dir/src/imu_data.cpp.o:在函数‘message_filters::Connection message_filters::Signal9<sensor_msgs::Imu_<std::allocator<void> >, sensor_msgs::Imu_<std::allocator<void> >, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType>::addCallback<boost::shared_ptr<sensor_msgs::Imu_<std::allocator<void> > const> const&, boost::shared_ptr<sensor_msgs::Imu_<std::allocator<void> > const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&>(boost::function<void (boost::shared_ptr<sensor_msgs::Imu_<std::allocator<void> > const> const&, boost::shared_ptr<sensor_msgs::Imu_<std::allocator<void> > const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&, boost::shared_ptr<message_filters::NullType const> const&)> const&)’中:
imu_data.cpp:(.text._ZN15message_filters7Signal9IN11sensor_msgs4Imu_ISaIvEEES4_NS_8NullTypeES5_S5_S5_S5_S5_S5_E11addCallbackIRKN5boost10shared_ptrIKS4_EESD_RKNS9_IKS5_EESH_SH_SH_SH_SH_SH_EENS_10ConnectionERKNS8_8functionIFvT_T0_T1_T2_T3_T4_T5_T6_T7_EEE[_ZN15message_filters7Signal9IN11sensor_msgs4Imu_ISaIvEEES4_NS_8NullTypeES5_S5_S5_S5_S5_S5_E11addCallbackIRKN5boost10shared_ptrIKS4_EESD_RKNS9_IKS5_EESH_SH_SH_SH_SH_SH_EENS_10ConnectionERKNS8_8functionIFvT_T0_T1_T2_T3_T4_T5_T6_T7_EEE]+0x184):对‘message_filters::Connection::Connection(boost::function<void ()> const&)’未定义的引用
CMakeFiles/imu_data.dir/src/imu_data.cpp.o:在函数‘message_filters::Connection message_filters::SimpleFilter<sensor_msgs::Imu_<std::allocator<void> > >::registerCallback<ros::MessageEvent<sensor_msgs::Imu_<std::allocator<void> > const> const&>(boost::function<void (ros::MessageEvent<sensor_msgs::Imu_<std::allocator<void> > const> const&)> const&)’中:
imu_data.cpp:(.text._ZN15message_filters12SimpleFilterIN11sensor_msgs4Imu_ISaIvEEEE16registerCallbackIRKN3ros12MessageEventIKS4_EEEENS_10ConnectionERKN5boost8functionIFvT_EEE[_ZN15message_filters12SimpleFilterIN11sensor_msgs4Imu_ISaIvEEEE16registerCallbackIRKN3ros12MessageEventIKS4_EEEENS_10ConnectionERKN5boost8functionIFvT_EEE]+0xb3):对‘message_filters::Connection::Connection(boost::function<void ()> const&)’未定义的引用
collect2: error: ld returned 1 exit status
imu_publish/CMakeFiles/imu_data.dir/build.make:113: recipe for target '/home/sunshine/catkin_imu_publish/devel/lib/imu_publish/imu_data' failed
make[2]: *** [/home/sunshine/catkin_imu_publish/devel/lib/imu_publish/imu_data] Error 1
CMakeFiles/Makefile2:907: recipe for target 'imu_publish/CMakeFiles/imu_data.dir/all' failed
make[1]: *** [imu_publish/CMakeFiles/imu_data.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
解决方法:
CMakeLists中添加message_filters具体改动如下
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
message_filters
)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)