SlideShare a Scribd company logo
1 of 18
Teaching Method and Flexible Tools
MATERIALS FOR STUDENTS
ACTIVITIES GROUP 6 –
(SECONDARY LEVEL)
This project has been funded with support from the European Commission. This
publication reflects the views only of the author, and the Commission cannot be
held responsible for any use which may be made of the information contained
therein
Programming Nao,
a humanoid robot
Speech, Motion, Parallel processing, Loops, Subprograms
Boštjan Resinovič, School Center Celje
Nao
 humanoid robot made by Aldebaran
(now Softbank)
 movement
 face and object detection and
recognition
 speech synthesis and recognition in
multiple languages
 web interaction
 can be programmed in a dedicated
visual programing language
Choregraphe and in several text
based languages (Python, C++, …)
Installing Choregraphe
 you can download the trial version at
https://developer.softbankrobotics.com/us-en/downloads/nao-v5-v4
 you can register as a developer and receive a free lifelong license at
https://community.ald.softbankrobotics.com/en/developerprogram
1. Sign in, Create new account, logout
2. login at the above URL again, fill in the questionnaire (if it doesn‘t show up, click
Join)
3. choose Resources and then Software, select NAO as your robot and download
Choregraphe (carefull, if you don‘t select NAO, the version for Pepper, a different
robot, will be downloaded)
4. install Choregraphe using the licence number you received by email when you
joined the Developer (step 2)
Using Choregraphe
 Choregraphe automatically connects to a VIRTUAL ROBOT if you don‘t have a real
one, so you will be able to do A LOT of things with Nao even if you don‘t have one
at all!
Using Choregraphe
 Commands are represented by boxes.
 Boxes are located in the Box Libraries (left bottom panel).
 Programs are written by placing boxes in the main panel (central panel) and
connecting them with lines indicating the program flow.
 Commands are executed from left to right (boxes have inputs on the left and
outputs on the right).
 Programs are triggered by clicking on the green arrow in the tool bar and
stopped by clicking the red square in the tool bar (or when they‘re finished).
 The robot‘s (a real or virtual one‘s) movement is animated in the Robot View
(right bottom panel).
 The robot‘s speech and user input are available through the Dialog (bottom
right panel).
 If any of the panels are not visible, they can be shown through the View
menu.
Let‘s do some squats
 Let‘s try to program the robot to do some squats and count them.
 Motivation:
 learn to work with a humanoid robot and simultaneously learn lessons in computer
programming
 working with Nao is fun, so programming can be fun as well
 Goals:
 learn some basic commands to make the robot speak and move
 make the robot do more than one thing at the same time (parallelism)
 perform actions multiple times (loops)
 place some code in a custom box (subprograms)
Basics – speech and motion
 Let‘s start with doing only one squat.
 Write and run the following program:
 the robot should fist stand up if necessary
 the language is set to English (click on the wrench)
 the robot says: „Ok, doing my one and only squat.“ (double click on the Say box, choose
English and write the text)
 the robot does a squat (crouch with the Rest box and Stand Up again)
 at the end it says „That was hard. I've had enough!“
 Observe the Dialog and the Robot View panels.
Parallelism
 Let‘s move the first Say box so the robot will do a squat and speak at the same
time.
 Run the program and observe the Dialog and the Robot View panels.
 What happened and why?
Parallelism
 The second Say box is triggered as soon as the first signal reaches it.
 Saying „Ok, doing my one and only squat.“ takes much less time then doing a squat.
 So the robot says „That was hard. I've had enough!“ before the squat is completed!
 Immediately after that the program ends and the robot still hasn‘t finished doing the
squat!
 In parallel processing SYNCHRONIZATION is often needed!
Parallelism
 Let‘s add the Wait For Signals box to synchronize the speech and movement
of the robot.
 Run the program and observe the Dialog and the Robot View panels.
Repetition (loops)
 In order to repeat actions several times loops are used in programming
languages.
 In Choregraphe we can use the Counter box:
 two inputs (squares on the left of the box)
 the upper one increases the counter by one,
 the lower one reinitializes the counter
 two outputs (squares on the right of the box)
 the upper one outputs the current number,
 the lower one is triggered when the loop ends (the current number exceeds the final value)
 parameters (accessible by clicking the wrench)
 initial and final value
 step
 example: initial=4, final=10, step=2 => we count like this: 4, 6, 8, 10
