Skip to content

Commit

Permalink
update the readme
Browse files Browse the repository at this point in the history
Signed-off-by: M. Fatih Cırıt <[email protected]>
  • Loading branch information
M. Fatih Cırıt committed Sep 17, 2024
1 parent 317b486 commit 1a915bf
Showing 1 changed file with 49 additions and 5 deletions.
54 changes: 49 additions & 5 deletions ansible/roles/qt5ct_setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,71 @@

## 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
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

```bash
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.

Check warning on line 34 in ansible/roles/qt5ct_setup/README.md

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (PLATFORMTHEME)

### Manual setup for running RViz2

Before running RViz2 manually, set the `QT_QPA_PLATFORMTHEME` environment variable to `qt5ct`.

Check warning on line 38 in ansible/roles/qt5ct_setup/README.md

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (PLATFORMTHEME)
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.

Check warning on line 53 in ansible/roles/qt5ct_setup/README.md

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (PLATFORMTHEME)
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 `<node>` element:

```xml
<node
pkg="rviz2"
exec="rviz2"
name="rviz2"
output="screen"
args="-d $(var rviz_config) -s $(find-pkg-share autoware_launch)/rviz/image/autoware.png"
if="$(var rviz)"
respawn="$(var rviz_respawn)">
<env name="QT_QPA_PLATFORMTHEME" value="qt5ct"/>
</node>
```

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.

Check warning on line 71 in ansible/roles/qt5ct_setup/README.md

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (PLATFORMTHEME)
It also includes additional options such as respawn behavior and custom RViz2 configurations.

0 comments on commit 1a915bf

Please sign in to comment.