Skip to content

Commit

Permalink
Instantiate QApp for rgb_array_list test
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmadAmine998 committed Oct 1, 2024
1 parent cb7455b commit 75e62f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ jobs:
QT_QPA_PLATFORM: offscreen

steps:
- name: Update apt
run: sudo apt update

- name: Install openGL
run: sudo apt install freeglut3-dev libglib2.0-0 libsm6 libxrender1 libxext6 libxkbcommon-x11-0 libdbus-1-dev
run: sudo apt install -y freeglut3-dev libglib2.0-0 libsm6 libxrender1 libxext6 libxkbcommon-x11-0 libdbus-1-dev

- uses: actions/checkout@v2

Expand Down
3 changes: 2 additions & 1 deletion f1tenth_gym/envs/rendering/rendering_pyqt.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(
self.render_fps = render_fps

# create the canvas
self.app = QtWidgets.QApplication([])
self.app = QtWidgets.QApplication.instance() or QtWidgets.QApplication([])
self.window = pg.GraphicsLayoutWidget()
self.window.setWindowTitle("F1Tenth Gym")
self.window.setGeometry(0, 0, self.render_spec.window_size, self.render_spec.window_size)
Expand Down Expand Up @@ -399,3 +399,4 @@ def close(self) -> None:
Close the rendering environment.
"""
self.app.exit()

0 comments on commit 75e62f1

Please sign in to comment.