SlideShare une entreprise Scribd logo
1  sur  48
Télécharger pour lire hors ligne
Crea il computer di bordo
per la tua astronave
Cristian Maglie
c.maglie@bug.st
http://bug.st/

Arduino
http://arduino.cc/
Notizie sull'autore
• Programmatore freelance
• Entusiasta utilizzatore di tutte le tecnologie open-
  source
• Appassionato di elettronica, collabora con il progetto
  Arduino da più di 3 anni
• Attore consumato degli spot del codemotion
• NON è un fan accanito di Star-Trek (anche se dopo il
  seminario la penserete diversamente)

                                                                  Cristian Maglie    2
                                     c.maglie@bug.st – Arduino (http://arduino.cc)
Introduzione




                                        Cristian Maglie    3
           c.maglie@bug.st – Arduino (http://arduino.cc)
Interfacce utente
• Dispositivo fisico o virtuale che permette la
  comunicazione tra due o più entità di tipo
  diverso
• Schermo, tastiera sono interfacce ma anche
  telefono, fotocopiatrice, televisione
• Sono tutti supporti materiali che permettono
  l'interazione tra informazione “digitalizzata” e il
  mondo ordinario
                                                               Cristian Maglie    4
                                  c.maglie@bug.st – Arduino (http://arduino.cc)
Schermi Piatti




                                              Cristian Maglie    5
                 c.maglie@bug.st – Arduino (http://arduino.cc)
Touch Screen




                                            Cristian Maglie    6
               c.maglie@bug.st – Arduino (http://arduino.cc)
Cellulare




                                         Cristian Maglie    7
            c.maglie@bug.st – Arduino (http://arduino.cc)
Tablet




                                      This iPad
                                    Is wonderful!




                                      Cristian Maglie    8
         c.maglie@bug.st – Arduino (http://arduino.cc)
Interfacce
        (come siamo abituati a vederle)

            Tastiera            Monitor
INPUT                                                          OUTPUT
             Mouse
                       CPU
              Pad                LCD


                       Screen
                       Touch




                                                             Cristian Maglie    9
                                c.maglie@bug.st – Arduino (http://arduino.cc)
Evoluzione delle interfacce
• Tende ad aumentare l'intimità tra utente e
  macchina
• L'interfaccia del futuro sarà eterea: l'utente
  non si accorgerà della sua esistenza




                                                             Cristian Maglie    10
                                c.maglie@bug.st – Arduino (http://arduino.cc)
Cristian Maglie    11
c.maglie@bug.st – Arduino (http://arduino.cc)
Riconoscimento Vocale




                                            Cristian Maglie    12
               c.maglie@bug.st – Arduino (http://arduino.cc)
Interfacce

        Tastiera              Monitor
INPUT                                                          OUTPUT
         Mouse
                      CPU
          Pad                    LCD


                     Screen
                     Touch




                                                             Cristian Maglie    13
                                c.maglie@bug.st – Arduino (http://arduino.cc)
Interfacce

INPUT           Speech
                                                                       OUTPUT
                                      TTS
        Mic
              Recognition
                            CPU   Text To Speech
                                                         Spk




                                                                     Cristian Maglie    14
                                        c.maglie@bug.st – Arduino (http://arduino.cc)
Comando vocale
•   Problemi di sicurezza e identificazione
•   Comandi errati o falsi riconoscimenti
•   Rumore o voci sovrapposte
•   Indecisione nell'esporre il comando



                                                           Cristian Maglie    15
                              c.maglie@bug.st – Arduino (http://arduino.cc)
Riconoscimento vocale
•   Android / Google API
•   iPhone
•   Vbot
•   CMU Sphinx



                                                        Cristian Maglie    16
                           c.maglie@bug.st – Arduino (http://arduino.cc)
Speech Input API (Android)

É la libreria sviluppata da google per
fornire i dispositivi Android del
riconoscimento vocale.




                                                                      Cristian Maglie    17
                                         c.maglie@bug.st – Arduino (http://arduino.cc)
Speech Input API (Android)
  PRO
• Riconoscimento vocale: ottimo
• Sintesi vocale: buona, migliorabile in alcuni casi
• Localizzazione in parecchie lingue
• Open API: molto semplice da utilizzare




                                                                   Cristian Maglie    18
                                      c.maglie@bug.st – Arduino (http://arduino.cc)
Speech Input API (Android)
  CONTRO
• Richiede connessione a internet




                                                                 Cristian Maglie    19
                                    c.maglie@bug.st – Arduino (http://arduino.cc)
Online Speech Recognition
                                                                            Google
                                 Internet                                   services



                   voice
Recognize Speech
                             Android OS
     Intent
                   “Hello”

                                                                       Cristian Maglie    20
                                          c.maglie@bug.st – Arduino (http://arduino.cc)
Speech Input API (Android)
  CONTRO
• Richiede connessione a internet




                                                                 Cristian Maglie    21
                                    c.maglie@bug.st – Arduino (http://arduino.cc)
Speech Input API (Android)
  CONTRO
• Richiede connessione a internet
• Problemi privacy




                                                                 Cristian Maglie    22
                                    c.maglie@bug.st – Arduino (http://arduino.cc)
Online Speech Recognition
                                                                            Google
                                 Internet                                   services



                   voice
Recognize Speech
                             Android OS
     Intent
                   “Hello”

                                                                       Cristian Maglie    23
                                          c.maglie@bug.st – Arduino (http://arduino.cc)
Online Speech Recognition
                                                           Google
                                                           services
Logs
             24/03/2012 15.34
               Cristian said:
                  “Hello”




                                                      Cristian Maglie    24
                         c.maglie@bug.st – Arduino (http://arduino.cc)
Speech Input API (Android)
http://android-developers.blogspot.it/2010/03/speech-input-api-for-android.html
          Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
          intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getClass()
                        .getPackage().getName());
          intent.putExtra(RecognizerIntent.EXTRA_PROMPT,
                        "Speech recognition demo");
          intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
                        RecognizerIntent.LANGUAGE_MODEL_FREE_FORM );
          intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 5);

          if (!mSupportedLanguageView.getSelectedItem().toString().equals(
                        "Default")) {
                 intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE,
                               mSupportedLanguageView.getSelectedItem().toString());
          }
          startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);



                                                                                                   Cristian Maglie    25
                                                                      c.maglie@bug.st – Arduino (http://arduino.cc)
Speech Input API (Android)
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
       if (requestCode == VOICE_RECOGNITION_REQUEST_CODE
                    && resultCode == RESULT_OK) {

             List<String> matches =
                  intent.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);

             doSomethingWithVoiceCommands( matches );
      }
}




                                                                                                       Cristian Maglie    26
                                                                          c.maglie@bug.st – Arduino (http://arduino.cc)
Speech Input API (Android)
boolean TTSReady = false;
TextToSpeech mTTS = new TextToSpeech(this, new OnInitListener() {
      @Override
      public void onInit(int status) {
             TTSReady = true;
      }
});


[…......]


mTTs.speak(“Ciao”, TextToSpeech.QUEUE_FLUSH, null);




                                                                                          Cristian Maglie    27
                                                             c.maglie@bug.st – Arduino (http://arduino.cc)
Siri (iPhone)
• É il software sviluppato
  da Apple per aggiungere
  il supporto all'input
  vocale ai suoi nuovi
  dispositivi


                                                          Cristian Maglie    28
                             c.maglie@bug.st – Arduino (http://arduino.cc)
Siri (iPhone)
  PRO
• Riconoscimento vocale: ottimo
• Sintesi vocale: ottima
• Ottima integrazione con le funzioni del telefono
  (calendar, sms, weather, clock, etc.)




                                                                  Cristian Maglie    29
                                     c.maglie@bug.st – Arduino (http://arduino.cc)
Siri (iPhone)
  CONTRO
• Richiede connessione internet
• Problemi privacy
• Localizzazione ancora mancante per parecchie lingue
• Closed source
• Closed API, non esiste documentazione per lo
  sviluppatore, per poterlo programmare bisogna
  hackerare il dispositivo
                                                                Cristian Maglie    30
                                   c.maglie@bug.st – Arduino (http://arduino.cc)
Siri (iPhone)



Non può essere utilizzato
   per i nostri scopi



                                              Cristian Maglie    31
                 c.maglie@bug.st – Arduino (http://arduino.cc)
EasyVR Vbot
           http://www.veear.eu/Products/EasyVR.aspx

É un co-processore in grado di
effettuare la speech recognition.
Permette di dotare di controllo
vocale piccoli sistemi embedded.




                                                                    Cristian Maglie    32
                                       c.maglie@bug.st – Arduino (http://arduino.cc)
Vbot
                              UART
       ARDUINO                                            Vbot


CMD_LANGUAGE     'l'   // set language <1>
CMD_TIMEOUT      'o'   // set timeout <1>
CMD_RECOG_SI     'i'   // recog trigger word <1>
CMD_TRAIN_SD     't'   // train sd command at group
CMD_GROUP_SD     'g'   // insert new command at group
CMD_UNGROUP_SD   'u'   // remove command at group

                                                     Cristian Maglie    33
                        c.maglie@bug.st – Arduino (http://arduino.cc)
Vbot
  PRO
• Riconoscimento vocale: ottimo
• Funziona offline: il riconoscimento avviene sul
  dispositivo
• Riconoscimento vocale continuo
• Segnale audio di “parola riconosciuta”



                                                                  Cristian Maglie    34
                                     c.maglie@bug.st – Arduino (http://arduino.cc)
VRobot
  CONTRO
• Sintesi vocale assente
• Riconoscimento basato su vocabolario, non permette il
  riconoscimento di testo libero
• Closed source




                                                                Cristian Maglie    35
                                   c.maglie@bug.st – Arduino (http://arduino.cc)
CMU Sphinx
          http://cmusphinx.sourceforge.net/
• Engine di speech recognition sviluppato
  dalla Carnage Mellon University




                                                               Cristian Maglie    36
                                  c.maglie@bug.st – Arduino (http://arduino.cc)
CMU Sphinx
• Esiste una versione light dell'engine
  (pocketsphinx) che può essere utilizzata
  su dispositivi embedded
• Sì può sfruttare JNI per realizzare un
  wrapper Java che fornisce la speech
  recognition utilizzando pocketsphinx
  dentro Android
                                                        Cristian Maglie    37
                           c.maglie@bug.st – Arduino (http://arduino.cc)
Recognize Speech Intents multipli su
        piattaforma Android

 Recognize Speech
                      Google API
      Intent

                     CMU Sphinx




                                                    Cristian Maglie    38
                       c.maglie@bug.st – Arduino (http://arduino.cc)
CMU Sphinx
  PRO
• Riconoscimento vocale: buono
• Sintesi vocale: ottima
• Funzionamento offline
• Riconoscimento vocale continuo
• Open API in C e Java
• Open Source

                                                                Cristian Maglie    39
                                   c.maglie@bug.st – Arduino (http://arduino.cc)
CMU Sphinx
  CONTRO
• Localizzazione ancora limitata
• Documentazione poco aggiornata
• API molto potenti, ma di utilizzo non immediato
• Installazione complessa




                                                                 Cristian Maglie    40
                                    c.maglie@bug.st – Arduino (http://arduino.cc)
Cristian Maglie    41
c.maglie@bug.st – Arduino (http://arduino.cc)
Interconnessione




                                          Cristian Maglie    42
             c.maglie@bug.st – Arduino (http://arduino.cc)
Interconnessione
• Oggetti fisici possono essere connessi
• Internet-of-Things




                                                         Cristian Maglie    43
                            c.maglie@bug.st – Arduino (http://arduino.cc)
Interconnessione
      INPUT     Voice    OUTPUT
                Device




Device A                        Device B

                                                       Cristian Maglie    44
                          c.maglie@bug.st – Arduino (http://arduino.cc)
Interconnesione
• Varie modalità di interconnessione (BT,
  RS232, WiFi, Ethernet, Zigbee e chi più
  ne ha più ne metta)
• Dispositivi Ethernet / Wifi sempre più
  diffusi e meno costosti


                                                        Cristian Maglie    45
                           c.maglie@bug.st – Arduino (http://arduino.cc)
Cristian Maglie    46
c.maglie@bug.st – Arduino (http://arduino.cc)
Arduino Ethernet
• Semplice da utilizzare
• Costo contenuto
• Comunicazione tra smartphone e device
  tramite Webservices
• Il firmware sull'Arduino Ethernet ha un
  piccolo webserver “stupido” che esegue i
  comandi
                                                        Cristian Maglie    47
                           c.maglie@bug.st – Arduino (http://arduino.cc)
Conclusione e domande




                                            Cristian Maglie    48
               c.maglie@bug.st – Arduino (http://arduino.cc)

Contenu connexe

Plus de Codemotion

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Codemotion
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyCodemotion
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaCodemotion
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserCodemotion
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Codemotion
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Codemotion
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Codemotion
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 - Codemotion
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Codemotion
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Codemotion
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Codemotion
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Codemotion
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Codemotion
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Codemotion
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Codemotion
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...Codemotion
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Codemotion
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Codemotion
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Codemotion
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Codemotion
 

Plus de Codemotion (20)

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending story
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storia
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard Altwasser
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
 

Crea il computer di bordo per la tua astronave, by Cristian Maglie

  • 1. Crea il computer di bordo per la tua astronave Cristian Maglie c.maglie@bug.st http://bug.st/ Arduino http://arduino.cc/
  • 2. Notizie sull'autore • Programmatore freelance • Entusiasta utilizzatore di tutte le tecnologie open- source • Appassionato di elettronica, collabora con il progetto Arduino da più di 3 anni • Attore consumato degli spot del codemotion • NON è un fan accanito di Star-Trek (anche se dopo il seminario la penserete diversamente) Cristian Maglie 2 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 3. Introduzione Cristian Maglie 3 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 4. Interfacce utente • Dispositivo fisico o virtuale che permette la comunicazione tra due o più entità di tipo diverso • Schermo, tastiera sono interfacce ma anche telefono, fotocopiatrice, televisione • Sono tutti supporti materiali che permettono l'interazione tra informazione “digitalizzata” e il mondo ordinario Cristian Maglie 4 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 5. Schermi Piatti Cristian Maglie 5 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 6. Touch Screen Cristian Maglie 6 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 7. Cellulare Cristian Maglie 7 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 8. Tablet This iPad Is wonderful! Cristian Maglie 8 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 9. Interfacce (come siamo abituati a vederle) Tastiera Monitor INPUT OUTPUT Mouse CPU Pad LCD Screen Touch Cristian Maglie 9 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 10. Evoluzione delle interfacce • Tende ad aumentare l'intimità tra utente e macchina • L'interfaccia del futuro sarà eterea: l'utente non si accorgerà della sua esistenza Cristian Maglie 10 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 11. Cristian Maglie 11 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 12. Riconoscimento Vocale Cristian Maglie 12 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 13. Interfacce Tastiera Monitor INPUT OUTPUT Mouse CPU Pad LCD Screen Touch Cristian Maglie 13 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 14. Interfacce INPUT Speech OUTPUT TTS Mic Recognition CPU Text To Speech Spk Cristian Maglie 14 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 15. Comando vocale • Problemi di sicurezza e identificazione • Comandi errati o falsi riconoscimenti • Rumore o voci sovrapposte • Indecisione nell'esporre il comando Cristian Maglie 15 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 16. Riconoscimento vocale • Android / Google API • iPhone • Vbot • CMU Sphinx Cristian Maglie 16 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 17. Speech Input API (Android) É la libreria sviluppata da google per fornire i dispositivi Android del riconoscimento vocale. Cristian Maglie 17 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 18. Speech Input API (Android) PRO • Riconoscimento vocale: ottimo • Sintesi vocale: buona, migliorabile in alcuni casi • Localizzazione in parecchie lingue • Open API: molto semplice da utilizzare Cristian Maglie 18 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 19. Speech Input API (Android) CONTRO • Richiede connessione a internet Cristian Maglie 19 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 20. Online Speech Recognition Google Internet services voice Recognize Speech Android OS Intent “Hello” Cristian Maglie 20 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 21. Speech Input API (Android) CONTRO • Richiede connessione a internet Cristian Maglie 21 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 22. Speech Input API (Android) CONTRO • Richiede connessione a internet • Problemi privacy Cristian Maglie 22 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 23. Online Speech Recognition Google Internet services voice Recognize Speech Android OS Intent “Hello” Cristian Maglie 23 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 24. Online Speech Recognition Google services Logs 24/03/2012 15.34 Cristian said: “Hello” Cristian Maglie 24 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 25. Speech Input API (Android) http://android-developers.blogspot.it/2010/03/speech-input-api-for-android.html Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getClass() .getPackage().getName()); intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speech recognition demo"); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM ); intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 5); if (!mSupportedLanguageView.getSelectedItem().toString().equals( "Default")) { intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, mSupportedLanguageView.getSelectedItem().toString()); } startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE); Cristian Maglie 25 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 26. Speech Input API (Android) @Override protected void onActivityResult(int requestCode, int resultCode, Intent intent) { if (requestCode == VOICE_RECOGNITION_REQUEST_CODE && resultCode == RESULT_OK) { List<String> matches = intent.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS); doSomethingWithVoiceCommands( matches ); } } Cristian Maglie 26 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 27. Speech Input API (Android) boolean TTSReady = false; TextToSpeech mTTS = new TextToSpeech(this, new OnInitListener() { @Override public void onInit(int status) { TTSReady = true; } }); […......] mTTs.speak(“Ciao”, TextToSpeech.QUEUE_FLUSH, null); Cristian Maglie 27 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 28. Siri (iPhone) • É il software sviluppato da Apple per aggiungere il supporto all'input vocale ai suoi nuovi dispositivi Cristian Maglie 28 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 29. Siri (iPhone) PRO • Riconoscimento vocale: ottimo • Sintesi vocale: ottima • Ottima integrazione con le funzioni del telefono (calendar, sms, weather, clock, etc.) Cristian Maglie 29 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 30. Siri (iPhone) CONTRO • Richiede connessione internet • Problemi privacy • Localizzazione ancora mancante per parecchie lingue • Closed source • Closed API, non esiste documentazione per lo sviluppatore, per poterlo programmare bisogna hackerare il dispositivo Cristian Maglie 30 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 31. Siri (iPhone) Non può essere utilizzato per i nostri scopi Cristian Maglie 31 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 32. EasyVR Vbot http://www.veear.eu/Products/EasyVR.aspx É un co-processore in grado di effettuare la speech recognition. Permette di dotare di controllo vocale piccoli sistemi embedded. Cristian Maglie 32 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 33. Vbot UART ARDUINO Vbot CMD_LANGUAGE 'l' // set language <1> CMD_TIMEOUT 'o' // set timeout <1> CMD_RECOG_SI 'i' // recog trigger word <1> CMD_TRAIN_SD 't' // train sd command at group CMD_GROUP_SD 'g' // insert new command at group CMD_UNGROUP_SD 'u' // remove command at group Cristian Maglie 33 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 34. Vbot PRO • Riconoscimento vocale: ottimo • Funziona offline: il riconoscimento avviene sul dispositivo • Riconoscimento vocale continuo • Segnale audio di “parola riconosciuta” Cristian Maglie 34 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 35. VRobot CONTRO • Sintesi vocale assente • Riconoscimento basato su vocabolario, non permette il riconoscimento di testo libero • Closed source Cristian Maglie 35 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 36. CMU Sphinx http://cmusphinx.sourceforge.net/ • Engine di speech recognition sviluppato dalla Carnage Mellon University Cristian Maglie 36 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 37. CMU Sphinx • Esiste una versione light dell'engine (pocketsphinx) che può essere utilizzata su dispositivi embedded • Sì può sfruttare JNI per realizzare un wrapper Java che fornisce la speech recognition utilizzando pocketsphinx dentro Android Cristian Maglie 37 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 38. Recognize Speech Intents multipli su piattaforma Android Recognize Speech Google API Intent CMU Sphinx Cristian Maglie 38 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 39. CMU Sphinx PRO • Riconoscimento vocale: buono • Sintesi vocale: ottima • Funzionamento offline • Riconoscimento vocale continuo • Open API in C e Java • Open Source Cristian Maglie 39 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 40. CMU Sphinx CONTRO • Localizzazione ancora limitata • Documentazione poco aggiornata • API molto potenti, ma di utilizzo non immediato • Installazione complessa Cristian Maglie 40 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 41. Cristian Maglie 41 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 42. Interconnessione Cristian Maglie 42 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 43. Interconnessione • Oggetti fisici possono essere connessi • Internet-of-Things Cristian Maglie 43 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 44. Interconnessione INPUT Voice OUTPUT Device Device A Device B Cristian Maglie 44 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 45. Interconnesione • Varie modalità di interconnessione (BT, RS232, WiFi, Ethernet, Zigbee e chi più ne ha più ne metta) • Dispositivi Ethernet / Wifi sempre più diffusi e meno costosti Cristian Maglie 45 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 46. Cristian Maglie 46 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 47. Arduino Ethernet • Semplice da utilizzare • Costo contenuto • Comunicazione tra smartphone e device tramite Webservices • Il firmware sull'Arduino Ethernet ha un piccolo webserver “stupido” che esegue i comandi Cristian Maglie 47 c.maglie@bug.st – Arduino (http://arduino.cc)
  • 48. Conclusione e domande Cristian Maglie 48 c.maglie@bug.st – Arduino (http://arduino.cc)