首先生成build中的compile文件,它会包含所有头文件的地址。
catkin_make -DCMAKE_EXPORT_COMPILE_COMMANDS=Yes
再在.vscode的c_cpp_properties.json文件中添加路径
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64",
"compileCommands": "${workspaceFolder}/build/compile_commands.json"
}
],
"version": 4
}
这样的话看看代码基本没问题了,头文件都能识别,编译的话我还是习惯于终端编译。
ros::showMasterStatus
这个命令可以显示出当前ROS通信系统的详细信息,包括当前的所有话题,已经话题的所有发布者和订阅者