原因: ROS是按照c++03的编译方法进行的,而shared_ptr是新标准c++11中的内容 解决方法: 在CMakeLists.txt文件中指定使用c++11来编译: add_compile_options(-std=c++11) Compile as C++11, supported in ROS Kinetic and newer