Repetition (loops)
 Let‘s write a program in which the robot will do five squats and count them.
 the robot says „Hello, I will do five squats.“
 the robot does a squat in a loop that will repeat five times
 the Counter controls the number of repetitions (initial=1, final=5, step=1)
 the current number from the counter is passed to the Say Text box and it stimulates the
robot‘s motion
 after a squat is done and the number pronounced the Wait For Signals returns the control
to the Counter box which determines whether to do another repetition or finish
 when the counting is finished (the robot has done five squats), the robot says
„That was hard. I've had enough!“
Repetition (loops)
Subprograms
 Let‘s create a new custom box Squat&Count which
 represents a subprogram containing the complete code for a squat
 hides the details and thus increases readability
 offers usage of the new box many times (even in other programs)
 Select the four boxes, right click and select Convert to box
Subprograms
 The final code now contains everything it had before but some of the code is
in a subprogram (nested in a new box).
 The subprogram‘s code can be seen by double clicking the Squat&Count box.
 Clicking the root box brings us back to the main program (top level of code).
The result
What we learned
 robot specific
 speech
 movement
 general computer programming
 parallel processing
 synchronization
 loops
 subprograms

More Related Content

What's hot

Inspiring Kids to Code Using Scratch and Other Tools
Inspiring Kids to Code Using Scratch and Other ToolsInspiring Kids to Code Using Scratch and Other Tools
Inspiring Kids to Code Using Scratch and Other ToolsSt. Petersburg College
 
Fostering Creative and Critical Thinking using iPads in Primary Mathematics
Fostering Creative and Critical Thinking using iPads in Primary MathematicsFostering Creative and Critical Thinking using iPads in Primary Mathematics
Fostering Creative and Critical Thinking using iPads in Primary MathematicsJoanne Villis
 
Approaches to teaching primary computing
Approaches to teaching primary computingApproaches to teaching primary computing
Approaches to teaching primary computingJEcomputing
 
Coding for Teachers and Kids Workshop Presentation
Coding for Teachers and Kids Workshop PresentationCoding for Teachers and Kids Workshop Presentation
Coding for Teachers and Kids Workshop PresentationJoanne Villis
 
Coding: the smart future for our kids - Chau Au
Coding: the smart future for our kids - Chau AuCoding: the smart future for our kids - Chau Au
Coding: the smart future for our kids - Chau AuPublicLibraryServices
 
Baleap tel sig conference slides
Baleap tel sig conference slidesBaleap tel sig conference slides
Baleap tel sig conference slidesPhil Longwell
 
Getting students to collaborate in Breakout Rooms in Remote Teaching
Getting students to collaborate in Breakout Rooms in Remote TeachingGetting students to collaborate in Breakout Rooms in Remote Teaching
Getting students to collaborate in Breakout Rooms in Remote TeachingPhil Longwell
 
iPads and the primary computing curriculum
iPads and the primary computing curriculumiPads and the primary computing curriculum
iPads and the primary computing curriculumJEcomputing
 
Raspberry Pi and Python Case Study
Raspberry Pi and Python Case StudyRaspberry Pi and Python Case Study
Raspberry Pi and Python Case StudySilvia Tinena Coris
 
Web2.0 tools affordances for education
Web2.0 tools affordances for educationWeb2.0 tools affordances for education
Web2.0 tools affordances for educationJon Crellin
 
Getting Started with Screencasting
Getting Started with ScreencastingGetting Started with Screencasting
Getting Started with Screencastingrubiales 62
 

What's hot (16)

Inspiring Kids to Code Using Scratch and Other Tools
Inspiring Kids to Code Using Scratch and Other ToolsInspiring Kids to Code Using Scratch and Other Tools
Inspiring Kids to Code Using Scratch and Other Tools
 
Fostering Creative and Critical Thinking using iPads in Primary Mathematics
Fostering Creative and Critical Thinking using iPads in Primary MathematicsFostering Creative and Critical Thinking using iPads in Primary Mathematics
Fostering Creative and Critical Thinking using iPads in Primary Mathematics
 
Approaches to teaching primary computing
Approaches to teaching primary computingApproaches to teaching primary computing
Approaches to teaching primary computing
 
Coding for Teachers and Kids Workshop Presentation
Coding for Teachers and Kids Workshop PresentationCoding for Teachers and Kids Workshop Presentation
Coding for Teachers and Kids Workshop Presentation
 
Coding: the smart future for our kids - Chau Au
Coding: the smart future for our kids - Chau AuCoding: the smart future for our kids - Chau Au
Coding: the smart future for our kids - Chau Au
 
