当前位置:   article > 正文

ros中message_filters编译问题_error: assignment of member 鈥榞eometry_msgs::vector

error: assignment of member 鈥榞eometry_msgs::vector3_ >

ros中message_filters编译问题

参考链接: link.
平台 ros melodic

问题描述

CMakeFiles/avoidance_sub.dir/src/avoidance_sub.cpp.o: In function message_filters::Synchronizer<message_filters::sync_policies::ApproximateTime<geometry_msgs::Vector3Stamped_<std::allocator<void> >, geometry_msgs::Vector3Stamped_<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()': avoidance_sub.cpp:(.text._ZN15message_filters12SynchronizerINS_13sync_policies15ApproximateTimeIN13geometry_msgs15Vector3Stamped_ISaIvEEES6_NS_8NullTypeES7_S7_S7_S7_S7_S7_EEE13disconnectAllEv[_ZN15message_filters12SynchronizerINS_13sync_policies15ApproximateTimeIN13geometry_msgs15Vector3Stamped_ISaIvEEES6_NS_8NullTypeES7_S7_S7_S7_S7_S7_EEE13disconnectAllEv]+0x43): undefined reference tomessage_filters::Connection::disconnect()’
CMakeFiles/avoidance_sub.dir/src/avoidance_sub.cpp.o: In function message_filters::Connection message_filters::Signal9<geometry_msgs::Vector3Stamped_<std::allocator<void> >, geometry_msgs::Vector3Stamped_<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<geometry_msgs::Vector3Stamped_<std::allocator<void> > const> const&, boost::shared_ptr<geometry_msgs::Vector3Stamped_<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<geometry_msgs::Vector3Stamped_<std::allocator<void> > const> const&, boost::shared_ptr<geometry_msgs::Vector3Stamped_<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&)': avoidance_sub.cpp:(.text._ZN15message_filters7Signal9IN13geometry_msgs15Vector3Stamped_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_filters7Signal9IN13geometry_msgs15Vector3Stamped_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]+0x191): undefined reference tomessage_filters::Connection::Connection(boost::function<void ()> const&)’
CMakeFiles/avoidance_sub.dir/src/avoidance_sub.cpp.o: In function message_filters::Connection message_filters::SimpleFilter<geometry_msgs::Vector3Stamped_<std::allocator<void> > >::registerCallback<ros::MessageEvent<geometry_msgs::Vector3Stamped_<std::allocator<void> > const> const&>(boost::function<void (ros::MessageEvent<geometry_msgs::Vector3Stamped_<std::allocator<void> > const> const&)> const&)': avoidance_sub.cpp:(.text._ZN15message_filters12SimpleFilterIN13geometry_msgs15Vector3Stamped_ISaIvEEEE16registerCallbackIRKN3ros12MessageEventIKS4_EEEENS_10ConnectionERKN5boost8functionIFvT_EEE[_ZN15message_filters12SimpleFilterIN13geometry_msgs15Vector3Stamped_ISaIvEEEE16registerCallbackIRKN3ros12MessageEventIKS4_EEEENS_10ConnectionERKN5boost8functionIFvT_EEE]+0xba): undefined reference tomessage_filters::Connection::Connection(boost::function<void ()> const&)’
collect2: error: ld returned 1 exit status
avoidance/CMakeFiles/avoidance_sub.dir/build.make:113: recipe for target ‘/home/ljn/ROS/avoidance/catkin_ws/devel/lib/avoidance/avoidance_sub’ failed
make[2]: *** [/home/ljn/ROS/avoidance/catkin_ws/devel/lib/avoidance/avoidance_sub] Error 1
CMakeFiles/Makefile2:1592: recipe for target ‘avoidance/CMakeFiles/avoidance_sub.dir/all’ failed
make[1]: *** [avoidance/CMakeFiles/avoidance_sub.dir/all] Error 2
Makefile:140: recipe for target ‘all’ failed
make: *** [all] Error 2
Invoking “make -j4 -l4” failed

解决方法

在CMakeLists.txt中添加

find_package( catkin REQUIRED COMPONENTS
	 ...
	message_filters
)
  • 1
  • 2
  • 3
  • 4

在package.xml文件中添加相关依赖

find_package( catkin REQUIRED COMPONENTS
	<build_depend>message_filters</build_depend>
	<build_export_depend>message_filters</build_export_depend>
	<exec_depend>message_filters</exec_depend>
)
  • 1
  • 2
  • 3
  • 4
  • 5
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/540493
推荐阅读
相关标签
  

闽ICP备14008679号