From 67d72cf10c35842392d23161ee4b50131d595d28 Mon Sep 17 00:00:00 2001 From: Nandan Tumu Date: Wed, 2 Oct 2024 19:48:52 +0000 Subject: [PATCH] Set environment variable --- .github/workflows/ci.yml | 4 ++-- f1tenth_gym/envs/rendering/rendering_pyqt.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e73f6915..1728df58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,8 +16,8 @@ jobs: fail-fast: false matrix: python-version: ["3.9", "3.10", "3.11", "3.12"] - env: - QT_QPA_PLATFORM: offscreen + # env: + # QT_QPA_PLATFORM: offscreen steps: - name: Update apt diff --git a/f1tenth_gym/envs/rendering/rendering_pyqt.py b/f1tenth_gym/envs/rendering/rendering_pyqt.py index ecd2469e..900a5a3f 100644 --- a/f1tenth_gym/envs/rendering/rendering_pyqt.py +++ b/f1tenth_gym/envs/rendering/rendering_pyqt.py @@ -3,6 +3,7 @@ import math from typing import Any, Callable, Optional import signal +import os import cv2 import numpy as np @@ -164,6 +165,7 @@ def __init__( signal.signal(signal.SIGINT, signal.SIG_DFL) self.window.show() elif self.render_mode == "rgb_array": + os.environ["QT_QPA_PLATFORM"] = "offscreen" self.exporter = ImageExporter(self.canvas) def update(self, state: dict) -> None: