GUI crashing info

Hey, @nathan in Maryland I remember you telling me to let you know about the GUI crashing. I have narrowed it down to something to do with the sandbox. While messing around with the sandbox after the event, I noticed that it crashed whenever the sandbox was being used. This became very obvious when I was experimenting with infinite loops in the sandbox which caused the GUI to 100% crash. Our sandbox at the competition was not an infinite loop, but it was still pretty complex, making it crash only some of the time. This is not an issue right now, as I totally revamped our code to be more optimized and it doesn’t cause any crashes. Just thought I would let you know.

What was this infinite loop doing? The GUI only talks to the drone over MQTT so I can only imagine you somehow publishing a message that broke it. If you send me a GitHub link, I can take a look tonight.

I’ll send you a GitHub link but it will be a bunch of commits old since we swapped to a different system. Could it be the fact that it was sending 4-5 logging messages every two seconds?

You can view old commits in the GitHub UI, that’s fine. If you look at your commit history and can identify what commit this was occuring at, that will help a lot.

It should be fine, the normal flight software sends something like 100 MQTT messages per second, and anecdotally, the GUI can handle over 1000 per second without breaking a sweat.

Here is the commit that shows it the best. Whenever autonomous enable is pressed, the GUI slows down, starts dropping messages, and crashes. It usually takes anywhere from 5-30 seconds to happen.

Thanks. I’ll take a look

Here is our most recent commit. While running this code, I haven’t had the GUI crash at all. Thanks!

I tried commit fb776ba7e5b6ebdbd36b273ca8ac134270e7755d and it would not start.

avr-2022-sandbox-1  |   File "/app/", line 53
avr-2022-sandbox-1  |     global has_dropped_0
avr-2022-sandbox-1  |     ^
avr-2022-sandbox-1  | SyntaxError: name 'has_dropped_0' is used prior to global declaration

I was able to run commit 3d1a4f14b39400c29fd47fdd25794ae6a1119878 instead, but I wasn’t able to replicate any issues.

I stepped forward until I got commit 74cc02a784f6b83703a5d5be277a6c4ff9a9cafd to run, but again, I was unable to replicate any issues.

If you’re able to figure out how to crash the GUI again and post the output like the following, that would help:

Unrelated items:

  1. I would strongly avoid using global variables. For what you’re doing, replacing these with class attributes like self.all_dropped will be far simpler and less confusing.
  2. I think you can get rid of your
while time.time () < finish_1:

loops at this point and replace them with time.sleep. If you want me to provide more code suggestions, I can do a more thorough review.
3. Your commit messages remind me of this.