From 1fd64f43380daa0d399c00e27bf9cfcea15bad38 Mon Sep 17 00:00:00 2001 From: Vojtech Spurny Date: Thu, 7 Aug 2025 16:45:33 +0200 Subject: [PATCH 1/3] colorful output for colcon commans --- .../25-ros2/20-workspace-build.md | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/10-prerequisities/25-ros2/20-workspace-build.md b/docs/10-prerequisities/25-ros2/20-workspace-build.md index d6b26049..11e7b6f9 100644 --- a/docs/10-prerequisities/25-ros2/20-workspace-build.md +++ b/docs/10-prerequisities/25-ros2/20-workspace-build.md @@ -95,6 +95,29 @@ export ROS_WORKSPACE="$HOME/ws_examples" Do not put any manual sourcing of the workspace or `/opt/ros/jazzy/` into your `~/.bashrc` (`~/.zshrc`)! Sourcing `mrs_uav_development` sources the `ROS_WORKSPACE` specified in `~/.bashrc` (`~/.zshrc`) automatically (or it sources `/opt/ros/jazzy` if no `ROS_WORKSPACE` is specified. +### 7. Colorful output for colcon commands +If you're accustomed to the colorful output of catkin_tools from ROS 1, you can achieve a similar look and feel with colcon in ROS 2. +This makes it easier to read build logs and quickly identify important messages or errors. + +To get started, install the colcon-ansi-colors-example extension using pip: +```bash +pip install git+https://github.com/cottsay/colcon-ansi-colors-example --break-system-packages +``` +Note: The `--break-system-packages` flag is often required to install pip packages globally on systems where the package manager is strict about system files. + +Once the extension is installed, you can use the new output style with the following command: + +```bash +colcon build --output-style catkin_tools +``` + +If you like the colorful output and want to use it by default for all colcon commands, add the following line to your shell's configuration file (e.g., ~/.bashrc for Bash or ~/.zshrc for Zsh): +```bash +export COLCON_DEFAULT_OUTPUT_STYLE=catkin_tools +``` +After adding the line, be sure to open a new terminal or run source ~/.bashrc (or the appropriate file) for the change to take effect. + + # Troubleshooting From 3f2a0f1e2dd3f6bd39b24478ae53a2f7e5227e0d Mon Sep 17 00:00:00 2001 From: Vojtech Spurny Date: Thu, 7 Aug 2025 16:50:13 +0200 Subject: [PATCH 2/3] Update --- docs/10-prerequisities/25-ros2/20-workspace-build.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/10-prerequisities/25-ros2/20-workspace-build.md b/docs/10-prerequisities/25-ros2/20-workspace-build.md index 11e7b6f9..62146f81 100644 --- a/docs/10-prerequisities/25-ros2/20-workspace-build.md +++ b/docs/10-prerequisities/25-ros2/20-workspace-build.md @@ -111,11 +111,11 @@ Once the extension is installed, you can use the new output style with the follo colcon build --output-style catkin_tools ``` -If you like the colorful output and want to use it by default for all colcon commands, add the following line to your shell's configuration file (e.g., ~/.bashrc for Bash or ~/.zshrc for Zsh): +If you like the colorful output and want to use it by default for all colcon commands, add the following line to your shell's configuration file (e.g., `~/.bashrc` for Bash or `~/.zshrc` for Zsh): ```bash export COLCON_DEFAULT_OUTPUT_STYLE=catkin_tools ``` -After adding the line, be sure to open a new terminal or run source ~/.bashrc (or the appropriate file) for the change to take effect. +After adding the line, be sure to open a new terminal or run `source ~/.bashrc` (or the appropriate file) for the change to take effect. From e56c979de4fe94afbba0d6a81a64cbbced219cd5 Mon Sep 17 00:00:00 2001 From: Vojtech Spurny Date: Thu, 7 Aug 2025 17:14:29 +0200 Subject: [PATCH 3/3] fix of command order --- docs/10-prerequisities/25-ros2/20-workspace-build.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/10-prerequisities/25-ros2/20-workspace-build.md b/docs/10-prerequisities/25-ros2/20-workspace-build.md index 62146f81..616046b6 100644 --- a/docs/10-prerequisities/25-ros2/20-workspace-build.md +++ b/docs/10-prerequisities/25-ros2/20-workspace-build.md @@ -108,7 +108,7 @@ Note: The `--break-system-packages` flag is often required to install pip packag Once the extension is installed, you can use the new output style with the following command: ```bash -colcon build --output-style catkin_tools +colcon --output-style catkin_tools build ``` If you like the colorful output and want to use it by default for all colcon commands, add the following line to your shell's configuration file (e.g., `~/.bashrc` for Bash or `~/.zshrc` for Zsh):