Ericsii / FAST_LIO_ROS2

ROS2 version of FAST_LIO2. Welcome to the technical communication discord server discord: https://discord.gg/U3B65MGH8m
GNU General Public License v2.0
128 stars 31 forks source link

按照READEME文档里的步骤编译Fast-LIO-ROS2 报错 #16

Closed Rorschach7771 closed 1 month ago

Rorschach7771 commented 1 month ago

在编译之前以及source过livox的驱动了,报错信息如下 /home/mio-3012/ws_livox/src/FAST_LIO/src/laserMapping.cpp:945:181: required from here /opt/ros/foxy/include/rclcpp/create_service.hpp:43:3: error: no matching function for call to ‘rclcpp::AnyServiceCallback::set(std::_Bind<void (LaserMappingNode::(LaserMappingNode, std::_Placeholder<1>, std::_Placeholder<2>))(std::shared_ptr<const std_srvs::srv::TriggerRequest<std::allocator > >, std::shared_ptr<std_srvs::srv::TriggerResponse<std::allocator > >)>)’ 43 | any_service_callback.set(std::forward(callback)); | ^~~~~~~~ In file included from /opt/ros/foxy/include/rclcpp/service.hpp:28, from /opt/ros/foxy/include/rclcpp/callback_group.hpp:25, from /opt/ros/foxy/include/rclcpp/any_executable.hpp:20, from /opt/ros/foxy/include/rclcpp/memory_strategy.hpp:24, from /opt/ros/foxy/include/rclcpp/memory_strategies.hpp:18, from /opt/ros/foxy/include/rclcpp/executor_options.hpp:20, from /opt/ros/foxy/include/rclcpp/executor.hpp:33, from /opt/ros/foxy/include/rclcpp/executors/multi_threaded_executor.hpp:26, from /opt/ros/foxy/include/rclcpp/executors.hpp:21, from /opt/ros/foxy/include/rclcpp/rclcpp.hpp:146, from /home/mio-3012/ws_livox/src/FAST_LIO/src/laserMapping.cpp:45: /opt/ros/foxy/include/rclcpp/any_service_callback.hpp:67:8: note: candidate: ‘template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<std_srvs::srv::TriggerRequest<std::allocator > >, std::shared_ptr<std_srvs::srv::TriggerResponse<std::allocator > >)> >::value, void>::type > void rclcpp::AnyServiceCallback::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr, std::shared_ptr)> >::value>::type = ; ServiceT = std_srvs::srv::Trigger]’ 67 | void set(CallbackT callback) | ^~~ /opt/ros/foxy/include/rclcpp/any_service_callback.hpp:67:8: note: template argument deduction/substitution failed: /opt/ros/foxy/include/rclcpp/any_service_callback.hpp:65:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’ 65 | >::type = nullptr | ^~~ /opt/ros/foxy/include/rclcpp/any_service_callback.hpp:81:8: note: candidate: ‘template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr, std::shared_ptr<std_srvs::srv::TriggerRequest<std::allocator > >, std::shared_ptr<std_srvs::srv::TriggerResponse<std::allocator > >)> >::value, void>::type > void rclcpp::AnyServiceCallback::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr, std::shared_ptr, std::shared_ptr)> >::value>::type = ; ServiceT = std_srvs::srv::Trigger]’ 81 | void set(CallbackT callback) | ^~~ /opt/ros/foxy/include/rclcpp/any_service_callback.hpp:81:8: note: template argument deduction/substitution failed: /opt/ros/foxy/include/rclcpp/any_service_callback.hpp:79:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’ 79 | >::type = nullptr | ^~~ make[2]: [CMakeFiles/fastlio_mapping.dir/build.make:63:CMakeFiles/fastlio_mapping.dir/src/laserMapping.cpp.o] 错误 1 make[1]: [CMakeFiles/Makefile2:124:CMakeFiles/fastlio_mapping.dir/all] 错误 2 make: *** [Makefile:141:all] 错误 2

Failed <<< fast_lio [24.4s, exited with code 2]

Summary: 1 package finished [27.1s] 1 package failed: fast_lio 2 packages had stderr output: fast_lio livox_ros_driver2

Ericsii commented 1 month ago

foxy中service的callback函数没法使用std::bind传入,可以使用原仓库的这个PR版本支持foxy https://github.com/hku-mars/FAST_LIO/pull/334