ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Doubt regarding creating a workspace - ROS2 Humble

asked 2023-05-17 01:50:42 -0500

Hello,

I am new to ROS and I am following the ROS2 Humble documentation and have a doubt regarding workspace creation.

On this tutorial (http://docs.ros.org/en/humble/Tutoria...) I was asked to create a workspace with the name 'ros2_ws'.

In the next tutorial (http://docs.ros.org/en/humble/Tutoria...) the idea is to create another workspace, but the same name 'ros2_ws' was used again in creating the workspace.

So I am a bit confused on what to do now. I currently have a workspace with the name 'ros2_ws' and it was sourced already by appending the .bashrc file.

Thank you

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2023-05-17 02:57:23 -0500

Ranjit Kathiriya gravatar image

In the tutorials you mentioned, the workspace name 'ros2_ws' is used as an example, but you can actually choose any name for your workspace. The name 'ros2_ws' is just a convention commonly used to represent a ROS 2 workspace.

Since you have already created a workspace with the name 'ros2_ws' and sourced it in your .bashrc file, you can continue using that workspace for your ROS 2 development. There is no need to create another workspace with the same name.

You can source it by going opening the terminal and navigating to the work space directory by using cd command.

You can source it by :

source devel/setup.bash

Or else,

You can also add this command to bash.rc file, to avoid sourcing every time.

The purpose of a workspace in ROS is to provide a directory structure where you can organize your ROS packages. As long as you have a workspace and you have sourced it correctly, you can start creating and working with ROS packages within that workspace.

If you need to create additional workspaces in the future, you can choose different names to avoid any confusion. It's also a good practice to give your workspaces descriptive names related to the projects you're working on.

I hope this clarifies your doubt. If you have any more questions, feel free to ask!

edit flag offensive delete link more

Comments

Hi, thanks for the response. Sorry but it is still not clear to me.

I created 'ros2_ws' using the first tutorial (first link). But in the second tutorial, it was mentioned that we are creating a new workspace as an overlay on the first workspace (which is the ROS installation workspace that has already been created). Please correct me if I interpreted this the wrong way. If what I think is right, please let me know what can be done now.

Thanks

vinay97 gravatar image vinay97  ( 2023-05-17 05:55:27 -0500 )edit

I created 'ros2_ws' using the first tutorial (first link).

You can use GUI Files and view it in the Home directory you can be able to see the folder.

But in the second tutorial, it was mentioned that we are creating a new workspace as an overlay on the first workspace (which is the ROS installation workspace that has already been created).

If you have created the same directory on a specific place in my case in the Home directory you will get an error message saying

mkdir: cannot create directory ‘ros2_ws’: File exists

So, I think that you may have created both work space in different location or may be creating a folder inside ros2_ws.

Ranjit Kathiriya gravatar image Ranjit Kathiriya  ( 2023-05-17 06:39:11 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2023-05-17 01:50:42 -0500

Seen: 175 times

Last updated: May 17 '23