Hi, to export the ros variables in eclipse and compile, I use a small script, let's call it "eclipsemake": #!/bin/bash source ~/.bashrc.ros roscd $1 make where .bashrc.ros contains all the environment variables that need to be set for ros. Then I add this in the project properties under "C/C++ Build" as "custom build command": /path/to/eclipsemake your_package_name (If eclipsemake is in the home-directory, the ~ somehow didn't work ...) Best, Markus From: ros-users-bounces@code.ros.org [ros-users-bounces@code.ros.org] on behalf of Daniel Stonier [d.stonier@gmail.com] Sent: Friday, October 22, 2010 1:04 To: User discussions Subject: Re: [ros-users] Eclipse projects Oops, the eclipse one was quite simple. It was the gnome-terminal one I was thinking of - it's a little more difficult to get started with the appropriate variables exported. If you've only got one ros installation, then of course you can just export the setup in your .profile and eclipse will immediately grab the environment variables (you can check by clicking windows->preferences->build->environment->select - you should be able to see ROS_ROOT in the list, no need to actually select it, just verify that it is there). However if you start to layout out multiple installations (like we do here, one for each robot), then the following is very convenient as you just set a different path for each eclipse-ros starter. I usually put this script in my path and then create new menu items in my gnome/kde/e17. #!/bin/bash # This only needed by ubuntu karmic and eclipse ganymede(?), otherwise comment out # export GDK_NATIVE_WINDOWS=1 source /opt/ros/setup.sh # Add the full path if eclipse is not in your PATH exec eclipse On 22 October 2010 01:52, Aditya Gadre wrote: Hi Daniel, Thank you very much for your email. I think I will follow your suggestion of manually creating an eclipse project. That way my sources will remain clutter free. I would much appreciate if you could give me the script you use to start eclipse. Thanks again! - Aditya On 10/21/2010 11:22 AM, Daniel Stonier wrote: Oh, only gotcha with the method I outlines is that you have to start your eclipse from a shell with all the usual ROS variables being exported...that or either fire up a script which does that for you so you can put desktop icons on your panels (I have one I can paste here if you need). On 22 October 2010 00:20, Daniel Stonier wrote: I actually prefer just using makefile projects within eclipse. - create a new ros package - in eclipse: - create anew, empty Makefile project. Turn off the default location and choose your ros package location instead. - make sure you add the line 'set(CMAKE_VERBOSE_MAKEFILE true)' to your CMakeLists.txt, this helps eclipses' c++ indexer. - build project, clean project then both work as you expect...with a parallel build directory. Of course, that will only let you make the individual project. But i typically do an rosmake for the project now and then (i.e. when I download or other packages have changed alot). Usually while developing all you need is to make the single package. The above also has the advantage in that you don't have any problems with the .project, .cproject files getting shared amongst your team. That and the fact that you can make/rosmake from a shell and build from inside eclipse without it getting mucked up. I should probably add some notes about this to the wiki. On 21 October 2010 11:31, Aditya Gadre wrote: I have a question about "make eclipse-project" command. I created a package which has a number of CMakeLists.txt files as follows - gps (package_dir) - CMakeLists.txt ( with add_subdirectory(src) ) - src (directory) - CMakeLists.txt (with add_subdirectory(gps) and add_subdirectory(node)) - gps (directory) - CMakeLists.txt (with add_library) - node (directory) - CMakeLists.txt (with add_executable) When I run "rosmake gps", all CMakeFiles directories and other related CMake files are under the "build" directory as expected for an out-of-source build. However, when I run "make eclipse-project", then CMakeFiles directories, along with other CMake files are created in directories that contain CMakeLists.txt files. The ROS wiki mentions the work-around used by "make eclipse-project". Are all CMakeFiles folders created outside the build directory a result of this work-around? Thanks, - Aditya _______________________________________________ ros-users mailing list ros-users@code.ros.org https://code.ros.org/mailman/listinfo/ros-users -- Phone : +82-10-5400-3296 (010-5400-3296) Home: http://snorriheim.dnsdojo.com/ Yujin Robot: http://www.yujinrobot.com/ Embedded Control Libraries: http://snorriheim.dnsdojo.com/redmine/wiki/ecl -- Phone : +82-10-5400-3296 (010-5400-3296) Home: http://snorriheim.dnsdojo.com/ Yujin Robot: http://www.yujinrobot.com/ Embedded Control Libraries: http://snorriheim.dnsdojo.com/redmine/wiki/ecl _______________________________________________ ros-users mailing list ros-users@code.ros.org https://code.ros.org/mailman/listinfo/ros-users _______________________________________________ ros-users mailing list ros-users@code.ros.org https://code.ros.org/mailman/listinfo/ros-users -- Phone : +82-10-5400-3296 (010-5400-3296) Home: http://snorriheim.dnsdojo.com/ Yujin Robot: http://www.yujinrobot.com/ Embedded Control Libraries: http://snorriheim.dnsdojo.com/redmine/wiki/ecl