Hardware components | ||||||
| × | 1 | ||||
| × | 1 | ||||
Software apps and online services | ||||||
| ||||||
| ||||||
| ||||||
| ||||||
|
The project is an innovative solution for preschool children. It helps them master writing and drawing without an instructor in a very playful and exciting way. Teacher, teacher! keeps the students engaged because of its fun and encouraging gestures.
Technology makes any task effective, fun and intriguing. The educator robot is a patient and fun to be with learning companion, which allows the children to learn while they play. Repetition and student engagement, two of the most important preschool learning pedagogies are the basic building principles of the educator robot. It thus makes learning convenient, flexible, engaging and fun.
There are two EV3 bricks connected together using different sensors, one EV3 brick has python as the coding platform while the other has the mindstorms coding platform. Alexa is synced in with the python based EV3 brick which gets the commands as stored in the skill created from the alexa skills kit.
A linkage mechanism in the front of the robot which is connected to the mindstorms coding platform helps to understand the alphabet written or shape drawn using the motor rotation sensor. On evaluating the sensor values the robot understands whether the alphabet written is the same as displayed on the screen. On successful evaluation it hits a touch sensor which is connected to the python based brick that shows the gesture of hurray! meaning the answer is correct.
{
"interactionModel": {
"languageModel": {
"invocationName": "let's learn",
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
"name": "AMAZON.HelpIntent",
"samples": []
},
{
"name": "AMAZON.StopIntent",
"samples": []
},
{
"name": "AMAZON.NavigateHomeIntent",
"samples": []
},
{
"name": "LessonIntent",
"slots": [
{
"name": "number",
"type": "AMAZON.NUMBER",
"samples": [
"lesson five",
"open lesson {number}",
"{number} lesson",
"lesson {number}",
"lesson three",
"lesson two",
"lesson one",
"lesson"
]
}
],
"samples": [
"ask water bottle to open lesson one",
"open lesson {number}",
"{number} lesson",
"lesson {number}",
"lesson three",
"lesson two",
"lesson one",
"lesson"
]
}
],
"types": []
},
"dialog": {
"intents": [
{
"name": "LessonIntent",
"confirmationRequired": false,
"prompts": {},
"slots": [
{
"name": "number",
"type": "AMAZON.NUMBER",
"confirmationRequired": false,
"elicitationRequired": true,
"prompts": {
"elicitation": "Elicit.Slot.1368406247135.116705719181"
}
}
]
}
],
"delegationStrategy": "ALWAYS"
},
"prompts": [
{
"id": "Elicit.Slot.1368406247135.116705719181",
"variations": [
{
"type": "PlainText",
"value": "lesson two selected"
},
{
"type": "PlainText",
"value": "lesson one selected"
},
{
"type": "PlainText",
"value": "Lesson {number} selected"
}
]
}
]
}
}
#!/usr/bin/env python3
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# You may not use this file except in compliance with the terms and conditions
# set forth in the accompanying LICENSE.TXT file.
#
# THESE MATERIALS ARE PROVIDED ON AN "AS IS" BASIS. AMAZON SPECIFICALLY DISCLAIMS, WITH
# RESPECT TO THESE MATERIALS, ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
# THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
import os
import sys
import time
import logging
import json
import random
import threading
from enum import Enum
from agt import AlexaGadget
from ev3dev2.led import Leds
from ev3dev2.sound import Sound
from ev3dev2.motor import OUTPUT_A, OUTPUT_B, OUTPUT_C, MoveTank, SpeedPercent, MediumMotor
# Set the logging level to INFO to see messages from AlexaGadget
logging.basicConfig(level=logging.INFO, stream=sys.stdout, format='%(message)s')
logging.getLogger().addHandler(logging.StreamHandler(sys.stderr))
logger = logging.getLogger(__name__)
class MindstormsGadget(AlexaGadget):
"""
A Mindstorms gadget that performs movement based on voice commands.
Two types of commands are supported, directional movement and preset.
"""
def __init__(self):
"""
Performs Alexa Gadget initialization routines and ev3dev resource allocation.
"""
super().__init__()
# Gadget state
self.patrol_mode = False
# Ev3dev initialization
self.leds = Leds()
self.sound = Sound()
self.drive = MoveTank(OUTPUT_B, OUTPUT_C)
self.weapon = MediumMotor(OUTPUT_A)
# Start threads
def on_connected(self, device_addr):
"""
Gadget connected to the paired Echo device.
:param device_addr: the address of the device we connected to
"""
self.leds.set_color("LEFT", "GREEN")
self.leds.set_color("RIGHT", "GREEN")
logger.info("{} connected to Echo device".format(self.friendly_name))
def on_disconnected(self, device_addr):
"""
Gadget disconnected from the paired Echo device.
:param device_addr: the address of the device we disconnected from
"""
self.leds.set_color("LEFT", "BLACK")
self.leds.set_color("RIGHT", "BLACK")
logger.info("{} disconnected from Echo device".format(self.friendly_name))
def on_custom_mindstorms_gadget_control(self, directive):
"""
Handles the Custom.Mindstorms.Gadget control directive.
:param directive: the custom directive with the matching namespace and name
"""
try:
payload = json.loads(directive.payload.decode("utf-8"))
print("Control payload: {}".format(payload), file=sys.stderr)
control_type = payload["type"]
if control_type == "lesson":
# Expected params: [number]
self._lesson(payload["number"])
if control_type == "command":
# Expected params: [command]
self._activate(payload["command"])
except KeyError:
print("Missing expected parameters: {}".format(directive), file=sys.stderr)
def _lesson(number):
if number in one:
self.weapon.on_for_rotations(SpeedPercent(20), .25)
wait(cond, timeout=2000)
self.weapon.on_for_rotations(SpeedPercent(-20), .25)
if number in two:
self.weapon.on_for_rotations(SpeedPercent(20), .5)
wait(cond, timeout=2000)
self.weapon.on_for_rotations(SpeedPercent(-20), .5)
if number in three:
self.weapon.on_for_rotations(SpeedPercent(20), .75)
wait(cond, timeout=2000)
self.weapon.on_for_rotations(SpeedPercent(-20), .75)
class lesson(Enum):
"""
The list of directional commands and their variations.
These variations correspond to the skill slot values.
"""
ALPHABET = ['lesson one', 'ABCD', 'Alphabets', 'one']
NUMBERS = ['lesson two', 'one two three four', 'numbers', 'two']
SHAPES = ['lesson three', 'Shape','three']
class Direction(Enum):
"""
The list of directional commands and their variations.
These variations correspond to the skill slot values.
"""
FORWARD = ['forward', 'forwards', 'go forward']
BACKWARD = ['back', 'backward', 'backwards', 'go backward']
LEFT = ['left', 'go left']
RIGHT = ['right', 'go right']
STOP = ['stop', 'brake']
ALPHABET = ['lesson one', 'ABCD', 'Alphabets']
NUMBERS = ['lesson two', 'one two three four', 'numbers']
SHAPES = ['lesson three', 'Shape']
class Command(Enum):
"""
The list of preset commands and their invocation variation.
These variations correspond to the skill slot values.
"""
MOVE_CIRCLE = ['circle', 'spin']
MOVE_SQUARE = ['square']
PATROL = ['patrol', 'guard mode', 'sentry mode']
FIRE_ONE = ['cannon', '1 shot', 'one shot']
FIRE_ALL = ['all shot']
if __name__ == '__main__':
gadget = MindstormsGadget()
# Set LCD font and turn off blinking LEDs
os.system('setfont Lat7-Terminus12x6')
gadget.leds.set_color("LEFT", "BLACK")
gadget.leds.set_color("RIGHT", "BLACK")
# Startup sequence
gadget.sound.play_song((('C4', 'e'), ('D4', 'e'), ('E5', 'q')))
gadget.leds.set_color("LEFT", "GREEN")
gadget.leds.set_color("RIGHT", "GREEN")
# Gadget main entry point
gadget.main()
# Shutdown sequence
gadget.sound.play_song((('E5', 'e'), ('C4', 'e')))
gadget.leds.set_color("LEFT", "BLACK")
gadget.leds.set_color("RIGHT", "BLACK")
Comments