Read data from txt file on c++
Hi everybody,
I have a package with a c++ source file (source.cpp) that reads data from a txt (filename.txt). I compile the package through "catkin_make package" and everything goes fine. What should I do to make the executable to find the txt file when I run "rosrun package executable"?
Edit: In the CMakeLists.txt I do "add_executable (executable source.cpp)". The filename.txt is in the same directory as source.cpp. How do I add the file name?
Thank you.