ros::package::getPath in eclipse

asked 2016-04-19 23:01:47 -0500

Nyu gravatar image

Hey guys,

i have some packages and nodes. I added the whole project to eclipse and it works like a charme. I followed the instructions and set up all pathes and dependencies.

But i notices some problems. When build with

catkin_make

in terminal and then run in eclipse everthing works perfekt.

But when building with eclipse, the following line gives an error while execution:

std::string path = ros::package::getPath("collision_detection") + "/shader/" + filename;

Error:

 [rospack] Error: package 'collision_detection' not found
 [librospack]: error while executing command

Are the any missing pathes in my environment? does anyone ever heard of that issue?

Thanks for your help

edit retag flag offensive close merge delete

Comments

How do you start eclipse? Try starting it with the command line. It seems that ros environmental variables are not loaded (i.e. .bashrc).

rastaxe gravatar image rastaxe  ( 2016-04-20 02:32:29 -0500 )edit

Hey thanks for your reply, i start eclipse within a terminal just calling "eclipse".

But i notices that i have to go to my catkin worksapce and run "source devel/setup.bash" before calling "eclipse". Then everything if sound correctly. THANKS

Nyu gravatar image Nyu  ( 2016-04-20 14:26:56 -0500 )edit

you can add it in the .bashrc file. This avoids to type it everytime.

rastaxe gravatar image rastaxe  ( 2016-04-21 02:15:24 -0500 )edit