Uwcsea day 1v2
Uwcsea day 1v2Uwcsea day 1v2
Uwcsea day 1v2
 
Coding with kids
Coding with kidsCoding with kids
Coding with kids
 
Baleap tel sig conference slides
Baleap tel sig conference slidesBaleap tel sig conference slides
Baleap tel sig conference slides
 
Getting students to collaborate in Breakout Rooms in Remote Teaching
Getting students to collaborate in Breakout Rooms in Remote TeachingGetting students to collaborate in Breakout Rooms in Remote Teaching
Getting students to collaborate in Breakout Rooms in Remote Teaching
 
iPads and the primary computing curriculum
iPads and the primary computing curriculumiPads and the primary computing curriculum
iPads and the primary computing curriculum
 
Groupboard
GroupboardGroupboard
Groupboard
 
presentation4
presentation4presentation4
presentation4
 
Raspberry Pi and Python Case Study
Raspberry Pi and Python Case StudyRaspberry Pi and Python Case Study
Raspberry Pi and Python Case Study
 
Web2.0 tools affordances for education
Web2.0 tools affordances for educationWeb2.0 tools affordances for education
Web2.0 tools affordances for education
 
Getting Started with Screencasting
Getting Started with ScreencastingGetting Started with Screencasting
Getting Started with Screencasting
 
Technology 101
Technology 101Technology 101
Technology 101
 

Similar to Coding io1--materials for students-group6

Getting Started with Robotics
Getting Started with RoboticsGetting Started with Robotics
Getting Started with Roboticss0133116
 
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docxpaynetawnya
 
Module 5 task 1 laura vilar
Module 5 task 1 laura vilarModule 5 task 1 laura vilar
Module 5 task 1 laura vilarLaura Vilar
 
Introduction to flowcharts and algorithms
Introduction to flowcharts and algorithmsIntroduction to flowcharts and algorithms
Introduction to flowcharts and algorithmsasrctw
 
Introducing small basic
Introducing small basicIntroducing small basic
Introducing small basicSara Samol
 
SoMachine 4.1 quickstart
SoMachine 4.1 quickstartSoMachine 4.1 quickstart
SoMachine 4.1 quickstartJulien Dubois
 
Using Python inside Programming Without Coding Technology (PWCT) Environment
Using Python inside Programming Without Coding Technology (PWCT) EnvironmentUsing Python inside Programming Without Coding Technology (PWCT) Environment
Using Python inside Programming Without Coding Technology (PWCT) EnvironmentMahmoud Samir Fayed
 
Mastering python lesson2
Mastering python lesson2Mastering python lesson2
Mastering python lesson2Ruth Marvin
 
IT PROJECT.pptx
IT PROJECT.pptxIT PROJECT.pptx
IT PROJECT.pptxsamnanda6
 
Boo Manifesto
Boo ManifestoBoo Manifesto
Boo Manifestohu hans
 
Mastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loopsMastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loopsRuth Marvin
 
Introducing small basic
Introducing small basicIntroducing small basic
Introducing small basicAn I
 
Presentation of programming languages for beginners
Presentation of programming languages for beginnersPresentation of programming languages for beginners
Presentation of programming languages for beginnersClement Levallois
 

Similar to Coding io1--materials for students-group6 (20)

Getting Started with Robotics
Getting Started with RoboticsGetting Started with Robotics
Getting Started with Robotics
 
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
 
Module 5 task 1 laura vilar
Module 5 task 1 laura vilarModule 5 task 1 laura vilar
Module 5 task 1 laura vilar
 
Introductoin to Python.ppt
Introductoin to Python.pptIntroductoin to Python.ppt
Introductoin to Python.ppt
 
Introduction to flowcharts and algorithms
Introduction to flowcharts and algorithmsIntroduction to flowcharts and algorithms
Introduction to flowcharts and algorithms
 
Introducing small basic
Introducing small basicIntroducing small basic
Introducing small basic
 
SoMachine 4.1 quickstart
SoMachine 4.1 quickstartSoMachine 4.1 quickstart
SoMachine 4.1 quickstart
 
Introducing Small Basic.pdf
Introducing Small Basic.pdfIntroducing Small Basic.pdf
Introducing Small Basic.pdf
 
Using Python inside Programming Without Coding Technology (PWCT) Environment
Using Python inside Programming Without Coding Technology (PWCT) EnvironmentUsing Python inside Programming Without Coding Technology (PWCT) Environment
Using Python inside Programming Without Coding Technology (PWCT) Environment
 
