Crashing Python with ai Widget

Firmware/software/electronics/mechanics
Post Reply
hdmathias
Member
Posts: 47
Joined: Sat Nov 01, 2014 3:24 pm
Location: Florida, USA

Crashing Python with ai Widget

Post by hdmathias »

I'm writing an app for Kinect control of a Crazyflie. Once I had that working reasonably well, I decided to add an ai widget window to display the AttitudeIndicator. And once that was working, I decided to add text boxes to display the roll, pitch, yaw and thrust values. That's when I ran into trouble: Python crashes. This doesn't appear to be due to an error in my code -- Python just quits and I get a dialog telling me that Python.exe has quit.

I implemented the displays for the telemetry values as QLineEdit objects and update the values using setText calls. If I display even one of these objects, then Python crashes rather quickly, even if I don't update the displayed value.

It's possible that this is simply a memory problem since I am using PyQt, PyKinect, and pygame. The program displays the Kinect skeleton window in addition to the ai widget so maybe it's just overwhelming the system but it seems odd that a simple QLineEdit would push it over the edge.

Is there a better way to display the telemetry values? QLineEdit is used in the Flight Tab of the client, but then the client doesn't have the Kinect overhead to deal with. Any tips or suggestions are appreciated.
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

Re: Crashing Python with ai Widget

Post by whoenig »

It shouldn't crash for sure. Even if there is a memory issue, it should give you an out-of-memory exception. That being said, there are a million things which can go wrong because python just calls into native code (like Qt), which can segfault. The best bet would be to install Visual Studio (Express Edition for C++ is fine) and run python in a debugger. That might give you a stack trace or at least tells you in which module the crash occurs.
Post Reply