-
Notifications
You must be signed in to change notification settings - Fork 711
Fix chat module bugs #1561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix chat module bugs #1561
Conversation
Hi @SriramS-77, Thanks very much for this! Two small administrative things, could you add a "Chat: " prefix to the commit title? To be clear I mean the commit title not the PR title. Also if possible could you rebase on master to remove the "Merge branch 'master' into master" commit? I'll give this a quick test shortly but it looks good, thanks! |
@@ -42,29 +42,47 @@ def __init__(self, mpstate): | |||
|
|||
# create chat window (should be called from a new thread) | |||
def create_chat_window(self): | |||
print("Trying to create chat window") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should remove this debug output
self.chat_window.close() | ||
|
||
# unload function override for module interface | ||
def unload(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested "module unload chat" and it doesn't seem to work I'm afraid. Please tell me if I'm doing something wrong. I get the message shown below. Perhaps it's because I'm using WSL2?
STABILIZE> Unloaded module chat
Trying to create chat window
Reloaded module chat
(mavproxy.py:7420): Gtk-CRITICAL **: 21:57:40.028: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar
[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
python3: ../../src/xcb_io.c:175: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed.
SIM_VEHICLE: MAVProxy exited
SIM_VEHICLE: Killing tasks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have only tested on Windows so far. I will look into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked into why it was not working in Linux (I tried in Ubuntu to recreate the error). It seems wxPython is built on top of GTK in Ubuntu, which is much stricter than the Windows version. It is not allowing reinitializing app or rerunning mainLoop in the same process. I tried different approaches to getting it working in the same process, but keep getting seg fault.
I think it would be better to launch a different process for the app using multiprocessing. What are your thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another approach would be to:
- Hide the chat window and clear the data (unloading).
- Show the window along with new assistant thread (reloading).
I think this might be better, since there is no need to rework the implementation for handling mavlink acknowledgement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @SriramS-77,
Either way sounds good to me. By the way, do you have an OpenAPI key? I just checked the list of ArduPilot sponsored API keys and I don't see you there. If you'd like one, please just PM me on ArduPilot's discord server, I'm "rmackay9" over there too.
Fixes:
Added "chat hide" feature, to interact with existing "chat show" feature.
Demo Video:
Git_PR_Demo.MP4