Theory
15. Make Your Own Self-Driving Car
Lesson Overview
Whenever one talks about self-driving cars, s/he cannot do it without talking about the world-famous Tesla cars! But do you know what makes those cars so smart that they’re able to drive on their own?
In this lesson, we’re going to learn exactly that! Then, we’re also going to make our own self-driving car using PictoBlox and Quarky.
Topics Covered
🚗 How do self-driving cars work?
🛣 Advantages of self-driving cars
🧠 How does AI make them smart?
🛠 How to make a self-driving car using Quarky?
Learning Outcomes
1. At the end of this lesson. you’ll be able to:
2. Understand how self-driving cars work.
3. Appreciate the advantages of self-driving cars.
4. Make your own self-driving car and do the decision-making.
🚗 All About Self-Driving Cars – Overview
🤖 Self-driving cars are autonomous vehicles that navigate using sensors and systems.
🚦 They interpret traffic lights, road conditions, pedestrians, and nearby vehicles to make driving decisions.
🌟 Why Self-Driving Cars?
🌈 Once a futuristic dream, self-driving cars are becoming a reality today.
🛡 They aim to reduce road accidents and enhance mobility for the visually impaired.
🚀 Equipped with advanced sensors, these cars navigate safely in hazardous environments, including other planets like Mars.
🧠 How Does AI Make Them Smart?
🕵️♂️ AI enables these vehicles to understand their surroundings and avoid obstacles.
🔄 It can adapt the car’s direction, speed, and even halt to avoid collisions.
🗺 AI suggests the optimal routes based on real-time traffic and weather conditions.
📏 Advanced models can correct the car’s orientation on uneven terrains.
🛠 Applications
🗑 Self-driving cars are transforming into waste collection bots, delivery bots, and farming vehicles.
📍 They utilize sensors to navigate through uneven roads and assist in reverse driving.
🌌 These cars are pivotal in exploring uncharted territories, like Mars.
🚸 Detecting Signs & Landmarks – Overview
📚 Before building a self-driving car with Quarky, it’s crucial to comprehend how it detects signs and landmarks.
🧐 Understanding the Logic
📱 We’ll use a smartphone’s camera for number detection.
🎯 The process is straightforward: show a sign to the camera, and PictoBlox identifies it.
📝 Let’s Code!
🚀 Using the PictoBlox app, we’ll craft this script:
🆕 Open a new project in the PictoBlox App.
➕ Add a “when flag clicked” block from the Events palette into the scripting area.
🎨 Tap the purple-coloured “Add Extension” button in the screen’s bottom-left corner. Then, choose the Recognition Cards extension to integrate it into your project.
Create the script as mentioned below
Now, run the script by clicking the green flag and bring one by one signs and landmarks cards in front of the camera to check whether the script is running perfectly fine.
🚗 Making a Self-Driving Car – Overview 🤖
- Recognize signs and landmarks 🚦
- Perform actions accordingly:
- Go Sign ➡️ Forward
- Turn Left Sign ⬅️ Left
- Turn Right Sign ➡️ Right
- U-Turn Sign ↩️ Backward
- 🔧 Completing the script 🔨
- Start with the previous script 📜
- Create the following script: 🖥️
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.
Multiple Signs
How does a car handle multiple signs?
Create the script as mentioned below.
The main script now looks like this:
Set the signs and run the script to test it.