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

Eclipse ROS fuerte

asked 2012-03-09 04:16:05 -0500

andreas gravatar image

updated 2014-01-28 17:11:37 -0500

ngrennan gravatar image

Hi guys,

I did exactly as described here http://www.ros.org/wiki/IDEs to import my ROS package to Eclipse. It compiles and runs without problems using the shell, but when using "Build Project" in Eclipse I only get:

/usr/bin/make all  
rospack: error while loading shared libraries: librospack.so: cannot open shared object file: No such file or directory 
Makefile:1: /cmake.mk: No such file or directory 
make: *** No rule to make target `/cmake.mk'.  Stop.

I don't see where the problem is. I checked the environment variables and they are fine.

Cheers, Andreas

edit retag flag offensive close merge delete

8 Answers

Sort by ยป oldest newest most voted
7

answered 2012-03-11 23:01:40 -0500

andreas gravatar image

When starting eclipse from the shell it worked. Otherwise it seemed to ignore the environment variables.

edit flag offensive delete link more

Comments

1

It makes sense as bash environment provides required environment varibles. It always works. The problem sometimes we face are indexer problems because indexer could not get the path to header files. This is easily resolved by adding path to relevant libraries.

prince gravatar image prince  ( 2012-03-13 17:57:54 -0500 )edit

it also worked for me, by launching from a terminal shell, but only on FUERTE projects, any ideas why?

Mario Garzon gravatar image Mario Garzon  ( 2012-06-14 01:44:44 -0500 )edit

I am still using diamondback and electric variants. The procedure always work fine for me. I can not offer justification for "why only for FUERTE projects ...". Also I had still not installed FUERTE, so my system still holds good for packages belonging to diamondback and electric variants.

prince gravatar image prince  ( 2012-06-18 01:34:48 -0500 )edit
1

answered 2012-03-10 18:32:42 -0500

updated 2012-03-10 18:33:49 -0500

Are you sure you set the relevant environment variables under (Project)Properties->C/C++ Make Project->Environment too?

As far as I know Eclipse may not reach environment variables, such as ROS_PACKAGE_PATH, ROS_ROOT, PYTHONPATH, PATH. And you should add these manually.

I'm sure there should be a more elegant solution so that they can be added automatically, but this worked for me every time.

edit flag offensive delete link more

Comments

Yes, the variables are all there PATH: /opt/ros/fuerte/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games ROS_ROOT: /opt/ros/fuerte/share/ros PYTHONPATH:/opt/ros/fuerte/lib/python2.6/dist-packages: and the package path.

andreas gravatar image andreas  ( 2012-03-11 22:54:45 -0500 )edit

Yes, the variables are all there PATH: /opt/ros/fuerte/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games ROS_ROOT: /opt/ros/fuerte/share/ros

andreas gravatar image andreas  ( 2012-03-11 22:54:47 -0500 )edit
2

answered 2012-03-13 18:29:21 -0500

Daniel Stonier gravatar image

We typically do not use eclipse projects in eclipse for ros. Makefile projects seem to work well and require almost no configuration.

  • Create your ros package (with roscreate-pkg)
  • Start eclipse from your ros shell (or in a bash script which calls setup.bash first).
  • Create a new empty makfile c++ project rooted at your project
  • Add 'set(CMAKE_VERBOSE_MAKEFILE TRUE)` in your CMakeLists.txt

The last point helps the indexer auto-find headers because it will track all the -I flag settings that ros's make target generates.

  • Finally build and clean using the default build/clean options.

You can then get creative by adding make targets in the ide for tests etc.

edit flag offensive delete link more
10

answered 2012-04-24 22:27:34 -0500

dgossow gravatar image

I had the same problem, changing my launcher to source setup.bash solved it.

Create a file called "Eclipse.desktop" and paste the below text into it, possibly replacing /opt/eclipse with wherever your Eclipse installation is located.

