Ask Your Question

Two Different Catkin Workspaces

asked 2018-09-30 13:34:38 -0600

gktg1514 gravatar image

Two weeks ago, I created a catkin workspace, and then some folders were deleted by my little brother. After he deleted some folders in the computer, I could not find my workspace, and created another workspace. When I started to work in second workspace, I found my first workspace, which is assumed to be deleted. Right now, I have two catkin workspaces, and I want to delete second one.

As far as I know, I can delete a workspace by using the command "catkin clean" in that workspace. I used it, and the command deleted devel and build folders. However, the folder "src" still remains with CMakeList.txt file. I deleted them manually, meaning transfer them to recycle bin.

Actually, I am very new to ROS system; hence, I do not know there is anything that I have to do in order to clean a workspace.

Is it done, is that workspace completely deleted from the computer ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-09-30 17:29:18 -0600

Bruno Lima gravatar image


You can delete your old catkin workspace folder and remove possible references for its previous devel/setup.bash.

Informational answer

The command catkin clean only clean the files generated by catkin build.

A catkin workspace is a folder. It contains a src folder with some ROS packages inside. There can exist multiple workspaces with different names, but only one is usually activated.

To activate a workspace, you need to init and build it first, generating the folders devel and build. Then, you need to source the setup.bash.

If you want to know which workspace is activated at the moment, you can check the first folder from command


You can find examples of workflow at catkin-tools website. It seems complicated at first, but soon you will get the hang of it ;)


edit flag offensive delete link more


At first, I appreciate your answer. Thank you so much. I used the command "echo $ROS_PACKAGE_PATH, and terminal shows the directory opt/ros/indigo. I suppose that any workspace is not activated right now. Is the command below correct to activate a workspace ? (source devel/setup.bash)

gktg1514 gravatar image gktg1514  ( 2018-10-01 12:27:35 -0600 )edit

Yes, but you need to use the full path when referring to devel/setup.bash. In my case, the command is: source /home/bruno/catkin_ws/devel/setup.bash You need to source it once for each new opened terminal. Or put it at your ~/.bashrc and every terminal will start with your workspace activated.

Bruno Lima gravatar image Bruno Lima  ( 2018-10-01 15:50:10 -0600 )edit

I strongly recommend you to give a look at the link I gave you, which is the Catkin-tools Quickstart. It is a good reading about Catkin workflow. There is also a Cheat Sheet avaliable for quick checks.

Bruno Lima gravatar image Bruno Lima  ( 2018-10-01 16:15:19 -0600 )edit



I have two workspaces here, i'm running from tango_ws, but there is a launch file which launch a package from the package_ws, does this mean two workspaces are activated here?

mikeo gravatar image mikeo  ( 2020-12-14 21:32:04 -0600 )edit

Your Answer

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

Add Answer

Question Tools



Asked: 2018-09-30 13:34:38 -0600

Seen: 1,058 times

Last updated: Sep 30 '18