Ask Your Question

# Determine path of (sourced) catkin workspace?

After sourcing a Catkin workspace, what is the best way to determine the root path of the sourced workspace? I'm aware of catkin locate, however this doesn't have the desired behavior because it does not rely on the sourced workspace, but rather is working directory dependent, i.e.,

• it would not work from outside of the workspace path structure,
• and it does not work if you source workspace A but cd into workspace B etc.

How can I reliably determine the path of the workspace that has been sourced?

Ideally I'm looking a solution that doesn't require further processing like parsing $CMAKE_PREFIX_PATH, because I need access to the path in several places (scripts) and I'd like to avoid repeating the post processing logic in every place. edit retag close merge delete ## 2 Answers Sort by » oldest newest most voted Hello bluenote, the way I am usually doing it is by typing: echo$CMAKE_PREFIX_PATH in my terminal. It gives you all the sourced workspaces.

As a little side note, I would advise you to add the following line in your .bashrc file in order to know which workspaces are sourced every time you open a new terminal.

more

## Your Answer

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

Add Answer

## Stats

Asked: 2019-01-08 07:30:50 -0600

Seen: 2,307 times

Last updated: Oct 28 '20