Week 4
Week 4: Writing the Application Code
Getting Started with Python and Vosk
This week, I focused heavily on writing the Python code for the application. The first component I tackled was the voice recognition functionality using Vosk, a lightweight speech recognition toolkit. Vosk is well-suited for running offline, which is perfect for our needs. I integrated the voice recognition successfully into the code and began implementing basic robot commands.
Text-to-Speech Integration
Alongside Vosk, I added a Text-to-Speech (TTS) dependency to allow the robot to provide verbal feedback after executing commands. This functionality enhances the interaction by allowing the robot to respond with confirmation once a task is completed or when an error occurs. This step proved to be a key part of making the system more user-friendly and intuitive.
Connecting to the Robot via ROS2
Once the voice recognition and TTS components were in place, I moved on to connecting the code to the robotic arm using ROS2. This allowed me to start writing the action commands for the robot. I added three key actions into the script:
- Poke Object: The robot will extend its arm to poke an object based on the given command.
- Reset Position: After performing a task, the robot will return to its home position.
- End Program: This command will safely shut down the entire system when needed.
Progress Without Testing
While I was able to write the code for the voice recognition, TTS, and ROS2 robot actions, I didn’t have the opportunity to test it yet. However, having these core functionalities written brings me one step closer to a fully functional system.
Stay tuned for more updates!