message_filters error

In function `::Synchronizer<message_filters::sync_policies::ExactTime<sensor_msgs::Image_<std::allocator<void> >, sensor_msgs::Image_<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()':
writeAssociateTXT.cpp:(.text._ZN15message_filters12SynchronizerINS_13sync_policies9ExactTimeIN11sensor_msgs6Image_ISaIvEEES6_NS_8NullTypeES7_S7_S7_S7_S7_S7_EEE13disconnectAllEv[_ZN15message_filters12SynchronizerINS_13sync_policies9ExactTimeIN11sensor_msgs6Image_ISaIvEEES6_NS_8NullTypeES7_S7_S7_S7_S7_S7_EEE13disconnectAllEv]+0x43): undefined reference to `message_filters::Connection::disconnect()'
CMakeFiles/writeAssociateTXT.dir/src/writeAssociateTXT.cpp.o: In function `message_filters::Connection message_filters::Signal9<sensor_msgs::Image_<std::allocator<v
In file included from /opt/ros/humble/include/message_filters/message_filters/sync_policies/approximate_time.h:52, from /home/nvidia/work/src/cluster3d/src/point_test.cpp:29: /opt/ros/humble/include/message_filters/message_filters/signal9.h: In instantiation of ‘message_filters::Connection message_filters::Signal9<M0, M1, M2, M3, M4, M5, M6, M7, M8>::addCallback(C&) [with C = const Objectcluster::Objectcluster(std::string)::<lambda(const auto:50&, const auto:51&, const auto:52&)>; M0 = sensor_msgs::msg::PointCloud2_<std::allocator<void> >; M1 = sensor_msgs::msg::PointCloud2_<std::allocator<void> >; M2 = sensor_msgs::msg::PointCloud2_<std::allocator<void> >; M3 = message_filters::NullType; M4 = message_filters::NullType; M5 = message_filters::NullType; M6 = message_filters::NullType; M7 = message_filters::NullType; M8 = message_filters::NullType]’: /opt/ros/humble/include/message_filters/message_filters/synchronizer.h:298:31: required from ‘message_filters::Connection message_filters::Synchronizer<Policy>::registerCallback(const C&) [with C = Objectcluster::Objectcluster(std::string)::<lambda(const auto:50&, const auto:51&, const auto:52&)>; Policy = message_filters::sync_policies::ApproximateTime<sensor_msgs::msg::PointCloud2_<std::allocator<void> >, sensor_msgs::msg::PointCloud2_<std::allocator<void> >, sensor_msgs::msg::PointCloud2_<std::allocator<void> > >]’ /home/nvidia/work/src/cluster3d/src/point_test.cpp:118:25: required from here /opt/ros/humble/include/message_filters/message_filters/signal9.h:280:40: error: no matching function for call to ‘message_filters::Signal9<sensor_msgs::msg::PointCloud2_<std::allocator<void> >, sensor_msgs::msg::PointCloud2_<std::allocator<void> >, sensor_msgs::msg::PointCloud2_<std::allocator<void> >, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType>::addCallback<const M0ConstPtr&, const M1ConstPtr&, const M2ConstPtr&, const M3ConstPtr&, const M4ConstPtr&, const M5ConstPtr&, const M6ConstPtr&, const M7ConstPtr&, const M8ConstPtr&>(std::_Bind_helper<false, const Objectcluster::Objectcluster(std::string)::<lambda(const auto:50&, const auto:51&, const auto:52&)>&, const std::_Placeholder<1>&, const std::_Placeholder<2>&, const std::_Placeholder<3>&, const std::_Placeholder<4>&, const std::_Placeholder<5>&, const std::_Placeholder<6>&, const std::_Placeholder<7>&, const std::_Placeholder<8>&, const std::_Placeholder<9>&>::type)’ 272 | return addCallback<const M0ConstPtr&, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 273 | const M1ConstPtr&, | ~~~~~~~~~~~~~~~~~~ 274 | const M2ConstPtr&, | ~~~~~~~~~~~~~~~~~~ 275 | const M3ConstPtr&, | ~~~~~~~~~~~~~~~~~~ 276 | const M4ConstPtr&, | ~~~~~~~~~~~~~~~~~~ 277 | const M5ConstPtr&, | ~~~~~~~~~~~~~~~~~~ 278 | const M6ConstPtr&, | ~~~~~~~~~~~~~~~~~~ 279 | const M7ConstPtr&, | ~~~~~~~~~~~~~~~~~~ 280 | const M8ConstPtr&>(std::bind(callback, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7, std::placeholders::_8, std::placeholders::_9)); 在Nvidia JOrin的 ros2 humble版本中,使用message filter代码出现如上报错,请帮忙解决. 代码调用如下: // 创建订阅者,传入空回调以禁用单条处理 112 left_sub_.subscribe(this, "/lidar/left/points"); 113 right_sub_.subscribe(this, "/lidar/right/points"); 114 rear_sub_.subscribe(this, "/lidar/rear/points"); 115 // 定义同步策略 116 sync_ = std::make_shared<message_filters::Synchronizer<SyncPolicy>>( 117 SyncPolicy(10), left_sub_, rear_sub_,right_sub_); 118 sync_->registerCallback( 119 [this](const auto& msg1, const auto& msg2, const auto& msg3) { 120 Callback(msg1, msg2, msg3); 121 });
06-01
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值