In a galaxy not too far from here, there is a team called "Greek Coders K12". A home (space) based team that wants to innovate in all areas and to have fun ! Our team was founded in 2015 by our coach as a coding and robotics club !
In this project participate Pola (the coach), Manos (a 15teen years old boy who loves programming), Manto (a 14teen years old girl who likes engineering) and last but not least GC (our new Ev3 robot). Our aim is to learn Python for EV3, create skills for Alexa and have fun!
* the completed consent forms were sent to contests@hackster.io
A. Project Plan- Milestones1/11/2019 - Starting day- What Does the Challenge need
8/11/2019 - Robot Design Choose the corps of our robot: model EV3D4 https://www.lego.com/cdn/cs/set/assets/blt9d825847cfab5c16/EV3D4.pdf(payingtribute to the Greek LEGO designer Vassilis Chrysanthacopoulos)
15/11/2019 Robot Design: robot construction using LEGOEV3core set and expansion set, add a head with nose and mouth! Test ultrasonic sensor.
22/11/2019 Software Installation: Python SD, Visual Studio Code. Test of the ev3 Brick: led, beep, motors.
29/11/2019 Set up Echo device Alexa. Construct an Arm shooter
6/12/2019 Arm shooter construction… Create skills for Alexa (blueprints)
7/12/2019 Arm shooter construction. Python read the documentation.
13/12/2019 Arm shooter failure. Meeting: Redefine goals, problems, new solutions, time management. Installation Python ev3dev to 2 laptops for programming.
14/12/2019 Check submissions. New arm design. Ultrasonic measurements, test medium, large motors, ultrasonic, text to voice.
16/12/2019 mission 01
16/12 mission 02- BLUETOOTH CONNECTION-
- Ask Alexa to play Amazon music- "ALEXA play starWars music".
- EV3 recognizes the tempo of the music and dances.
- Add a finale movement
18/12/2019 mission 03- BLUETOOTH CONNECTION-
- "ALEXA, Open Mindstorms" (Lambda skill <Open mindstorms>).
- Move commands: "move in a circle, move square, right, forward, backwards 2,one shot'' etc.
19/12/2019 Testing missions and Video shooting mission 01, 02, 03
20/12/2019 Starting submission
21/12/2019 Submission, Construct and test a New arm (left), which releases balls
23/12/2019 Submission
24/12/2019 Mission 04
25/12/2019 Check deliverables' list * Merry Christmas! *
26/12/2019 final submission
B. LEGO Robot ConstructionThe major problem we faced in this project was that we could not afford to buy the LEGO Mindstorms EV3 31313 kit.
We decided to enter the competition with a robot made by us. We used parts from our LEGO core set 45544, LEGO expansion set 45560 and the kit from FLL Competition. It was really an exhausting process to look for items in other kits but we did it ! We spent many hours in constructions, failures and redesign.
Robot Design for GC
- Corps from model EV3D4 https://www.lego.com/cdn/cs/set/assets/blt9d825847cfab5c16/EV3D4.pdf
- The head is our design: we added a nose and a smile, because we wanted to give human characteristics to GC.
- We did not have IR sensor, so we put ultrasonic sensor for "eyes".
- We did not have the shooting launcher arm so we decided to construct an arm (left) that releases one or two balls to the intruder (mission 04) with a medium motor.
Pictures from the construction process
We faced problems with Python installation. Some libraries were not recognized. We solved this malfunction by creating a new Python SD image from https://sites.google.com/site/ev3devpython/setting-up-vs-code
http://oss.jfrog.org/list/oss-snapshot-local/org/ev3dev/brickstrap/2019-10-23/
snapshot-ev3dev-stretch-ev3-generic-2019-10-23.img.xz 23-Oct-2019 17:28 229.69 MB
Mission 1: Make your EV3 Brick to react to the Alexa wake word.1) We followed the instructions in
https://www.hackster.io/alexagadgets/lego-mindstorms-voice-challenge-mission-1-f31925
2) Problems- Customizations
- After connection with Alexa we added a welcome message FROM EV3: " Welcome to Python EV3 Alexa" -text to speech-.
3) Scenario
- EV3 and Alexa connection
- a welcome message FROM EV3: " Welcome to Python EV3 Alexa".
- Human voice: “ALEXA” The robot reacts to the (default) wakename by flashing leds
- Human voice: “ALEXA .. Cancel”
4) Python Code
https://www.hackster.io/greekcodersk12/gc-the-robot-with-the-power-of-voice-interaction-2077ed#code : mission-01
5) Video
Mission 2: Make your robot dance to Amazon Music1) Instructions in
2) Problems: We purchased Amazon unlimited. No other music could be recognized by EV3.
3) Scenario
- EV3 and Alexa connection
- Human voice: "ALEXA play starWars music"
- GC robot reacts to the tempo of the music starting with a pose and making movements
- Human voice: "ALEXA stop"
- GC robot makes finale
4) Python Code
https://www.hackster.io/greekcodersk12/gc-the-robot-with-the-power-of-voice-interaction-2077ed#code : mission-02
https://www.hackster.io/code_files/414586/download
5) Video
Mission 3: Make EV3RSTORM move using voice1) Instructions in
2) Problems-customizations
- We changed the parameters in the move commands. Due to our robot construction the "move" on_for_seconds(SpeedPercent(speed), SpeedPercent(speed) moves the robot backwards. So, we changed the sign in the speed parameter.
- In the video we connect a simple medium motor to port A (OUTPUT_A) to test the command One shot. We constructed the arm in mission 04.
3) Scenario
- EV3 and Alexa connection
- Human voice: "ALEXA, Open Mindstorms" (Lambda skill <Open mindstorms>).
- Human voice: "forward 2 seconds, backwards 3 seconds, move in a circle, move square, right, one shot, set speed to 10%''
- Alexa voice: "Move forward activated " etc.
4) Python Code snippet
https://www.hackster.io/greekcodersk12/gc-the-robot-with-the-power-of-voice-interaction-2077ed#code : mission-03-snippet- python code- circle-square
5) Lambda skills
By following the instructions in https://www.hackster.io/alexagadgets/lego-mindstorms-voice-challenge-mission-3-4ed812#toc-mission-3--make-ev3rstorm-move-using-voice-0
- In alexa developer console Build
- Create skill MINDSTORMS
6) Video
Mission 4: Make Alexa react to Robot ultrasonic sensor with an Alexa skill.1) Instructions in https://www.hackster.io/alexagadgets/lego-mindstorms-voice-challenge-mission-4-392a2e
2) Problems-customizations
- We changed the program for an ultrasonic sensor.
- We set the proximity distance to 400mm.
- We changed the way the arm is working. The arm releases 1 or 2 large balls whenever an intruder is detected.
- When the command "Fire all shots" is activated, the robot arm releases the ball(s) and EV3 says "Bang bang bang" -text to speech-.
3) Scenario
- EV3 and Alexa connection
- Human voice "ALEXA, Open Mindstorms" (Lambda skill <Open mindstorms>).
- Alexa voice: "Welcome, voice interface activated"
- Human voice: "ALEXA, activate sentry mode''
- Alexa voice: "Commandset reactivated"
- Alexa voice: "Intruder detected"
- Alexa voice: "What would do you like to do? "
- Human voice: "Fire 1 shot''
- Alexa voice: "command 1 shot activated''
- Alexa voice: "Threat eliminated''
- .... Human voice: "Fire allshots''...
4) Lambda skills
- In alexa developer console Build
- Edit skill MINDSTORMS (overwrite Skill made in mission-03)
- In Interaction Model section
- Update skill files Code
- lambda files: you can find them in Section Attachments
- util.js in https://www.hackster.io/greekcodersk12/gc-the-robot-with-the-power-of-voice-interaction-2077ed#code mission04-util.js
- package.json in https://www.hackster.io/greekcodersk12/gc-the-robot-with-the-power-of-voice-interaction-2077ed#code mission04-package.json
- common.js in https://www.hackster.io/greekcodersk12/gc-the-robot-with-the-power-of-voice-interaction-2077ed#code missions04-common.js
- Event handler:
- index.js (changes for ultrasonic proximity event) in https://www.hackster.io/greekcodersk12/gc-the-robot-with-the-power-of-voice-interaction-2077ed#code mission04-index.js
- Save
- Deploy Skill
5) Python Code
https://www.hackster.io/greekcodersk12/gc-the-robot-with-the-power-of-voice-interaction-2077ed#code : mission-04
- We used the ultrasonic sensor for giving "eyes" to our robot.
- Connect medium motor to port D (OUTPUT_D)
- Initialize ultrasonic
- Change proximity to the distance the ultrasonic sensor detects: a number in mm. The program will send an event to skill if an object is within 40cm (400mm) distance of the sensor.
- Change weapon rotations for our custom arm.
self.weapon.on_for_rotations(SpeedPercent(100), 0.60)
self.weapon.on_for_rotations(SpeedPercent(-100), 0.60)
- When "Fire all", we added a text to speech for EV3 "bang bang bang"
self.sound.speak('Bang bang bang')
6) Execution screenshots
7) Video
Appendix: Files in Visual Studio Coderun the command: tree alexa-gadgets-mindstorms/
We really enjoyed the project! We are going to examine future applications of EV3 and Alexa interaction.
Comments