Back to Course

Quarky를 사용한 로보틱스 및 AI - 레벨 1

0% Complete
0/0 Steps
  1. 시작하기
    수업 1: 쿼키 로봇과 인사하세요!
    5 Topics
    |
    1 Quiz
  2. 로봇공학
    수업 2: 로봇과 함께하는 재미
    3 Topics
    |
    1 Quiz
  3. 수업 3: 무선 제어 로봇
    3 Topics
  4. 수업 4: 라인 추적 센서
    2 Topics
  5. 수업 5: 로봇을 따라가는 라인
    3 Topics
    |
    1 Quiz
  6. 현실 세계에서 활용 학습
    수업 6: AI 배달 봇으로서의 Quarky - 1부
    3 Topics
  7. 수업 7: AI 배달 봇으로서의 Quarky - 2부
    4 Topics
  8. 수업 8: 나만의 폐기물 수집기 만들기 - 1부
    2 Topics
  9. 수업 9: 나만의 폐기물 수집기 만들기 - 2부
    3 Topics
    |
    1 Quiz
  10. 수업 10: 나만의 자율주행차 만들기
    5 Topics
    |
    1 Quiz
  11. 수업 11: 로봇 애완동물
    4 Topics
  12. 캡스톤 프로젝트
    수업 12: 캡스톤 프로젝트
Lesson Progress
0% Complete

Making a Waste Collector – Overview

It’s time to write the code for our waste-collecting bot. The waste-collecting robot should stop at a checkpoint, identify the type of waste, follow the path, check whether it has reached the correct destination or not without any crashes, and dump the waste.

Let’s set up your arena like this and place your recognition/number cards at the following places.

In this activity, the objective of our robot is to:

  1. Start at the checkpoint
  2. Identify whether the waste is biodegradable or non-biodegradable waste
  3. Follow the line to move forward,
  4. Stop at the checkpoints, and detect the number of cards to check whether it has reached the correct destination for dumping.
  5. Update the status of the dumping by lighting up the LEDs on it when reached.

The robot will start just before checkpoint 3, and then it will do line following until it reaches the following checkpoints.

We’re going to train our waste collector bot to differentiate between the two types of waste that we learned about earlier in this chapter – biodegradable and non-biodegradable; we’re going to use paper as an example of biodegradable waste and a battery as e-waste or non-biodegradable waste.

Once it detects the type of waste, it should dump it at its designated place.

Now let’s write the code using this logic.

Let’s Code

We’re going to use the PictoBlox app to make this script.

Identifying the Type of Waste

Let’s first make the script for detecting the type of waste. Follow the steps below:

  1. Open a new project in the PictoBlox app.
  2. Add a when flag clicked block from the Events palette into the scripting area.
  3. Next, tap the purple-colored Add Extension button in the screen’s bottom-left corner. Then, select the Machine Learning extension to add it to your palette.
  4. Click the Load Model button.
    Load Model Button
  5. A model will open. Paste the link and click the Upload button.
    Load Model
  6. The relevant blocks will appear in the palette when the model is loaded successfully.
  7. Add a turn () video on stage with () transparency block from the Machine Learning palette below the when flag clicked block. on is the default option selected from the drop-down and 0 is the default transparency. We’re going to keep it that way. This block will turn on the camera of your Smartphone.
  8. Add a wait for () seconds block from the Control palette.
  9. Next, add a wait until () block. Add a not () block from the Operators palette inside the white space.
  10. Add a is identified class from () is () ? block from the Machine Learning palette inside the not () block. The complete wait until () block will ensure that the robot doesn’t perform any action from the script if it doesn’t detect anything.
  11. Now, go to the Variables palette and make a variable named Waste. We’re going to use it to check the type of waste that Quarky detects.
  12. Add a set () to () block from the Variables palette. Waste is selected as the default option from the drop-down. Add a identify class from () block from the Machine Learning palette in the white space. This will set the value of the Waste variable as the ‘class’ of the waste detected by Quarky.Now, let’s check whether the waste detected is paper, i.e. biodegradable, or not.
  13. To check if the waste detected is paper, add an if block from the Control palette below the set () to () block.
  14. Add an () = () block from the Operators palette inside the diamond-shaped space of the if block.  Inside the first space, add the Waste variable block. Add a (Paper) block from the Machine Learning palette inside the second space. This will check if the detected waste is paper or not. If it is paper, then the script will execute the blocks below the if arm.
  15. Below the if arm, add a display matrix as () block and fill the matrix with green color.
  16. Now to check whether the waste is a battery a.k.a the e-waste, then duplicate the above if arm.
  17. Select Battery from the drop-down into the if arm.
  18. And set the color in the display matrix as () block as blue.

Check the script till now:

  1. Paper Waste:
  2. E-Waste: