

The problem is that ROS creates the Makefiles and all other build artifacts in the build/ folder, but Eclipse expects the source files to be located within (or below) the folder where its project files are stored.įortunately, there is now a make target using a small script that circumvents this problem, by forcing CMake to create the project files in the directory of your package (and not the build/ folder). However, currently, a small hack is required for generating these project files in the right folder.

These project files then set up all include paths correctly, so that auto completion and code browsing will work out of the box. ĬMake can produce Eclipse project files automatically.

To make a nice launcher for Ubuntu, google for instructions or check e.g.

For convenience, you can also launch it by default like this by changing the Exec= line in your sktop launcher (which you need to create manually if you install Eclipse from the Eclipse website directly). This will make bash source ~/.bashrc, in which ROS has to be sourced and parameterized, and start that IDE. E.g., replace its command eclipse with bash -i -c "eclipse". Likewise, you can enhance your IDE's launcher icon to load your shells environment. Differently, CLion has a plugin allowing to automatically setup it, avoid the trouble to run CLion from a ROS-sourced shell. All IDEs might have a config for that and, for most IDEs, the easiest way is to run it from a ROS-sources shell. On ROS Answers there is a thread about Which IDE(s) do ROS developers use? that might have further hints not yet entered here.įor building and running ROS programs from inside IDEs, the ROS enviroment has to be set up.
