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

Changed ROS_PACKAGE_PATH - how do I repair this?

asked 2016-09-22 08:23:52 -0500

Zaunkönig gravatar image

Short version: I broke my ROS_PACKAGE_PATH, and now I don't know how to get my workspace to work again. I'm using rosbuild, not catkin, and jade; on ubuntu.

Long version:

I'm pretty much completely new to ros, and I have been working on an existing project from a coworker. This is using rosbuild instead of catkin, and the workspace consists of a number of different packages.

Now, I have been having a lot of trouble getting another package to work with this (which was by another coworker and was build using catkin...). I've been googling and trying things and ... somehow I think I changed my ROS_PACKAGE_PATH.
I think what I did is that I ran a source command that's intended for catkin, which broke the whole thing.
When I try to build any of the packages that worked before, it doesn't work since it tells me that this is not a package. When I echo ROS_PACKAGE_PATH I get /opt/ros/jade/share:/opt/ros/jade/stacks.

Now, I found this answer http://answers.ros.org/question/70435... , which has been helpful in at least understanding what the problem was. So I tried export ROS_PACKAGE_PATH=/user/this_project/this_workspace:/opt/ros/jade/share:/opt/ros/jade/stacks. This did work (in that it changed the package path), but I still can't compile anything, since it doesn't recognize any of the packages as packages. Which makes sense I guess, because the path I added is not the path of one package, but the path of the directory where all my packages are!
But how do I add the directory with all the packages? And how do I make it so that it recognizes new packages again in the future?

I also found a number of answers that mentioned adding the path of the workspace to a bashrc file. What is that? Where do I find it?
The folder that should be the workspace only has other folders, which are the different packages, and no files at all. I'm also not sure what exactly I should add to it if I could find it.

Bottom line: I have no idea what I'm doing here, and I'm getting a bit panicked.
I also don't have anybody I could ask (yesterday I asked another coworker to help me with the previous problem, who was involved in setting this whole project up - and we ended up breaking the whole thing altogether, so that I had to reset everything to the last git commit. And now I fear I've broken the whole ros installation!)
Anyway - I'd be very, very grateful if anybody can help me repair this mess!

edit retag flag offensive close merge delete

Comments

~/.bashrc is a file that bash runs every time you open a bash shell. It means adding the "export ROS_PACKAGE_PATH=..." command to ~/.bashrc, to make iso it run every time the terminal opened. If setting ROS_PACKAGE_PATH didn't fix your problem, adding it to your bashrc certainly won't fix it.

sloretz gravatar image sloretz  ( 2016-09-22 10:01:26 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2016-09-22 10:39:27 -0500

In general you first source the "global" setup, then the "workspace" setup:

source /opt/ros/indigo/setup.bash
source ~/your_catkin_ws/devel/setup.bash

The first command (re)sets the ROS_PACKAGE_PATH to your ROS distribution.

The latter command will prepend the "src" directory of the catkin workspace to the ROS_PACKAGE_PATH

As sloretz writes, if you put these commands in your ~/.bashrc, they are executed in every bash you start.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-09-22 08:23:52 -0500

Seen: 1,578 times

Last updated: Sep 22 '16