From 47495f23cb569b1642673cf656e63ccf5928ed2d Mon Sep 17 00:00:00 2001 From: winterhalderp Date: Mon, 19 Apr 2021 17:22:29 +0200 Subject: [PATCH] Update 'non-ros-files/Programming_Rules.md' --- non-ros-files/Programming_Rules.md | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/non-ros-files/Programming_Rules.md b/non-ros-files/Programming_Rules.md index 2d46039..de2ecc1 100644 --- a/non-ros-files/Programming_Rules.md +++ b/non-ros-files/Programming_Rules.md @@ -2,8 +2,24 @@ ## File Structure ``` colcon_workspace - | - |- build - |- install - |- src + | + |- build (holds build files) + |- install (holds build elements) + |- src (contains your source code - this is where you work) +``` + +## Colcon build +Performing a `colcon build` is neccessary after every change to the `src` directory. This must be performed in the `root` of the _colcon_ workspace (eg. `cd ~/colcon_ws`). + +In order to avoid this procedure after every change made to a Python script you must run `colcon build --symlink-install` once. This links the files created in `/build` and `/install` to your source files in `/src`. However, after creating a new Python script this procedure must be repeated in order to also link this new script. + +## Source directory +The source directory holds your ROS2 packages as further directories. In this example the `src` directory contains the packages `pubsub` and `pubsub_msg`: +``` +colcon_workspace/ + | + |- src/ + | + |- pubsub/ + |- pubsub_msg/ ``` \ No newline at end of file