Running C++ ROS code outside package
I have a C++ program built without using ROS in mind. Now I want to be able to plot stuff from this program using ROS messages to rviz. I have troubles compiling and need some help!
I know that you can run a python ROS script without doing
rosrun package node
but simply
python my_ros_program.py
and still be able to send ros messages. I want to be able to be able to compile and run my c++ program like that without the extra effort of creating a package and a catkin workspace.
I am a c++ newbie but my guess is that I only need to put the correct inludes inside my CMakeLists.txt-file.
How do I run my program stand-alone but using ROS messages?
Why would you want to do that? To compile your node you need tons of dependencies that catkin is managing. IMO it would be a nightmare otherwise.
You will need the correct includes and linking directives in the CMakeLists.txt. Which these are is precisely, what catkin figures out for you. It really just does a quite cmake-y find_package like any other cmake library. There is considerable less effort in setting up a catkin workspace.
Ok that's annoying but I'm going to take your advice! Thanks.
@esillen You will see that having a minimum structure in your folder allows to implement many other things much easier :)