> For the complete documentation index, see [llms.txt](https://www.learnros2.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.learnros2.com/ros/cookbook/how-to-build-the-workspace.md).

# How to build the workspace

To build the code in a workspace, we can follow the following steps:

* Go to the root directory of the workspace
* Install missing dependencies: \
  `rosdep install -i --from-path src --rosdistro humble -y`
* Build the code
  * If you want to build all packages in the workspace:\
    colcon build --symlink-install
  * If you want to build a specific package:\
    colcon build --packages-select
* Open a new  terminal, go to the root directory of the workspace, and execute the following command:\
  `. install/setup.bash`  (or `soruce install/setup.sh`)<br>
