Unable to end 2nd thread through a topic subscription
The issue is as follows:
Main thread:
-- has a boolean condition replay
-- has subscription to a voice control topic which uses the speech_callback
method, when a certain command is received, speech_callback
will flip replay
to False
and is supposed to stop the 2nd thread from replaying.
---- Runs 2nd thread (body control trajectory)
The idea is to be able to kill the 2nd thread by setting flipping replay
through a command that's retrieved by the speech_callback
method.
The concept works fine when I have an on_press
method in the main that is called through pynput
s keyboard input library, which flips the replay
condition on a certain keyboard input...
Not sure what is going on here... Any helps would be appreciated.