ros/ros.h: No such file or directory after trying tutorial
I've gone through the c++ talker listener tutorials, copy and pasted the code and CMake files into the pkg directory and both nodes worked just fine.
I've now tried to test how well I understand the concept and have make my own package called delete_me
. I have one executable called tester.cpp
but catkin_make will error with ros/ros.h: No such file or directory
. the following is my code and make files
tester.cpp
#include "ros/ros.h"
#include "std_msgs/String.h"
#include <sstream>
int main(int argc, char **argv)
{
ros::init(argc, argv, "tester");
ros::NodeHandle n;
ROS_INFO("Hello");
ros::spinOnce();
return 0;
}
CMakeList.txt
cmake_minimum_required(VERSION 3.0.2)
project(delete_me)
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
)
catkin_package(
)
add_executable(tester src/tester.cpp)
target_link_libraries(tester ${catkin_LIBRARIES})
I would expect to see the onetime ros log of "Hello" then the node would end. My guess is the CMakeLists.txt file is missing something. Any advice on understanding what I'm missing would be very much appreciated.
Also if it helps I'm using Windows 10 - WSL Ubuntu 20.04 ROS-noetic