Activity: Making a Self Driving Car
Making a Self Driving Car – Overview
Completing the script
Now let’s complete the script to transform Quarky into a self-driving car!
- We will start from the script that we have made in the previous topic.
- Replace the say () block with the if-else block.
- Place is signal () detected? block from the Autonomous Driving palette. And select GO from the drop-down.
- Place a go () at () % speed for () seconds block under the if arm. Forward, 100%, and 1 are set as the default direction, speed, and time.
- Place another if-else block under the else arm.
- Add another is () signal () detected ? block inside the diamond-shaped space of the second if-else block. Select Turn Left from the drop-down.
- Add another go () at () % speed for () seconds block below the if arm of the second if-else block. Set the direction to Left.
- Add another if-else below the else arm of the second if-else block.
- Repeat steps 6 and 7. Select Turn Right from the drop-down of the is () signal () detected? block and set the direction of the go () at () % speed for () seconds block as Right.
- Click the green flag to run the script.
Make your own city by placing the signs and landmarks and then make the car drive on its own.
Now that you know how self-driving car works and the line-following robot works. It’s time to show your skill. We challenge you to make a self-driving car that detects the signs and landmarks and takes actions but also, should follow the line. To make one such arena, place the arena which you’ve got in your innovator kit on the flat surface and put the signs and landmarks across the path.
With this, we’re done with all about self-driving cars! Let’s recap the lesson before moving on to the next.
What We Have Learnt
In this lesson, we learned what self-driving cars are, how they work, their importance, and their applications. Then, we learned how to detect signs and landmarks using artificial intelligence, and finally, we made our own self-driving car using Quarky!
In the coming lesson, we’re going to learn what is face recognition, how to transform your existing robot into a vertical robot, and finally, make our robo-pet using Quarky!
See you in the next lesson!