ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

@Dalsallum Welcome to the forum!

To answer your question you will need to understand several things:

  1. If you want your code to interat with any ROS utility or tool you will need to include you code inside a node inside a catkin package in your workspace src folder. Take into account that you can execute your script in any location of your machine, however it is advisable to implement it inside a package in order to let ROS know the location of the script and several enviromental things. If you want to know more about this topic, there is a nice tutorial about that here.
  2. Once your code is inside a node, you will need to configure your enviroment first and then use catkin_make once to let ROS process all your packages in you src folder and set up important enviromental variables.
  3. Since you are using python (rospy), you do not need to compile every time you change your node because python is interpreted (it needs and interpreter not a compiler). Hence, you can change any line in your script and still be able to execute it without the need of a catkin_make. However if you are working with C++ (roscpp), you will need to compile (catkin_make) every time to generate the executables, libs etc. with the changes performed.

If you have doubts regarding rospy you can check the official tutorials page, that also exists for roscpp.

Hope this solve all your doubts.

Regards.