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 });