0
$\begingroup$

Rosanswers logo

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/confusion-with-ros_package_path/, 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!


Originally posted by Zaunkönig on ROS Answers with karma: 3 on 2016-09-22

Post score: 0


Original comments

Comment by sloretz on 2016-09-22:
~/.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.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Felix Endres with karma: 6468 on 2016-09-22

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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