How to clear the buffer of the NatNet Python Client? I only want to query the latest data point?
Posted: Wed Mar 03, 2021 2:07 pm
Hello there,
I have two questions:
1) How can I clear the buffer of the NatNetClient object in Python?
2) This might be a Python question. When I use the threading.Lock() object in one of my threads to block other threads to avoid race conditions, the thread in the NatNetClient object still runs, i.e., the NatNetClient will still be called even though the Lock() is acquired in a different thread?
My application is the following:
I am using the Python NatNetClient to stream the position and orientation of a single rigid body attached to a quadcopter for real-time feedback control experimentation. When some of my threads take more execution time, the NatNetClient will buffer receiving data, and then it will execute its callback function several times to clear the buffer. This is causing issues in my code, especially with my code architecture. Is there a way for the NatNetClient object to only send back the most recent position data and discard the buffered data?
Kind regards,
Ahmad
I have two questions:
1) How can I clear the buffer of the NatNetClient object in Python?
2) This might be a Python question. When I use the threading.Lock() object in one of my threads to block other threads to avoid race conditions, the thread in the NatNetClient object still runs, i.e., the NatNetClient will still be called even though the Lock() is acquired in a different thread?
My application is the following:
I am using the Python NatNetClient to stream the position and orientation of a single rigid body attached to a quadcopter for real-time feedback control experimentation. When some of my threads take more execution time, the NatNetClient will buffer receiving data, and then it will execute its callback function several times to clear the buffer. This is causing issues in my code, especially with my code architecture. Is there a way for the NatNetClient object to only send back the most recent position data and discard the buffered data?
Kind regards,
Ahmad