diff --git a/ansible/roles/qt5ct_setup/README.md b/ansible/roles/qt5ct_setup/README.md index 74cd6a69f36..9c15b742bb1 100644 --- a/ansible/roles/qt5ct_setup/README.md +++ b/ansible/roles/qt5ct_setup/README.md @@ -2,10 +2,16 @@ ## Overview -The `qt5ct_setup` Ansible role automates the configuration of the `qt5ct` environment for Autoware. It ensures `qt5ct` is installed, configures the `qt5ct` settings, updates the QSS file paths, and ensures the correct Autoware directory is used. +The `qt5ct_setup` Ansible role automates the configuration of the `qt5ct` environment for Autoware. +It won't affect the system-wide configuration. ## Installation +Follow the instructions below to **install** or **update** the custom theme for `RViz2` in Autoware. + +> **Important:** Both steps must be completed during the initial installation and when you want to update the theme. + + ### Install ansible collections ```bash @@ -13,7 +19,7 @@ cd ~/autoware # The root directory of the cloned repository ansible-galaxy collection install -f -r "ansible-galaxy-requirements.yaml" ``` -This step should be repeated when a new playbook is added. +This step should be repeated when you want to update the theme. ### Run the playbook @@ -21,8 +27,46 @@ This step should be repeated when a new playbook is added. ansible-playbook autoware.dev_env.install_rviz_theme --ask-become-pass ``` -This will download and extract the artifacts to the specified directory and validate the checksums. +This will install the custom theme for `RViz2` in Autoware. + +## How to use the custom theme in RViz2 + +To apply a custom theme to RViz2, you can use the `qt5ct` platform theme. Follow these steps to ensure that the `QT_QPA_PLATFORMTHEME` environment variable is set correctly for your RViz2 instance when used with Autoware. + +### Manual setup for running RViz2 + +Before running RViz2 manually, set the `QT_QPA_PLATFORMTHEME` environment variable to `qt5ct`. +This ensures that the custom theme settings are applied. + +```bash +export QT_QPA_PLATFORMTHEME=qt5ct +``` + +Then, start RViz2 as usual. + +```bash +rviz2 +``` -## Usage +### Automatic setup in Autoware + +In Autoware, the `QT_QPA_PLATFORMTHEME` environment variable is automatically set within the main [autoware.launch.xml](https://github.com/autowarefoundation/autoware_launch/blob/main/autoware_launch/launch/autoware.launch.xml) file. +Therefore, you do not need to manually set this environment variable when launching Autoware. + +In the `autoware.launch.xml` file, RViz2 is configured with the following `` element: + +```xml + + + +``` -Include the `qt5ct_setup` role in your playbook. Ensure your playbook includes the `autoware` directory and the required files (`base-qt5ct.conf` and `autoware.qss`) in the appropriate locations. +This configuration automatically sets the `QT_QPA_PLATFORMTHEME` to `qt5ct` when RViz2 is launched as part of Autoware. +It also includes additional options such as respawn behavior and custom RViz2 configurations.