In file included from /opt/ros/melodic/include/ros/subscription_callback_helper.h:35:0,
from /opt/ros/melodic/include/ros/subscriber.h:33,
from /opt/ros/melodic/include/ros/node_handle.h:33,
from /opt/ros/melodic/include/ros/ros.h:45,
from /home/szx/uwb-vio-fusion-slam/src/uwb-vio-fusion-slam-master/getscale/src/getscale_node.cpp:1:
/opt/ros/melodic/include/ros/parameter_adapter.h: In instantiation of ‘static ros::ParameterAdapter<M>::Parameter ros::ParameterAdapter<M>::getParameter(const Event&) [with M = nlink_parser::LinktrackAnchorframe0_<std::allocator<void> >&; ros::ParameterAdapter<M>::Parameter = nlink_parser::LinktrackAnchorframe0_<std::allocator<void> >&; ros::ParameterAdapter<M>::Event = ros::MessageEvent<const nlink_parser::LinktrackAnchorframe0_<std::allocator<void> > >; typename boost::remove_reference<typename boost::remove_const<M>::type>::type = nlink_parser::LinktrackAnchorframe0_<std::allocator<void> >]’:
/opt/ros/melodic/include/ros/subscription_callback_helper.h:144:48: required from ‘void ros::SubscriptionCallbackHelperT<P, Enabled>::call(ros::SubscriptionCallbackHelperCallParams&) [with P = nlink_parser::LinktrackAnchorframe0_<std::allocator<void> >&; Enabled = void]’
/home/szx/uwb-vio-fusion-slam/src/uwb-vio-fusion-slam-master/getscale/src/getscale_node.cpp:472:1: required from here
/opt/ros/melodic/include/ros/parameter_adapter.h:78:30: error: binding reference of type ‘ros::ParameterAdapter<nlink_parser::LinktrackAnchorframe0_<std::allocator<void> >&>::Parameter {aka nlink_parser::LinktrackAnchorframe0_<std::allocator<void> >&}’ to ‘const nlink_parser::LinktrackAnchorframe0_<std::allocator<void> >’ discards qualifiers
return *event.getMessage();
^
uwb-vio-fusion-slam-master/getscale/CMakeFiles/getscale.dir/build.make:75: recipe for target 'uwb-vio-fusion-slam-master/getscale/CMakeFiles/getscale.dir/src/getscale_node.cpp.o' failed
make[2]: *** [uwb-vio-fusion-slam-master/getscale/CMakeFiles/getscale.dir/src/getscale_node.cpp.o] Error 1
CMakeFiles/Makefile2:2865: recipe for target 'uwb-vio-fusion-slam-master/getscale/CMakeFiles/getscale.dir/all' failed
make[1]: *** [uwb-vio-fusion-slam-master/getscale/CMakeFiles/getscale.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j16 -l16" failed
定义话题订阅subscribe函数中的回调函数时,参数没有加上const 关键字