My next step in the project was to further advance my program. At that moment, my drone could only follow commands after the execution of the command given beforehand. However, we wanted to be able to continuously give voice commands while the drone is still in execution and be able to execute the first command in the queue. The only way I thought we could be able to do this is by using threading. I went back on trying to use threading to solve this issue. I constantly got errors and did not know what was going on. First of all, I had an issue with storing the result from one thread and passing it to the other. When that didn’t work, I also tried creating a global variable that could be shared by the two threads in my program. However, variable sharing requires synchronization of the threads so that the variable would not be modified by both the threads at the same time. I used locks to do this. I could execute the program at this point but only the voice recognition function was executed and the program did not perform well. I tried modifying and debugging the code multiple times but it seemed like nothing worked.
I had been stuck with the same issue for a week and I was getting a bit frustrated because of that. So, I decided to keep looking at the problem while also doing some research on object recognition because I was already late on where I needed to be at this point in the project. So, I did some digging on the internet and read some articles on how python handles real-time object recognition. I plan on start implementing it next week.