Skip to content

Commit

Permalink
listen on ros topic
Browse files Browse the repository at this point in the history
  • Loading branch information
c4glenn committed Mar 20, 2024
1 parent 88ed51b commit 65b8e08
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/grr_guis/grr_guis/main_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,14 @@ def promoVid2(self):
print(content)
self.player.setMedia(QMediaContent(content))
self.player.play()
self.videoWidget.setFullScreen(True)


class Gui(Node):
def __init__(self, application:QApplication, window:GRR_Window) -> None:
super().__init__("GUI")
self.test_publisher = self.create_publisher(Bool, "test", 10)
self.test_label = self.create_subscription(String, "test_str", self.display_test, 10)
self.start_video = self.create_subscription(Bool, "/grr/promo_display", self.run_video, 10)
self.gui_loop_timer = self.create_timer(.1, self.gui_loop)
self.app = application
self.window = window
Expand All @@ -104,6 +105,10 @@ def bind(self):
def send_test(self, checked):
self.window.button.setText(f"Ready to Start? {'Yes' if checked else 'No '}")
self.test_publisher.publish(Bool(data=checked))

def run_video(self, msg:Bool):
if msg.data:
self.window.promoVid2()

def display_test(self, msg:String):
print(msg)
Expand Down

0 comments on commit 65b8e08

Please sign in to comment.