Making an AI Assistance Bot – Overview
It’s time to write the code for our AI Assistance bot. The AI assistant bot should recognize your voice commands, will set the destination based on the command identified, follow the path, stop at the checkpoint, check whether it has reached the correct destination or not without any crashes, and say out the destination name loud.
Let’s set up your arena like this and place your recognition/number cards at the following places.
The robot will start from just ahead of checkpoint 3, and then it will do line following until it reaches the following checkpoints.
Completing the script
Now let’s complete the script to transform Quarky into an AI assistance bot!
- Add a forever block below the speak () block in the script we just made.
- Add a do line following block from the Robot palette inside the forever block.
- Add a stop robot block.
- Add an analyze image from () block below the stop robot block. camera is selected as the default option from the drop-down.
- Add an if block from the Control palette below the analyze image from () block. Inside the diamond-shaped space, add an () and () block from the Operators palette.
- Inside the first space of the () and () block, add an () = () block. In the second space, add an is number () detected ? block from the Autonomous Driving palette. Select 1 from the drop-down.
- Inside the first space of the () = () block, add the Destination variable block and in the second space, write “PHARMACY”.
- Add a speak () block inside the if block and write “Reached pharmacy”.
- Add a stop () block below the speak () block.
- Repeat steps 5 to 9 for CLINIC. Just write “CLINIC” in place of “PHARMACY” in step 7 and “Reached clinic” instead of “Reached pharmacy” in step 9.
- Click the green flag to run the scrip and have fun!
Before you move on to the next lesson, a small assignment awaits you!
Make a video of the project you made in this activity and upload it to the website.
Submitting the assignment is a must in order to receive the certificate after completing the course.
Follow the steps below to upload your assignment:
- First, you need to choose the video file, thus click on Browse.
- Select your video file.
- And click the Upload button.