ros/ros.h: No such file or directory
Hello, I'm new to ROS, and I have some trouble with my first file. When I include: #include "ros/ros.h" in VSCode, it says "ros/ros.h: No such file or directoy". I'm using ROS Melodic on Ubuntu 18.04.
Here is my CMakeLists.text:
cmake_minimum_required(VERSION 3.0.2)
project(helloworld)
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
)
catkin_package()
include_directories(
${catkin_INCLUDE_DIRS}
)
add_executable(hello src/helloworld.cpp)
target_link_libraries(hello ${catkin_LIBRARIES})
Package.xml:
<?xml version="1.0"?>
<package format="2">
<name>helloworld</name>
<version>0.0.0</version>
<description>The helloworld package</description>
<maintainer email="dell@todo.todo">dell</maintainer>
<license>TODO</license>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<build_export_depend>roscpp</build_export_depend>
<build_export_depend>rospy</build_export_depend>
<build_export_depend>std_msgs</build_export_depend>
<exec_depend>roscpp</exec_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>std_msgs</exec_depend>
<export>
<!-- Other tools can request additional information be placed here -->
</export>
</package>
C_cpp.properities.json:
{
"configurations": [
{
"browse": {
"databaseFilename": "",
"limitSymbolsToIncludedHeaders": true,
"path": [
"/opt/ros/melodic/include",
"/usr/include"
]
},
"includePath": [
"/opt/ros/melodic/include/**",
"/usr/include/**",
"/opt/ros/melodic/include"
],
"name": "ROS",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64",
"compilerPath": "/usr/bin/gcc"
}
],
"version": 4
}
tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "catkin_make:debug",
"type":"shell",
"command":"catkin_make",
"args": [
"-I", "/opt/ros/melodic/include",
"-I", "${workspaceFolder}"
],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"problemMatcher":"$msCompile"
}
]
}
And I have found "ros" directory using cd /opt/ros/melodic/include
and ls
. I'm quite confused now. Thanks for your help.