0
$\begingroup$

Rosanswers logo

Hi,

I use Eclipse to develop ROS applications and the "cmake eclipse-project" is very helpful for this purpose. But how do I start a .launch file out of this IDE? I made some experiments to define new "External tool configurations" but it does not work :-(

Is there anywhere a guideline or a tutorial for this topic?

Thanks for your help !


Originally posted by Poseidonius on ROS Answers with karma: 427 on 2011-05-23

Post score: 6


Original comments

Comment by Bart on 2011-05-24:
No, I haven't figured out how to use launch files in Eclipse. I activate a launch file for all of the external nodes from the command line and just launch the node I am debugging in Eclipse.

Comment by Asomerville on 2011-05-24:
I can't answer your question, but perhaps this person can: http://answers.ros.org/question/930/how-to-configure-eclipse-to-properly-load-a-plugin

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I take some minutes to find a solution for the problem :


Add a new file association for .launch files

  1. General -> Editors -> File Association ... add a new file type with the suffix *.launch assign the XML Editor to the new file type
  2. General -> Appearance -> Content Types ... roll off entry for TEXT in the menu go to XML and add *.launch

Now a .launch file will be opened by the XML Editor, if you have installed it.


In a second step you have to define a new external tool launch.

  1. Run -> External Tools -> External Tools Configurations
  2. choose PROGRAM and add a new lauch configuration by clicking the left button
  3. write a name like “Launch_ROS” to NAME
  4. integrate the path of roslaunch into LOCATION (usually something like ../ros/ros_comm/tools/roslaunch/bin/roslaunch)
  5. add as ARGUMENTS your ROS package name and .launch file name (for a more general use you can take ${project_name} ${resource_name}, but in this case your focus has to be on your launch file while starting !!!)
  6. then you can start the ROS application by Run -> External Tools -> Launch ROS

Anyone feels free to improve the chain !

Best wishes from Germany

Poseidonius


Originally posted by Poseidonius with karma: 427 on 2011-05-25

This answer was ACCEPTED on the original site

Post score: 9


Original comments

Comment by Asomerville on 2011-05-26:
Nice. I'm sure this well be helpful to many people.

Comment by chcorbato on 2012-09-18:
I'm trying to run roslaunch or roscore as an External Tool following this guide, but I get an error. Looks like you probably need to define for eclipse the ROS environment variables, I think I've done so, but then I get this error when running: /usr/bin/env: python: No such file or directory

Comment by Poseidonius on 2012-09-18:
Eclipse looks for a python interpreter in /usr/bin/env/ ... please check this outside Eclipse. Probably you add a wrong path.

Comment by chcorbato on 2012-09-20:
Outside Eclipse everything works. Could it be that Eclipse overwrites the path to the python interpreter? Maybe because of a default configuration for the PyDev plugin? Do you know which is the variable in Eclipse that defines the path?

Comment by Poseidonius on 2012-09-21:
Take a view on Window > Preferences > PyDev > Interpreter Python ... You can use "Auto Config" or declare the path manually.

Comment by harsha on 2012-10-17:
Thank you, @Poseidonius! This is really helpful.

Comment by aknirala on 2013-03-02:
Thanks @Poseidonius, I am able to run my launch file in eclipse. I was wondering is there a way I can debug it as well. That will be debugging in eclipse while running an external tool.

Comment by chrisLB on 2014-12-14:
I figured out a way of debugging nodes started with a launch config, see my blog post http://www.ceh-photo.de/blog/?p=899

Comment by DanielEckert on 2015-04-17:
Just had the following error, but found a solution: Traceback (most recent call last): File "/opt/ros/indigo/bin/roslaunch", line 34, in import roslaunch ImportError: No module named roslaunch Solution: Eclipse has to be launched from command line to have all environment variables.

Comment by Clack on 2016-01-25:
I'm new with eclipse and was really confused about what should I type in "Working Directory" and "Arguments". Can anyone give me some hints?

Comment by Abdul Mannan on 2016-11-14:
Thank you for excellent discussion. I have followed tutorial but I am facing a problem. I am getting error as follows

    Traceback (most recent call last):
File "/opt/ros/kinetic/bin/roslaunch", line 34, in <module> import roslaunch
    ImportError: No module named roslaunch

help plz

Comment by Nimrods on 2017-09-19:
I followed the instructions above and got the following error: 31m[demo_backpack_2d.launch] is neither a launch file in package [cartographer_ros] nor is [cartographer_ros] a launch file name[0m

from the shell it launches fine.

what am i missing?

Comment by TheMilkman on 2018-07-09:
I got the same error @Nimrods. Did you find a solution?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.