Skip to content

Commit

Permalink
Fix oled slow default
Browse files Browse the repository at this point in the history
  • Loading branch information
ArendJan committed Apr 15, 2024
1 parent c0edcfe commit 698430a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mirte_telemetrix/scripts/ROS_telemetrix_aio_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,15 @@ async def start(self):
def show_default(self, event=None):
if not self.default_image:
return
asyncio.run(self.show_default_async())
try:
# the ros service is started on a different thread than the asyncio loop
# When using the normal loop.run_until_complete() function, both threads join in and the oled communication will get broken faster
future = asyncio.run_coroutine_threadsafe(
self.show_default_async(), self.loop
)
future.result() # wait for it to be done
except Exception as e:
print(e)

async def show_default_async(self):
text = ""
Expand Down

0 comments on commit 698430a

Please sign in to comment.