C/C++教程

Ubuntu20.04+ROS Noetic下编译Ti mmWave Ros Driver出错

本文主要是介绍Ubuntu20.04+ROS Noetic下编译Ti mmWave Ros Driver出错,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

按照Ti官方的指南编译他们提供的ROS Driver,出现了如下错误

In file included from /usr/include/pcl-1.10/pcl/io/file_io.h:41,
                 from /usr/include/pcl-1.10/pcl/io/pcd_io.h:44,
                 from /opt/ros/noetic/include/pcl_conversions/pcl_conversions.h:70,
                 from /opt/ros/noetic/include/pcl_ros/point_cloud.h:9,
                 from /home/psy/mmwave_ti_ros/ros_driver/src/ti_mmwave_rospkg/include/DataHandlerClass.h:14,
                 from /home/psy/mmwave_ti_ros/ros_driver/src/ti_mmwave_rospkg/src/DataHandlerClass.cpp:1:
/usr/include/pcl-1.10/pcl/common/io.h:65:9: note: candidate: ‘pcl::getFieldIndex(const pcl::PCLPointCloud2&, const string&)::<lambda(int)>’
   65 |         [&field_name](const auto field) { return field.name == field_name; });
      |         ^
/usr/include/pcl-1.10/pcl/common/io.h:65:9: note:   no known conversion for argument 1 from ‘const pcl::PCLPointField’ to ‘int’
make[2]: *** [ti_mmwave_rospkg/CMakeFiles/mmwave.dir/build.make:63:ti_mmwave_rospkg/CMakeFiles/mmwave.dir/src/mmWaveDataHdl.cpp.o] 错误 1
make[2]: *** 正在等待未完成的任务....
make[2]: *** [ti_mmwave_rospkg/CMakeFiles/mmwave.dir/build.make:89:ti_mmwave_rospkg/CMakeFiles/mmwave.dir/src/DataHandlerClass.cpp.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:2243:ti_mmwave_rospkg/CMakeFiles/mmwave.dir/all] 错误 2

在RoboSence的ros_rsLiDar的issue中找到了类似的问题

问题
Point Cloud Library-1.10 需要用C++14标准进行编译
解决方法
修改ti_mmwave_rospkg中的CMakeList.txt

add_definitions(-std=c++11)

修改为

add_definitions(-std=c++14)
这篇关于Ubuntu20.04+ROS Noetic下编译Ti mmWave Ros Driver出错的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!