error: ‘plus’ is not a member of ‘pcl::traits’

报错:

error: ‘plus’ is not a member of ‘pcl::traits’

解决办法:

在CMakeLists.txt里增加

set(CMAKE_CXX_STANDARD 14)

ROS使用自定义全局路径规划器编译时报错 ‘xxx’ is not a member of ‘pcl::traits’的解决方法_慕羽★的博客-CSDN博客

2022.12.30更新:

如果上述的解决办法还是报错,我遇到一个是ros开发包只包含可pcl_ros,如下:

catkin_package(
        CATKIN_DEPENDS
        roscpp
        rosconsole
        std_msgs
        sensor_msgs
        glviewer
        rosinterface
        cv_bridge
        pcl_ros
        image_transport
        autoware_msgs
)

我分析的原因可能是没有把pcl库包含进来,我通过在cmakelists.txt增加以下代码即可解决:

find_package(PCL REQUIRED)
。。。。
include_directories(
        ${PCL_INCLUDE_DIRS}
        CalibrationToolkit
        nodes/calibration_toolkit
        ${catkin_INCLUDE_DIRS}
        ${LIBXML2_INCLUDE_DIR}
        ${OpenCV_INCLUDE_DIRS}
        ${CMAKE_CURRENT_SOURCE_DIR}
        ${CMAKE_CURRENT_BINARY_DIR}
        ${GLUT_INCLUDE_DIRS}
)
。。。。
target_link_libraries(calibrationtoolkit
            ${PCL_LIBRARIES}
            ${catkin_LIBRARIES}
            ${OpenCV_LIBS}
            ${OPENGL_LIBRARIES}
            ${GLUT_LIBRARY}
            Qt5::Core
            Qt5::Widgets
            Qt5::OpenGL
            nlopt
            )

你可能感兴趣的:(工程环境搭建,自动驾驶,人工智能)