Unable to end 2nd thread through a topic subscription

asked 2022-05-16 03:18:08 -0600

printf42 gravatar image

updated 2022-05-16 03:22:12 -0600

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 pynputs 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.

edit retag flag offensive close merge delete