-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #181 from cwruRobotics/livestream-gui-fix
Add livestream gui
- Loading branch information
Showing
5 changed files
with
209 additions
and
40 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from PyQt6.QtCore import Qt | ||
from PyQt6.QtWidgets import QHBoxLayout, QLabel, QVBoxLayout, QWidget | ||
from PyQt6.QtGui import QPixmap | ||
|
||
from ament_index_python.packages import get_package_share_directory | ||
import os | ||
|
||
|
||
class LivestreamHeader(QWidget): | ||
def __init__(self) -> None: | ||
super().__init__() | ||
|
||
root_layout = QHBoxLayout() | ||
self.setLayout(root_layout) | ||
|
||
logo_path = os.path.join( | ||
get_package_share_directory("gui"), "images", "CWRUbotix Logo.png" | ||
) | ||
|
||
logo_pixmap = QPixmap(logo_path) | ||
|
||
logo_label = QLabel() | ||
logo_label.setPixmap( | ||
logo_pixmap.scaled(100, 100, Qt.AspectRatioMode.KeepAspectRatio, | ||
Qt.TransformationMode.SmoothTransformation) | ||
) | ||
|
||
root_layout.addWidget(logo_label) | ||
root_layout.addSpacing(10) | ||
|
||
text_vbox = QVBoxLayout() | ||
title_label = QLabel("Explorer Team 25 - CWRUbotix") | ||
title_label.setStyleSheet('QLabel { font-size: 35px; }') | ||
title_label.setAlignment(Qt.AlignmentFlag.AlignAbsolute) | ||
text_vbox.addWidget(title_label) | ||
|
||
subtitle_label = QLabel("Case Western Reserve University - Cleveland, Ohio") | ||
subtitle_label.setStyleSheet('QLabel { font-size: 20px; }') | ||
subtitle_label.setAlignment(Qt.AlignmentFlag.AlignAbsolute) | ||
text_vbox.addWidget(subtitle_label) | ||
|
||
root_layout.addLayout(text_vbox) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import os | ||
|
||
from ament_index_python.packages import get_package_share_directory | ||
from launch.launch_description import LaunchDescription | ||
from launch.actions import IncludeLaunchDescription | ||
from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
|
||
|
||
def generate_launch_description() -> LaunchDescription: | ||
|
||
surface_path = get_package_share_directory('surface_main') | ||
gui_path = get_package_share_directory('gui') | ||
|
||
all_launch = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource([ | ||
os.path.join( | ||
surface_path, 'launch', 'surface_all_nodes_launch.py' | ||
) | ||
]), | ||
) | ||
|
||
# Launches livestream gui | ||
gui_launch = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource([ | ||
os.path.join( | ||
gui_path, 'launch', 'pilot_launch.py' | ||
) | ||
]), | ||
launch_arguments=[('gui', 'livestream')] | ||
) | ||
|
||
return LaunchDescription([ | ||
all_launch, | ||
gui_launch | ||
]) |