Creating and setting up a ROS 2 workspace
Before we write any code, we need to do a bit of organization. Nodes will exist within packages, and all your packages will exist within a ROS 2 workspace.
What is a ROS 2 workspace? A workspace is nothing more than a folder organization in which you will create and build your packages. Your entire ROS 2 application will live within this workspace.
To create one, you have to follow certain rules. Let’s create your first workspace step by step and correctly set it up.
Creating a workspace
To create a workspace, you will simply create a new directory inside your home directory.
As for the workspace’s name, let’s keep it simple for now and use something that is recognizable: ros2_ws
.
Note
The name of the workspace is not important, and it will not affect anything in your application. As we are just getting started, we only have one workspace. When you make progress and start to work on several applications...