Ask Your Question
0

Two Different Catkin Workspaces

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

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
1

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

Bruno Lima gravatar image

TL;DR

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

echo $ROS_PACKAGE_PATH

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

Cheers,

edit flag offensive delete link more

Comments

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 imagegktg1514 ( 2018-10-01 12:27:35 -0500 )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 imageBruno Lima ( 2018-10-01 15:50:10 -0500 )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 imageBruno Lima ( 2018-10-01 16:15:19 -0500 )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

2 followers

Stats

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

Seen: 466 times

Last updated: Sep 30 '18