ROS2 vs ROS1 Overlay Workspace
In ROS1, the structure of an overlay workspace, called the catkin workspace, looks like this:
workspace_folder: |--src |--CMakeLists.txt |--package_1_folder |-- |--package_n_folder |--devel |--build |--install
The catkin workspace is built by running “catkin_make” command. To rebuild a catkin workspace, simply delete all the folders inside the workspace but the “src” folder and subsequently run the “catkin_make” command.
For a detailed description, please consult the following documentation: http://wiki.ros.org/catkin/workspaces
In ROS2, the structure of an overlay workspace looks like this:
workspace_folder: |--src |--package_1_folder |-- |--package_n_folder |--build |--COLCON_IGNORE |--package_1_folder |-- |--package_n_folder |--install |--COLCON IGNORE |--files: setup.bash, local_setup.bash, etc |--package_1_folder |-- |--package_n_folder |--log
Building command
To build a ROS2 workspace, use the following command:
colcon build --symlink-install
To rebuild a ROS2 workspace, simply delete all the folders inside the workspace but the “src” folder and subsequently perform the “colcon build” command.
If there are already a large number of packages inside your workspace, running the command above may take a long time to complete. Instead, you can only build the package(s) that has not been built yet by using the following command:
colcon build --packages-select [PACKAGE_NAME]
