Removing catkin workspace

I've created 2 catkin workspaces, then I decided to rm -rf one of them. It seems like there should be a better way to remove it because some environment variables are lingering around with that path, namely $CMAKE_PREFIX_PATH. 1. Where does ROS set$CMAKE_PREFIX_PATH so I can remove any references to it now that I've deleted it?

2. Is there a proper way to delete a catkin workspace so that all environmental variables are cleaned up?

Answer: I 'sourced' both my devel workspace 'setup.bash' and the groovy installation 'setup.bash', when I removed that line from my .bashrc (as the commenter said) CMAKE_PREFIX_PATH was no longer set.

Deleting build and develop and simply calling catkin_make again, then sourcing my workspace only in .bashrc fixed it.

Thank you! :D

edit retag close merge delete

If the problem persists after a reboot, the problem is probably in your ~/.bashrc. Can you post the contents of that file?

( 2013-06-26 06:32:47 -0600 )edit

Sort by » oldest newest most voted

This stuff can get very confusing and cause serious errors.

The general recommendation when switching workspaces is always to open a new shell, and source the relevant setup.bash. For catkin, that is normally in devel/ subdirectory.

UPDATE: If you are sourcing the correct setup.bash in your ~/.bashrc and creating a new shell (or rebooting) does not work, there must have been something wrong when you originally created your workspace. The usual error is having forgetten to source the appropriate lower-level setup.bash before running catkin_make.

That is an easy mistake to make. When I find myself in that situation, I do one of these recovery procedures:

• Create a new workspace, more carefully this time.
• Delete everything but the src/ subdirectory, source the correct dependency, then re-run catkin_make or catkin_init_workspace.

There may be other solutions, but I find that hacking around in the various generated files just creates frustration and wastes time.

more

Well, I've already done that but when I reboot the the CMAKE_PREFIX_PATH persists, I'd really like to clean that up, do you know how?

( 2013-06-26 06:20:34 -0600 )edit

I you have a CMAKE_PREFIX_PATH after reboot then you are setting it in your ~/.bashrc most likely. Look in that file to see if you are source'ing any setup.bash files. If you are, delete or comment that line out and open a new terminal. Rebooting is not necessary, just open a new terminal.

( 2013-06-26 07:17:12 -0600 )edit

I am sourcing 2 files in my .bashrc, 1 is /opt/ros/groovy/setup.bash the other is my current catkin_workspace ~/ros_ws/devel/setup.bash.. I'll try removing these when I get home and see if this solves my issue

( 2013-06-26 07:47:30 -0600 )edit

If things were set up correctly, the workspace should source /opt/ros/groovy/setup.sh for you.

( 2013-06-26 07:50:30 -0600 )edit

For those using catkin tools, an easy solution is: catkin clean --deinit at the directory of your workspace.

more

Stats

Seen: 12,655 times

Last updated: Jun 26 '13