Should 'catkin_make' always precede a 'launch' operation?

In the course entitled “Learn Robotics from Zero”, Chapter 2 (Basic Concepts), a ROS launch is used immediately after creating the Python program “”. Why is a ‘catkin_make’ operation not needed before this is done? Doesn’t the Python program have to be compiled (or interpreted)?

Not necessarily. Catkin_make sets up a whole ROS package. You’d need it to use at some point to use “rosrun” for example, since you have to give a package name. But if ROS is already running (which it is in the learning environment) and all you want to do is run a simple Python program with “python”, then you don’t need to do that (as the example shows). The Python virtual machine can run the program just fine, and the import of rospy lets the program interact with ROS.

Also, once you’ve run catkin_make, you don’t need to run it again as you add additional Python programs and launch files to your package (except in certain circumstances).

If you’re writing programs in C++ things are a little different, and you might need to run catkin_make more often to compile your programs.

Hope that helps.

1 Like