Mastering python lesson2
Mastering python lesson2Mastering python lesson2
Mastering python lesson2
 
RobotStudiopp.ppt
RobotStudiopp.pptRobotStudiopp.ppt
RobotStudiopp.ppt
 
ie450RobotStudio.ppt
ie450RobotStudio.pptie450RobotStudio.ppt
ie450RobotStudio.ppt
 
IT PROJECT.pptx
IT PROJECT.pptxIT PROJECT.pptx
IT PROJECT.pptx
 
ForLoops.pptx
ForLoops.pptxForLoops.pptx
ForLoops.pptx
 
Boo Manifesto
Boo ManifestoBoo Manifesto
Boo Manifesto
 
Mastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loopsMastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loops
 
Introducing small basic
Introducing small basicIntroducing small basic
Introducing small basic
 
Lab a
Lab aLab a
Lab a
 
Moreno Xec
Moreno XecMoreno Xec
Moreno Xec
 
Presentation of programming languages for beginners
Presentation of programming languages for beginnersPresentation of programming languages for beginners
Presentation of programming languages for beginners
 

More from Georgeta Manafu (20)

Formular sel Tr Ankara
Formular sel  Tr AnkaraFormular sel  Tr Ankara
Formular sel Tr Ankara
 
Formular sel Mk
Formular sel MkFormular sel Mk
Formular sel Mk
 
Linkommunity C3
Linkommunity C3Linkommunity C3
Linkommunity C3
 
Gantt MY CODE SIBLING - MYCODESIB
Gantt MY CODE SIBLING - MYCODESIBGantt MY CODE SIBLING - MYCODESIB
Gantt MY CODE SIBLING - MYCODESIB
 
Ppt new werd - en
Ppt   new werd - enPpt   new werd - en
Ppt new werd - en
 
newWERD
newWERDnewWERD
newWERD
 
Ppt newWERD
Ppt   newWERDPpt   newWERD
Ppt newWERD
 
Linkommunity poster
Linkommunity posterLinkommunity poster
Linkommunity poster
 
Activ martie mai 2019-en
Activ martie mai 2019-enActiv martie mai 2019-en
Activ martie mai 2019-en
 
Formular draft
Formular   draftFormular   draft
Formular draft
 
Bb11ee109(1)
Bb11ee109(1)Bb11ee109(1)
Bb11ee109(1)
 
B9ae6301
B9ae6301B9ae6301
B9ae6301
 
Report on the monitoring of student safety and security in school
Report on the monitoring of student safety and security in schoolReport on the monitoring of student safety and security in school
Report on the monitoring of student safety and security in school
 
Formular C1
Formular   C1Formular   C1
Formular C1
 
Turbine eoliene ilie tradus
Turbine eoliene ilie tradusTurbine eoliene ilie tradus
Turbine eoliene ilie tradus
 
Razele x tradus
Razele x tradusRazele x tradus
Razele x tradus
 
Radiatii nucleare-padureanu tradus
Radiatii nucleare-padureanu  tradusRadiatii nucleare-padureanu  tradus
Radiatii nucleare-padureanu tradus
 
Panouri solare tradus
Panouri solare tradusPanouri solare tradus
Panouri solare tradus
 
Dozimetrul(1)
Dozimetrul(1)Dozimetrul(1)
Dozimetrul(1)
 
Dozimetrul en
Dozimetrul enDozimetrul en
Dozimetrul en
 

Recently uploaded

9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 

Recently uploaded (20)

9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 