#!/usr/bin/env xdg-open

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=/opt/eclipse/icon.xpm
Exec=bash -c "source /opt/ros/fuerte/setup.bash; /opt/eclipse/eclipse"
Name[en_US]=Eclipse
Name=Eclipse
Icon=/opt/eclipse/icon.xpm
edit flag offensive delete link more

Comments

I can confirm such a configuration for launching Eclipse Indigo from an icon in Ubuntu 11.10 (Oneiric) and using ROS Fuerte gets rid of the problem.

ubuntuslave gravatar image ubuntuslave  ( 2012-04-25 11:01:48 -0500 )edit
6

bash -i -c eclipse is sufficient, it starts bash in interactive mode, which per definition sources the .bashrc, therefore being consistent with the ros distro and other configs defined there.

felix k gravatar image felix k  ( 2012-04-25 23:14:05 -0500 )edit
1

i think the bash -i -c eclipse is the easiest way to solve the problem!! thanks a lot

Mario Garzon gravatar image Mario Garzon  ( 2012-06-20 03:50:56 -0500 )edit

awesome answer, thanks!

georgebrindeiro gravatar image georgebrindeiro  ( 2013-01-28 07:58:55 -0500 )edit

Worked for me using bash -i -c eclipse on groovy. Thanks a lot!

cf.morales46 gravatar image cf.morales46  ( 2013-02-20 11:06:27 -0500 )edit
0

answered 2012-07-17 09:51:30 -0500

doml25 gravatar image

I encountered the same problem today using Eclipse Juno and ROS Fuerte on a Ubuntu system. I tried the solutions by dgossow and snorri, neither worked.

After reading some more about eclipse it hit me. The problem was that my eclipse juno install started with a workspace of ~/workspace but my ROS project was located in ~/ros_workspace. Once I restarted eclipse with a workspace of ros_workspace I was able to successfully build my project.

I believe this problem is unique to Eclipse Juno and ROS Fuerte, as I have another computer running Eclipse Indigo and ROS Electric without this problem.

edit flag offensive delete link more
0

answered 2012-07-23 09:32:56 -0500

khambuch gravatar image

Sorry - I cannot just leave comments on an answer, so this is directed to doml25.

Can you clarify what you mean? I am having the same issue with Fuerte and Juno - I created a package in /ros_workspace. Then I created a new Eclipse workspace in /ros_workspace. I imported the package into the Eclipse workspace, but still am getting "/cmake.mk: No such file or directory". I tried creating an Eclipse workspace within the already-created package space, but that failed even more miserably.

BTW - can anybody tell me where this commenting tool is?

edit flag offensive delete link more

Comments

OK - I have a commenting tool on my answer, but not on anyone else's.

khambuch gravatar image khambuch  ( 2012-07-23 09:33:25 -0500 )edit
3

answered 2012-07-23 10:52:51 -0500

Jon gravatar image

I had problems compiling ROS packages in Eclipse and found that adding the variable "LD_LIBRARY_PATH=/opt/ros/fuerte/lib" to the existing variables (ROS_PACKAGE_PATH, ROS_ROOT, PYTHONPATH, PATH) in "(Project)Properties->C/C++ Make Project->Environment" fixed the problem.

edit flag offensive delete link more
0

answered 2012-08-09 10:00:38 -0500

doml25 gravatar image

To clarify for khambuch: I used the solution provided by dgossow and the problem still persisted. At that time when I opened eclipse I used ~/workspace as my workspace while the Ros Project was in the directory ~/ros_workspace. I imported the project into eclipse without copying the files.

When I closed eclipse and re-opened it selecting ~/ros-workspace as my workspace and then importing the project into eclipse everything worked.

Eclipse saves its configuration inside the directory you choose for a workspace. By switching workspaces, I forced eclipse to establish a new configuration and then it worked as expected.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2012-03-09 04:16:05 -0500

Seen: 4,863 times

Last updated: Aug 09 '12