I am currently working on the Open AR Sandbox project. I try to make it work on my computer but when i try to stop and to restart the simulation i obtain this error : QObject::~QObject: Timers cannot be stopped from another thread.
Stopping/starting the simulation calls these two functions in order to stop the frame acquisition of the Kinect V2 on Linux (Ubuntu 22.04.4 LTS):
def _run(self):
"""
Run the thread when _platform is linux
"""
if self._thread_status != 'running':
self._thread_status = 'running'
self._thread = threading.Thread(target=self._open_kinect_frame_stream, daemon=True, )
self._thread.start()
logger.info('Acquiring frames...')
else:
logger.info('Already running.')
def _stop(self):
"""
Stop the thread when _platform is linux
"""
if self._thread_status is not 'stopped':
self._thread_status = 'stopped' # set flag to end thread loop
self._thread.join() # wait for the thread to finish
logger.info('Stopping frame acquisition.')
else:
logger.info('thread was not running.')
It is not my work, and i am not used to work with threads so i don’t understand why it does not work. Could someone please explain me if the error is linked to this two function or the global use of the thread ?
I tried not closing this thread, and the stop/start buttons works fine that why I think the problem is in these two functions.
This issue also affects the calibration sensor button and the use of the Aruco Markers so not closing the tread is not a solution.
Kateul is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.