Ask Your Question
0

[rospack] Error: stack/package roscpp not found

asked 2015-07-27 00:19:08 -0600

Asaad Irfan gravatar image

updated 2015-07-27 01:47:29 -0600

gvdhoorn gravatar image

I'm using Ubuntu 12.04 and ROS Hydro.

While creating a package in one of my directories, i wrote the following line of code to the terminal (because i was facing the problem mentioned in here):

export ROS_PACKAGE_PATH=~/<PATH TO THE DIRECTORY I WAS MAKING THE PACKAGE IN>

After adding this line, i'm facing this error:

[rospack] Error: stack/package roscpp not found

whenever i type the following code:

rospack find roscpp

Although the package roscpp is still present at this path: /opt/ros/hydro/share$

What is causing this issue? How do i solve it?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-07-27 01:52:45 -0600

gvdhoorn gravatar image

What is causing this issue?

With:

export ROS_PACKAGE_PATH=~/<PATH TO THE DIRECTORY I WAS MAKING THE PACKAGE IN>

you are overwriting the ROS_PACKAGE_PATH variable, so that it only points to ~/<PATH TO THE DIRECTORY I WAS MAKING THE PACKAGE IN>. The default paths needed for ROS to function are now gone, hence the error message you received.

If you really must change/update ROS_PACKAGE_PATH manually, be sure to only add to it. Something like:

export ROS_PACKAGE_PATH=/home/user/path/to/dir/i/was/making/pkg/in:$ROS_PACKAGE_PATH

This inserts the new path and copies in the old entries.

How do i solve it?

Depending on how you setup your system, simply opening a new terminal could restore the old ROS_PACKAGE_PATH values. Alternatively, source /opt/ros/hydro/setup.bash should also set the variable to its default value.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-07-27 00:19:08 -0600

Seen: 1,065 times

Last updated: Jul 27 '15