Coding io1--materials for students-group6

  • 1. Teaching Method and Flexible Tools MATERIALS FOR STUDENTS ACTIVITIES GROUP 6 – (SECONDARY LEVEL) This project has been funded with support from the European Commission. This publication reflects the views only of the author, and the Commission cannot be held responsible for any use which may be made of the information contained therein
  • 2. Programming Nao, a humanoid robot Speech, Motion, Parallel processing, Loops, Subprograms Boštjan Resinovič, School Center Celje
  • 3. Nao  humanoid robot made by Aldebaran (now Softbank)  movement  face and object detection and recognition  speech synthesis and recognition in multiple languages  web interaction  can be programmed in a dedicated visual programing language Choregraphe and in several text based languages (Python, C++, …)
  • 4. Installing Choregraphe  you can download the trial version at https://developer.softbankrobotics.com/us-en/downloads/nao-v5-v4  you can register as a developer and receive a free lifelong license at https://community.ald.softbankrobotics.com/en/developerprogram 1. Sign in, Create new account, logout 2. login at the above URL again, fill in the questionnaire (if it doesn‘t show up, click Join) 3. choose Resources and then Software, select NAO as your robot and download Choregraphe (carefull, if you don‘t select NAO, the version for Pepper, a different robot, will be downloaded) 4. install Choregraphe using the licence number you received by email when you joined the Developer (step 2)
  • 5. Using Choregraphe  Choregraphe automatically connects to a VIRTUAL ROBOT if you don‘t have a real one, so you will be able to do A LOT of things with Nao even if you don‘t have one at all!
  • 6. Using Choregraphe  Commands are represented by boxes.  Boxes are located in the Box Libraries (left bottom panel).  Programs are written by placing boxes in the main panel (central panel) and connecting them with lines indicating the program flow.  Commands are executed from left to right (boxes have inputs on the left and outputs on the right).  Programs are triggered by clicking on the green arrow in the tool bar and stopped by clicking the red square in the tool bar (or when they‘re finished).  The robot‘s (a real or virtual one‘s) movement is animated in the Robot View (right bottom panel).  The robot‘s speech and user input are available through the Dialog (bottom right panel).  If any of the panels are not visible, they can be shown through the View menu.
  • 7. Let‘s do some squats  Let‘s try to program the robot to do some squats and count them.  Motivation:  learn to work with a humanoid robot and simultaneously learn lessons in computer programming  working with Nao is fun, so programming can be fun as well  Goals:  learn some basic commands to make the robot speak and move  make the robot do more than one thing at the same time (parallelism)  perform actions multiple times (loops)  place some code in a custom box (subprograms)
  • 8. Basics – speech and motion  Let‘s start with doing only one squat.  Write and run the following program:  the robot should fist stand up if necessary  the language is set to English (click on the wrench)  the robot says: „Ok, doing my one and only squat.“ (double click on the Say box, choose English and write the text)  the robot does a squat (crouch with the Rest box and Stand Up again)  at the end it says „That was hard. I've had enough!“  Observe the Dialog and the Robot View panels.
  • 9. Parallelism  Let‘s move the first Say box so the robot will do a squat and speak at the same time.  Run the program and observe the Dialog and the Robot View panels.  What happened and why?
  • 10. Parallelism  The second Say box is triggered as soon as the first signal reaches it.  Saying „Ok, doing my one and only squat.“ takes much less time then doing a squat.  So the robot says „That was hard. I've had enough!“ before the squat is completed!  Immediately after that the program ends and the robot still hasn‘t finished doing the squat!  In parallel processing SYNCHRONIZATION is often needed!
  • 11. Parallelism  Let‘s add the Wait For Signals box to synchronize the speech and movement of the robot.  Run the program and observe the Dialog and the Robot View panels.
  • 12. Repetition (loops)  In order to repeat actions several times loops are used in programming languages.  In Choregraphe we can use the Counter box:  two inputs (squares on the left of the box)  the upper one increases the counter by one,  the lower one reinitializes the counter  two outputs (squares on the right of the box)  the upper one outputs the current number,  the lower one is triggered when the loop ends (the current number exceeds the final value)  parameters (accessible by clicking the wrench)  initial and final value  step  example: initial=4, final=10, step=2 => we count like this: 4, 6, 8, 10
  • 13. Repetition (loops)  Let‘s write a program in which the robot will do five squats and count them.  the robot says „Hello, I will do five squats.“  the robot does a squat in a loop that will repeat five times  the Counter controls the number of repetitions (initial=1, final=5, step=1)  the current number from the counter is passed to the Say Text box and it stimulates the robot‘s motion  after a squat is done and the number pronounced the Wait For Signals returns the control to the Counter box which determines whether to do another repetition or finish  when the counting is finished (the robot has done five squats), the robot says „That was hard. I've had enough!“
  • 15. Subprograms  Let‘s create a new custom box Squat&Count which  represents a subprogram containing the complete code for a squat  hides the details and thus increases readability  offers usage of the new box many times (even in other programs)  Select the four boxes, right click and select Convert to box
  • 16. Subprograms  The final code now contains everything it had before but some of the code is in a subprogram (nested in a new box).  The subprogram‘s code can be seen by double clicking the Squat&Count box.  Clicking the root box brings us back to the main program (top level of code).
  • 18. What we learned  robot specific  speech  movement  general computer programming  parallel processing  synchronization  loops  subprograms