Skip to content

Commit

Permalink
Merge pull request #72 from cwruRobotics/fix-michael-nonsense
Browse files Browse the repository at this point in the history
Fix GUIEventClient
  • Loading branch information
InvincibleRMC authored Nov 27, 2023
2 parents f3b0be1 + d26d457 commit 78efa2d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/surface/gui/gui/event_nodes/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ def __init__(self, srv_type: SrvType, topic: str, signal: pyqtBoundSignal,
self.srv_type = srv_type
self.topic: str = topic
self.signal: pyqtBoundSignal = signal
self.timeout = timeout

self.cli: Client = self.create_client(srv_type, topic)
Thread(target=self.__connect_to_service, daemon=True,
name=f'{self.name}_connect_to_service').start()

self.timeout = timeout

def __connect_to_service(self) -> None:
"""Connect this client to a server in a separate thread."""
while not self.cli.wait_for_service(timeout_sec=self.timeout):
# TODO: include namespaces wherever we echo the topic
self.get_logger().info(
('Service for GUI event client node on topic',
f' {self.topic} unavailable, waiting again...'))
'Service for GUI event client node on topic'
f' {self.topic} unavailable, waiting again...')

def send_request_async(self, request: SrvTypeRequest) -> None:
"""Send request to server in separate thread."""
Expand Down

0 comments on commit 78efa2d

Please sign in to comment.