Phidgets and threads and pandas, oh my!

I’m trying to get a couple of Phidgetrs (an accelerometer and a rotary encoder) to drive panda. I’ve gotten it to work for 10-15 seconds at a time. I end up getting a fatal

after a few seconds of Phidget callbacks beating on base.camera.setPos()
The Phidget stuff is quite threaded so I did the conversion to

from direct.stdpy import threading
# and

from direct.stdpy import thread

as appropriate but to no effect. I’m going to do some optimizing of when I actually call base.camera.setPos() but wondered if there were any clues around about what might be going on.

Thanks,
Dale.

This has been reported in another thread. The suspicion is that some operation you are doing in Panda is not quite thread-safe.

There are a few operations in Panda which are known to be non-thread-safe, for instance, operating on the same model, or in different parts of the same graph, can cause problems if they happen in parallel in different threads. It’s better to make sure your model is not parented to render while you are operating on it in a child thread, and only parent it to render in the main thread when you know your child thread has finished with it.

Is it possible that you’re doing something like this, or is there something else we haven’t found yet?

David

Thanks, that helped me figure out where to look. I just added a task which queried for and dealt with the current sensor values instead of letting the callback do the setPos() directly.