1+ from pathlib import Path
12from threading import Thread
23from time import sleep
34
5+ from ament_index_python .packages import get_package_share_directory
6+ from PyQt6 .QtCore import Qt
47from PyQt6 .QtCore import pyqtSignal , pyqtSlot
5- from PyQt6 .QtGui import QFont
8+ from PyQt6 .QtGui import QFont , QPixmap
69from PyQt6 .QtWidgets import (
710 QGridLayout ,
811 QHBoxLayout ,
912 QLabel ,
1013 QLineEdit ,
1114 QPushButton ,
15+ QVBoxLayout ,
1216 QWidget ,
1317)
1418from rclpy .qos import qos_profile_system_default
@@ -66,7 +70,9 @@ def __init__(self) -> None:
6670
6771 root_layout = QHBoxLayout ()
6872 left_layout = QGridLayout ()
73+ right_layout = QVBoxLayout ()
6974 root_layout .addLayout (left_layout )
75+ root_layout .addLayout (right_layout )
7076
7177 self .line_edit = QLineEdit ()
7278 self .line_edit .setPlaceholderText ('Enter word' )
@@ -86,6 +92,21 @@ def __init__(self) -> None:
8692
8793 self .set_light_signal .connect (self .set_light )
8894
95+ map_path = str (
96+ Path (get_package_share_directory ('gui' )) / 'images' / 'morse_code.png'
97+ )
98+ map_pixmap = QPixmap (map_path )
99+ map_label = QLabel ()
100+ map_label .setPixmap (
101+ map_pixmap .scaled (
102+ 600 ,
103+ 600 ,
104+ Qt .AspectRatioMode .KeepAspectRatio ,
105+ Qt .TransformationMode .SmoothTransformation ,
106+ )
107+ )
108+ right_layout .addWidget (map_label )
109+
89110 self .setLayout (root_layout )
90111
91112 def button_callback (self ) -> None :
0 commit comments