SlideShare ist ein Scribd-Unternehmen logo
1 von 38
XAM01 – Xamarin Robotics
Fabio Cozzolino
fabio@dotnetside.org
@fabiocozzolino
Pasquale Fersini
basquale.fersini@gmail.com
#CDays15 – Milano 24, 25 e 26 Marzo 2015
Grazie a
Platinum
Sponsor
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Chi siamo
• Fabio Cozzolino
• Chief Software Architect presso CompuGroup Medical Italia
• Microsoft MVP
• Presidente di DotNetSide
• Pasquale Fersini
• Developer presso CompuGroup Medical Italia
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Agenda
• Introduzione alla Xamarin Platform
• Monkey Robotics
• Robotics Mobile Stack
• Robotics Micro Stack
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Xamarin Platform
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Cos’è Xamarin?
• Un framework per lo sviluppo cross-platform su iOS e Android basato
su C#
• Binding alle API native della piattaforma
• Sempre aggiornato
• Il nuovo SDK viene rilasciato entro le 24 ore successive
• Sviluppo su Mac e Windows
• Xamarin Studio
• Visual Studio con Xamarin Plugin
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Xamarin Approach
Shared App
Logic
Native UI
C#
Native UI
C#
Shared C# App Logic Shared C# App Logic
Shared App
Logic
Shared
UI
Code
Android
UI Code
Window
s
UI Code
in C#
Shared App
Logic
Shared App
Logic
iOS
UI
Andro
id
UI
Wind
ows
UI Shared UI Code
iOS UI
Android
UI
Windows
UI
Shared App Logic
Shared App
Logic
Native UI
C#
Native UI
C#
Native UI
C#
Shared C# App Logic Shared C# App Logic
Shared App
Logic
Shared
UI
Code
Android
UI Code
Window
s
UI Code
in C#
Shared App
Logic
Shared App
Logic
iOS
UI
Andro
id
UI
Wind
ows
UI Shared UI Code
Model
View and ViewModel
(UI and controller)
Traditional
(80% code reuse)
MVVM con Xamarin.Forms
(99,9% code reuse)
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Cos’è Xamarin.Forms?
• UI condivisa
• 40+ Pages, Layouts, Controls
• Compilazione nativa
• Programmazione (anche) dichiarativa con XAML (standard 2009)
• Two-way Data binding
• Commands
• Converters
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Xamarin, sensori e l’IoT
• Accesso ai devices
• Bluetooth 4.0 LE? WiFi? NFC?
• Ogni sistema operativo gestisce in maniera differente
• Es. NFC su iOS è limitato, su Windows Phone è invece accessibile
• BLE 4.0 LE è supportato su tutte e tre le principali piattaforme (ma non su tutti
i dispositivi)
• Bluetooth 4.0 Low Energy come protocollo “standard” per la
condivisione di informazioni tra devices
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Bluetooth 4.0 LE (aka BLE)
• Tecnologia nata per supportare applicazioni legate alle attività
quotidiane:
• healthcare, fitness, beacons, security e home entertainment
• Riduzione dei consumi a parità di efficienza
• Stessa potenza e range di comunicazione
• Le specifiche definiscono un’implementazione hardware e software
• Nessuna compatibilità con il modello classico (Bluetooth Classic)
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
How the Bluetooth works: protocol stack
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
How the Bluetooth works: GATT protocol
• Client un device che avvia richieste GATT e
accetta risposte
• Server un device che riceve comandi e richieste
GATT e ritorna risposte
• Characteristic un dato/valore trasferito tra
client e server
• Service una collezione di caratteristiche
correlate che operano insieme per eseguire
una particolare funzionalità
• Descriptor fornisce informazioni addizionali
sulle caratteristiche
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Identifiers
• I servizi e le caratteristiche vengono identificati con degli UUID
• Esiste un range riservato di UUID
• https://www.bluetooth.org/en-us/specification/assigned-numbers
• xxxxxxxx-0000-1000-8000-00805F9B34FB
• E’ possibile definire i propri UUID
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Servizi e caratteristiche
"00001810-0000-1000-8000-00805f9b34fb":"Blood Pressure"
"00002a49-0000-1000-8000-00805f9b34fb":"Blood Pressure Feature",
"00002a35-0000-1000-8000-00805f9b34fb":"Blood Pressure Measurement",
serviziocaratteristiche
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Monkey.Robotics
a.k.a. Xamarin Robotics
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Cos’è Monkey.Robotics
• Una libreria open source per la comunicazione con i dispositivi basati
sul .NET Micro Framework
• Progetto di Xamarin Labs
• Formato da due stack:
• Mobile Stack: Supporto per iOS e Android
• Microcontroller Stack: .NET Microframework on Netduino (o schede
compatibili)
• Plug-in per Xamarin Studio
• Utilizzabile anche per la comunicazione con piattaforme non-.NET MF
come Arduino
• Astrazione del protocollo GATT
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Monkey.Robotics Overview
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Mobile Stack
• Low-level Bluetooth LE (BLE) API
• Cross-platform API (iOS e Android al momento) per la comunicazione con
device BLE
• Low-level WiFI API (in progress)
• Cross-platform API (iOS e Android al momento) che supporta la connessione a
dispositivi WiFi
• Messaging Framework
• High-level cross-platform protocol per l’invio dei messaggi via BLE o WiFi
• Peripheral Libraries
• Strongly typed libraries per la comunicazione con le periferiche specifiche dei
vendors come health monitoring devices, smart watchers, etc…
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Mobile Stack: GATT protocol
IAdapter
IDevice IService
ICharacteristic
Scan and Connect to devices
Discover Services
Enumerate Characteristic
Read and Write data
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Messaging Framework
HEADER
Magic = 1byte ‘M’
Operation = 1byte
Data Size =1byte
BODY
Data = max 255byte
Checksum = 1byte
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
DEMO
Temperatura e umidità
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Micro Stack
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Microcontroller Stack
• Low-level Hardware abstraction
• Modular/compositable basata sul concetto di Blocks and Scopes che
rappresenta devices e listeners
• Sensor and Peripheral Library
• Librerie strongly-typed che semplificano e astraggono l’integrazione con
centinaia di sensori come Alcohol Sensors o 3-axis Accelerometers
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Scopes & Blocks
BLOCKS
Rappresentano l'astrazione
di oggetti attivi
(devices, convertitori, etc.)
ed espongono
OutputPort ed InputPort
SCOPES
Rappresentano gestori di
output
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
DEMO
Robotroller
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
What drivers ?
5 gruppi:
• Base Devices
• Generators
• Motors
• Sensors
Gruppo speciale:
• Specialized Blocks
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Protocol Matrix
• Tabella protocolli di comunicazione per piattaforme embedded
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Base Devices
Costituiscono il "cuore" della board e sono:
• DigitalInputPin
• DigitalOutputPin
• AnalogInputPin
• PwmOutputPin
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Generators
Sono i generatori di onda e l'implementazione attuale ne prevede due tipi:
• Sine Wave
• PWM (Pulse Width Modulation)
Motors
Astraggono il funzionamento dei motori elettrici per due modelli di hardware:
• AdafruitMotorShield
• HBridgeMotors
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Sensors
• Button -> Pulsanti, Switch, ...
• LightSensor -> Fotoresistenze, ...
• Location -> Bussole digitali, barometri, ...
• Motion -> Accelerometri, ...
• Proximity -> Sensori ad infrarossi, ...
• Temperature -> Termometri digitali, sonde ntc, ...
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Specialized Blocks
Ereditano dalla classe Block
• PollingBlock
• Scambio di dati tra periferiche ad intervalli di tempo regolari.
• I2CPollingBlock
• Scambio di dati tra periferiche I2C ad intervalli di tempo regolari.
• Wrapper delle "consuete" chiamate ai dispositivi i2C.
• Prossimo futuro -> SPIPollingBlock ???
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Netduino
● STMicro 32-bit CPU - STM32F405RG
● Speed: 168MHz
● Code Storage: 384 KB
● SRAM: 192 KB
● digital pins 0-1: UART 1 RX, TX
● digital pins 2-3: UART 2 RX, TX/PWM
● digital pins 5-6: PWM, PWM
● digital pins 7-8: UART 3 RX, TX
● digital pins 9-10: PWM, PWM
● digital pins 11-13: PWM/MOSI, MISO, SPCK
● digital pin SD/SC: SDA/SCL
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Adafruit Motor Shield
● 2 servomotori da 5V;
● 2 Ponti-H: Toshiba TB6612 per motori da 1.2A;
● Protezione termica dall'overload;
● 4 motori DC bidirezionali;
● 2 motori passo passo;
● protezione termica della polarità.
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
BLE 4 Mini - RedbearLab
● Semplice interfaccia RS232 per piattaforme embedded;
● Texas Intruments's CC2540 (CPU indipendente);
● Firmware upgradabile via USB;
● Predisposizione per collegare un'antenna esterna;
● Alimentabile da 3.4V a 11V o con batteria esterna da 3.7V.
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
DHT22
● Tensione di lavoro: 3-5V;
● Umidità rilevabile: 0%-100%, accuratezza 2-5%;
● Temperatura rilevabile: -40° to 125°C, ±0.5°C accuracy;
● Comunicazione a lunga distanza (oltre 50 m);
● Protocollo OneWire proprietario.
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Recap
• Monkey.Robotics per astrarre la comunicazione tra mobile e micro
• Monkey.Robotics per lo sviluppo embedded multipiattaforma
• Monkey.Robotics per lo sviluppo embedded rapido
• Su GitHub
• https://github.com/xamarin/Monkey.Robotics
• @xamarinrobotics
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Q&A
Tutto il materiale di questa sessione su
http://www.communitydays.it/
Lascia subito il feedback su questa sessione,
potrai essere estratto per i nostri premi!
Seguici su
Twitter @CommunityDaysIT
Facebook http://facebook.com/cdaysit
#CDays15

Weitere ähnliche Inhalte

Was ist angesagt?

Nativo vs Xamarin pro e contro
Nativo vs Xamarin pro e controNativo vs Xamarin pro e contro
Nativo vs Xamarin pro e controCarmelo Ruota
 
Xamarin Forms: one technology to rule them all - Matteo Pagani - Codemotion R...
Xamarin Forms: one technology to rule them all - Matteo Pagani - Codemotion R...Xamarin Forms: one technology to rule them all - Matteo Pagani - Codemotion R...
Xamarin Forms: one technology to rule them all - Matteo Pagani - Codemotion R...Codemotion
 
Introduction to Xamarin
Introduction to XamarinIntroduction to Xamarin
Introduction to XamarinGuido Magrin
 
Introduction to iOS development with Xamarin
Introduction to iOS development with XamarinIntroduction to iOS development with Xamarin
Introduction to iOS development with XamarinRaffaele Fanizzi
 
C# Mobile application architecture
C# Mobile application architectureC# Mobile application architecture
C# Mobile application architectureLeonardo Alario
 
Xamarin & Cognitive Services Slides
Xamarin & Cognitive Services SlidesXamarin & Cognitive Services Slides
Xamarin & Cognitive Services SlidesFrancesco Bonacci
 
Introduzione Xamarin
Introduzione XamarinIntroduzione Xamarin
Introduzione XamarinAndrea Tosato
 
Xamarin: Shared Library and Portable Class Library - Aristide Di Francesco - ...
Xamarin: Shared Library and Portable Class Library - Aristide Di Francesco - ...Xamarin: Shared Library and Portable Class Library - Aristide Di Francesco - ...
Xamarin: Shared Library and Portable Class Library - Aristide Di Francesco - ...Codemotion
 
Improve mobile development with Visual Studio 2017 for Mac & Visual Studio Te...
Improve mobile development with Visual Studio 2017 for Mac & Visual Studio Te...Improve mobile development with Visual Studio 2017 for Mac & Visual Studio Te...
Improve mobile development with Visual Studio 2017 for Mac & Visual Studio Te...Gaetano Paternò
 
Flash Platform su dispositivi mobili
Flash Platform su dispositivi mobiliFlash Platform su dispositivi mobili
Flash Platform su dispositivi mobililuca mezzalira
 
What's new in Visual Studio 2019
What's new in Visual Studio 2019What's new in Visual Studio 2019
What's new in Visual Studio 2019Alessio Iafrate
 
Le basi per lo sviluppo su Windows Phone tool, SDK, il primo progetto
 Le basi per lo sviluppo su Windows Phone tool, SDK, il primo progetto Le basi per lo sviluppo su Windows Phone tool, SDK, il primo progetto
Le basi per lo sviluppo su Windows Phone tool, SDK, il primo progettoMicrosoft Mobile Developer
 
Future Decoded Roma - Visual Studio, Cordova e Ionic Framework to create X-...
Future Decoded Roma  - Visual Studio, Cordova e Ionic Framework  to create X-...Future Decoded Roma  - Visual Studio, Cordova e Ionic Framework  to create X-...
Future Decoded Roma - Visual Studio, Cordova e Ionic Framework to create X-...Michele Aponte
 
ASP.NET performance optimization
ASP.NET performance optimizationASP.NET performance optimization
ASP.NET performance optimizationAndrea Dottor
 
Introduzione alle app Windows Universal
Introduzione alle app Windows UniversalIntroduzione alle app Windows Universal
Introduzione alle app Windows UniversalAlessandro Scardova
 
Azure functions deep dive - Giorgio Di Nardo - Codemotion Rome 2017
Azure functions deep dive - Giorgio Di Nardo - Codemotion Rome 2017Azure functions deep dive - Giorgio Di Nardo - Codemotion Rome 2017
Azure functions deep dive - Giorgio Di Nardo - Codemotion Rome 2017Codemotion
 

Was ist angesagt? (20)

Nativo vs Xamarin pro e contro
Nativo vs Xamarin pro e controNativo vs Xamarin pro e contro
Nativo vs Xamarin pro e contro
 
Xamarin Forms: one technology to rule them all - Matteo Pagani - Codemotion R...
Xamarin Forms: one technology to rule them all - Matteo Pagani - Codemotion R...Xamarin Forms: one technology to rule them all - Matteo Pagani - Codemotion R...
Xamarin Forms: one technology to rule them all - Matteo Pagani - Codemotion R...
 
Introduction to Xamarin
Introduction to XamarinIntroduction to Xamarin
Introduction to Xamarin
 
Introduction to iOS development with Xamarin
Introduction to iOS development with XamarinIntroduction to iOS development with Xamarin
Introduction to iOS development with Xamarin
 
Mobile development .net
Mobile development .netMobile development .net
Mobile development .net
 
C# Mobile application architecture
C# Mobile application architectureC# Mobile application architecture
C# Mobile application architecture
 
Xamarin & Cognitive Services Slides
Xamarin & Cognitive Services SlidesXamarin & Cognitive Services Slides
Xamarin & Cognitive Services Slides
 
Spa with Blazor
Spa with BlazorSpa with Blazor
Spa with Blazor
 
Introduzione Xamarin
Introduzione XamarinIntroduzione Xamarin
Introduzione Xamarin
 
Xamarin: Shared Library and Portable Class Library - Aristide Di Francesco - ...
Xamarin: Shared Library and Portable Class Library - Aristide Di Francesco - ...Xamarin: Shared Library and Portable Class Library - Aristide Di Francesco - ...
Xamarin: Shared Library and Portable Class Library - Aristide Di Francesco - ...
 
Improve mobile development with Visual Studio 2017 for Mac & Visual Studio Te...
Improve mobile development with Visual Studio 2017 for Mac & Visual Studio Te...Improve mobile development with Visual Studio 2017 for Mac & Visual Studio Te...
Improve mobile development with Visual Studio 2017 for Mac & Visual Studio Te...
 
Flash Platform su dispositivi mobili
Flash Platform su dispositivi mobiliFlash Platform su dispositivi mobili
Flash Platform su dispositivi mobili
 
What's new in Visual Studio 2019
What's new in Visual Studio 2019What's new in Visual Studio 2019
What's new in Visual Studio 2019
 
Le basi per lo sviluppo su Windows Phone tool, SDK, il primo progetto
 Le basi per lo sviluppo su Windows Phone tool, SDK, il primo progetto Le basi per lo sviluppo su Windows Phone tool, SDK, il primo progetto
Le basi per lo sviluppo su Windows Phone tool, SDK, il primo progetto
 
Future Decoded Roma - Visual Studio, Cordova e Ionic Framework to create X-...
Future Decoded Roma  - Visual Studio, Cordova e Ionic Framework  to create X-...Future Decoded Roma  - Visual Studio, Cordova e Ionic Framework  to create X-...
Future Decoded Roma - Visual Studio, Cordova e Ionic Framework to create X-...
 
Introduzione a Xamarin
Introduzione a XamarinIntroduzione a Xamarin
Introduzione a Xamarin
 
ASP.NET performance optimization
ASP.NET performance optimizationASP.NET performance optimization
ASP.NET performance optimization
 
Introduzione alle app Windows Universal
Introduzione alle app Windows UniversalIntroduzione alle app Windows Universal
Introduzione alle app Windows Universal
 
Intro xamarin forms
Intro xamarin formsIntro xamarin forms
Intro xamarin forms
 
Azure functions deep dive - Giorgio Di Nardo - Codemotion Rome 2017
Azure functions deep dive - Giorgio Di Nardo - Codemotion Rome 2017Azure functions deep dive - Giorgio Di Nardo - Codemotion Rome 2017
Azure functions deep dive - Giorgio Di Nardo - Codemotion Rome 2017
 

Andere mochten auch

Navigation in Xamarin.Forms
Navigation in Xamarin.FormsNavigation in Xamarin.Forms
Navigation in Xamarin.FormsKym Phillpotts
 
Interfaces nativas Cross-Platform con Xamarin.Forms
Interfaces nativas Cross-Platform con Xamarin.FormsInterfaces nativas Cross-Platform con Xamarin.Forms
Interfaces nativas Cross-Platform con Xamarin.FormsJavier Suárez Ruiz
 
Web 2.0 Toepassing
Web 2.0 ToepassingWeb 2.0 Toepassing
Web 2.0 ToepassingDelphine124
 
Cat Oca Mediateca
Cat Oca MediatecaCat Oca Mediateca
Cat Oca Mediatecarvuoci
 
Listovka Middleware iTV IPTV
Listovka Middleware iTV IPTVListovka Middleware iTV IPTV
Listovka Middleware iTV IPTVMrCloud
 
Optimizing Performance Server9 2 Final
Optimizing Performance Server9 2 FinalOptimizing Performance Server9 2 Final
Optimizing Performance Server9 2 Finalarcorama
 
Cat Oca Mediateca
Cat Oca MediatecaCat Oca Mediateca
Cat Oca Mediatecarvuoci
 
Online Collaboration In Learning Emergency Services
Online Collaboration In Learning   Emergency ServicesOnline Collaboration In Learning   Emergency Services
Online Collaboration In Learning Emergency Servicesjerryl
 
Allan bowers extended cv 2016
Allan bowers extended cv 2016Allan bowers extended cv 2016
Allan bowers extended cv 2016Allan Bowers
 
Lorn Overview
Lorn OverviewLorn Overview
Lorn Overviewjerryl
 
ICCE 2007 - the Open Agenda
ICCE 2007 - the Open AgendaICCE 2007 - the Open Agenda
ICCE 2007 - the Open Agendajerryl
 
ePortfolio Symposium presentation
ePortfolio Symposium presentationePortfolio Symposium presentation
ePortfolio Symposium presentationjerryl
 
Open Educational Resources: Experiences of use in a Latin-American context
Open Educational Resources: Experiences of use in a Latin-American contextOpen Educational Resources: Experiences of use in a Latin-American context
Open Educational Resources: Experiences of use in a Latin-American contextTecnológico de Monterrey
 
Produkte Werbung
Produkte WerbungProdukte Werbung
Produkte Werbungcahowe274
 

Andere mochten auch (20)

Trabajo Final de Grado - Arctic
Trabajo Final de Grado - ArcticTrabajo Final de Grado - Arctic
Trabajo Final de Grado - Arctic
 
Navigation in Xamarin.Forms
Navigation in Xamarin.FormsNavigation in Xamarin.Forms
Navigation in Xamarin.Forms
 
Interfaces nativas Cross-Platform con Xamarin.Forms
Interfaces nativas Cross-Platform con Xamarin.FormsInterfaces nativas Cross-Platform con Xamarin.Forms
Interfaces nativas Cross-Platform con Xamarin.Forms
 
Web 2.0 Toepassing
Web 2.0 ToepassingWeb 2.0 Toepassing
Web 2.0 Toepassing
 
Tabla rt2
Tabla rt2Tabla rt2
Tabla rt2
 
Cat Oca Mediateca
Cat Oca MediatecaCat Oca Mediateca
Cat Oca Mediateca
 
Listovka Middleware iTV IPTV
Listovka Middleware iTV IPTVListovka Middleware iTV IPTV
Listovka Middleware iTV IPTV
 
Passover
PassoverPassover
Passover
 
Colors
ColorsColors
Colors
 
Parks of London
Parks of LondonParks of London
Parks of London
 
Optimizing Performance Server9 2 Final
Optimizing Performance Server9 2 FinalOptimizing Performance Server9 2 Final
Optimizing Performance Server9 2 Final
 
Cat Oca Mediateca
Cat Oca MediatecaCat Oca Mediateca
Cat Oca Mediateca
 
Online Collaboration In Learning Emergency Services
Online Collaboration In Learning   Emergency ServicesOnline Collaboration In Learning   Emergency Services
Online Collaboration In Learning Emergency Services
 
Allan bowers extended cv 2016
Allan bowers extended cv 2016Allan bowers extended cv 2016
Allan bowers extended cv 2016
 
Lorn Overview
Lorn OverviewLorn Overview
Lorn Overview
 
Gamifying Moms
Gamifying MomsGamifying Moms
Gamifying Moms
 
ICCE 2007 - the Open Agenda
ICCE 2007 - the Open AgendaICCE 2007 - the Open Agenda
ICCE 2007 - the Open Agenda
 
ePortfolio Symposium presentation
ePortfolio Symposium presentationePortfolio Symposium presentation
ePortfolio Symposium presentation
 
Open Educational Resources: Experiences of use in a Latin-American context
Open Educational Resources: Experiences of use in a Latin-American contextOpen Educational Resources: Experiences of use in a Latin-American context
Open Educational Resources: Experiences of use in a Latin-American context
 
Produkte Werbung
Produkte WerbungProdukte Werbung
Produkte Werbung
 

Ähnlich wie Xamarin Robotics

Musixmatch Cloud: Microsoft Azure Media Services and UGC Content
Musixmatch Cloud: Microsoft Azure Media Services and UGC ContentMusixmatch Cloud: Microsoft Azure Media Services and UGC Content
Musixmatch Cloud: Microsoft Azure Media Services and UGC ContentLoreto Parisi
 
WP04 -Sensori e hardware con Windows Phone 8.1
WP04 -Sensori e hardware con Windows Phone 8.1WP04 -Sensori e hardware con Windows Phone 8.1
WP04 -Sensori e hardware con Windows Phone 8.1Dan Ardelean
 
MySQL Day Roma 2019 - Le architetture a microservizi e MySQL
MySQL Day Roma 2019 - Le architetture a microservizi e MySQLMySQL Day Roma 2019 - Le architetture a microservizi e MySQL
MySQL Day Roma 2019 - Le architetture a microservizi e MySQLPar-Tec S.p.A.
 
Sviluppare applicazioni web (completamente) on-line con Visual Studio Online ...
Sviluppare applicazioni web (completamente) on-line con Visual Studio Online ...Sviluppare applicazioni web (completamente) on-line con Visual Studio Online ...
Sviluppare applicazioni web (completamente) on-line con Visual Studio Online ...Marco Parenzan
 
Mobile services multi-piattaforma con Xamarin
Mobile services multi-piattaforma con XamarinMobile services multi-piattaforma con Xamarin
Mobile services multi-piattaforma con XamarinNicolò Carandini
 
Open Source Day 2016 - Caso cliente: OpenStack Self Data Center, il cloud com...
Open Source Day 2016 - Caso cliente: OpenStack Self Data Center, il cloud com...Open Source Day 2016 - Caso cliente: OpenStack Self Data Center, il cloud com...
Open Source Day 2016 - Caso cliente: OpenStack Self Data Center, il cloud com...Par-Tec S.p.A.
 
Nord-Est Italy Seminars 2012
Nord-Est Italy Seminars 2012Nord-Est Italy Seminars 2012
Nord-Est Italy Seminars 2012alexzio
 
Realizzare Accessori iOS con Bluetooth Low Energy e Arduino
Realizzare Accessori iOS con Bluetooth Low Energy e ArduinoRealizzare Accessori iOS con Bluetooth Low Energy e Arduino
Realizzare Accessori iOS con Bluetooth Low Energy e Arduinofibasile
 
Gam05 costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...
Gam05   costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...Gam05   costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...
Gam05 costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...DotNetCampus
 
MySQL Tech Tour 2016 - Panoramica sul progetto Openstack
MySQL Tech Tour 2016 - Panoramica sul progetto OpenstackMySQL Tech Tour 2016 - Panoramica sul progetto Openstack
MySQL Tech Tour 2016 - Panoramica sul progetto OpenstackPar-Tec S.p.A.
 
WSO2 Oxygenate Italy 2022 Raiffeisen Information Service. Roberto Palmarin
WSO2 Oxygenate Italy 2022 Raiffeisen Information Service. Roberto PalmarinWSO2 Oxygenate Italy 2022 Raiffeisen Information Service. Roberto Palmarin
WSO2 Oxygenate Italy 2022 Raiffeisen Information Service. Roberto PalmarinProfesia Srl, Lynx Group
 
MySQL Day Milano 2018 - Le architetture a microservizi
MySQL Day Milano 2018 - Le architetture a microserviziMySQL Day Milano 2018 - Le architetture a microservizi
MySQL Day Milano 2018 - Le architetture a microserviziPar-Tec S.p.A.
 
Power BI Streaming Data Flow e Azure IoT Central
Power BI Streaming Data Flow e Azure IoT Central Power BI Streaming Data Flow e Azure IoT Central
Power BI Streaming Data Flow e Azure IoT Central Marco Parenzan
 

Ähnlich wie Xamarin Robotics (20)

Cmdays mxm ugc
Cmdays mxm ugcCmdays mxm ugc
Cmdays mxm ugc
 
Musixmatch Cloud: Microsoft Azure Media Services and UGC Content
Musixmatch Cloud: Microsoft Azure Media Services and UGC ContentMusixmatch Cloud: Microsoft Azure Media Services and UGC Content
Musixmatch Cloud: Microsoft Azure Media Services and UGC Content
 
WP04 -Sensori e hardware con Windows Phone 8.1
WP04 -Sensori e hardware con Windows Phone 8.1WP04 -Sensori e hardware con Windows Phone 8.1
WP04 -Sensori e hardware con Windows Phone 8.1
 
MySQL Day Roma 2019 - Le architetture a microservizi e MySQL
MySQL Day Roma 2019 - Le architetture a microservizi e MySQLMySQL Day Roma 2019 - Le architetture a microservizi e MySQL
MySQL Day Roma 2019 - Le architetture a microservizi e MySQL
 
Sviluppare applicazioni web (completamente) on-line con Visual Studio Online ...
Sviluppare applicazioni web (completamente) on-line con Visual Studio Online ...Sviluppare applicazioni web (completamente) on-line con Visual Studio Online ...
Sviluppare applicazioni web (completamente) on-line con Visual Studio Online ...
 
Mobile services multi-piattaforma con Xamarin
Mobile services multi-piattaforma con XamarinMobile services multi-piattaforma con Xamarin
Mobile services multi-piattaforma con Xamarin
 
La piattaforma OCP.pptx
La piattaforma OCP.pptxLa piattaforma OCP.pptx
La piattaforma OCP.pptx
 
Open Source Day 2016 - Caso cliente: OpenStack Self Data Center, il cloud com...
Open Source Day 2016 - Caso cliente: OpenStack Self Data Center, il cloud com...Open Source Day 2016 - Caso cliente: OpenStack Self Data Center, il cloud com...
Open Source Day 2016 - Caso cliente: OpenStack Self Data Center, il cloud com...
 
Nord-Est Italy Seminars 2012
Nord-Est Italy Seminars 2012Nord-Est Italy Seminars 2012
Nord-Est Italy Seminars 2012
 
Ocp overview del progetto
Ocp overview del progettoOcp overview del progetto
Ocp overview del progetto
 
Ocp overview
Ocp overviewOcp overview
Ocp overview
 
Realizzare Accessori iOS con Bluetooth Low Energy e Arduino
Realizzare Accessori iOS con Bluetooth Low Energy e ArduinoRealizzare Accessori iOS con Bluetooth Low Energy e Arduino
Realizzare Accessori iOS con Bluetooth Low Energy e Arduino
 
Game matching with SignalR
Game matching with SignalRGame matching with SignalR
Game matching with SignalR
 
Game matching with SignalR
Game matching with SignalRGame matching with SignalR
Game matching with SignalR
 
Gam05 costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...
Gam05   costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...Gam05   costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...
Gam05 costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...
 
MySQL Tech Tour 2016 - Panoramica sul progetto Openstack
MySQL Tech Tour 2016 - Panoramica sul progetto OpenstackMySQL Tech Tour 2016 - Panoramica sul progetto Openstack
MySQL Tech Tour 2016 - Panoramica sul progetto Openstack
 
WSO2 Oxygenate Italy 2022 Raiffeisen Information Service. Roberto Palmarin
WSO2 Oxygenate Italy 2022 Raiffeisen Information Service. Roberto PalmarinWSO2 Oxygenate Italy 2022 Raiffeisen Information Service. Roberto Palmarin
WSO2 Oxygenate Italy 2022 Raiffeisen Information Service. Roberto Palmarin
 
MySQL Day Milano 2018 - Le architetture a microservizi
MySQL Day Milano 2018 - Le architetture a microserviziMySQL Day Milano 2018 - Le architetture a microservizi
MySQL Day Milano 2018 - Le architetture a microservizi
 
Power BI Streaming Data Flow e Azure IoT Central
Power BI Streaming Data Flow e Azure IoT Central Power BI Streaming Data Flow e Azure IoT Central
Power BI Streaming Data Flow e Azure IoT Central
 
Mobile e Smart Client
Mobile e Smart ClientMobile e Smart Client
Mobile e Smart Client
 

Xamarin Robotics

  • 1. XAM01 – Xamarin Robotics Fabio Cozzolino fabio@dotnetside.org @fabiocozzolino Pasquale Fersini basquale.fersini@gmail.com
  • 2. #CDays15 – Milano 24, 25 e 26 Marzo 2015 Grazie a Platinum Sponsor
  • 3. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Chi siamo • Fabio Cozzolino • Chief Software Architect presso CompuGroup Medical Italia • Microsoft MVP • Presidente di DotNetSide • Pasquale Fersini • Developer presso CompuGroup Medical Italia
  • 4. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Agenda • Introduzione alla Xamarin Platform • Monkey Robotics • Robotics Mobile Stack • Robotics Micro Stack
  • 5. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Xamarin Platform
  • 6. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Cos’è Xamarin? • Un framework per lo sviluppo cross-platform su iOS e Android basato su C# • Binding alle API native della piattaforma • Sempre aggiornato • Il nuovo SDK viene rilasciato entro le 24 ore successive • Sviluppo su Mac e Windows • Xamarin Studio • Visual Studio con Xamarin Plugin
  • 7. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Xamarin Approach Shared App Logic Native UI C# Native UI C# Shared C# App Logic Shared C# App Logic Shared App Logic Shared UI Code Android UI Code Window s UI Code in C# Shared App Logic Shared App Logic iOS UI Andro id UI Wind ows UI Shared UI Code iOS UI Android UI Windows UI Shared App Logic Shared App Logic Native UI C# Native UI C# Native UI C# Shared C# App Logic Shared C# App Logic Shared App Logic Shared UI Code Android UI Code Window s UI Code in C# Shared App Logic Shared App Logic iOS UI Andro id UI Wind ows UI Shared UI Code Model View and ViewModel (UI and controller) Traditional (80% code reuse) MVVM con Xamarin.Forms (99,9% code reuse)
  • 8. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Cos’è Xamarin.Forms? • UI condivisa • 40+ Pages, Layouts, Controls • Compilazione nativa • Programmazione (anche) dichiarativa con XAML (standard 2009) • Two-way Data binding • Commands • Converters
  • 9. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Xamarin, sensori e l’IoT • Accesso ai devices • Bluetooth 4.0 LE? WiFi? NFC? • Ogni sistema operativo gestisce in maniera differente • Es. NFC su iOS è limitato, su Windows Phone è invece accessibile • BLE 4.0 LE è supportato su tutte e tre le principali piattaforme (ma non su tutti i dispositivi) • Bluetooth 4.0 Low Energy come protocollo “standard” per la condivisione di informazioni tra devices
  • 10. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Bluetooth 4.0 LE (aka BLE) • Tecnologia nata per supportare applicazioni legate alle attività quotidiane: • healthcare, fitness, beacons, security e home entertainment • Riduzione dei consumi a parità di efficienza • Stessa potenza e range di comunicazione • Le specifiche definiscono un’implementazione hardware e software • Nessuna compatibilità con il modello classico (Bluetooth Classic)
  • 11. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 How the Bluetooth works: protocol stack
  • 12. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 How the Bluetooth works: GATT protocol • Client un device che avvia richieste GATT e accetta risposte • Server un device che riceve comandi e richieste GATT e ritorna risposte • Characteristic un dato/valore trasferito tra client e server • Service una collezione di caratteristiche correlate che operano insieme per eseguire una particolare funzionalità • Descriptor fornisce informazioni addizionali sulle caratteristiche
  • 13. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Identifiers • I servizi e le caratteristiche vengono identificati con degli UUID • Esiste un range riservato di UUID • https://www.bluetooth.org/en-us/specification/assigned-numbers • xxxxxxxx-0000-1000-8000-00805F9B34FB • E’ possibile definire i propri UUID
  • 14. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Servizi e caratteristiche "00001810-0000-1000-8000-00805f9b34fb":"Blood Pressure" "00002a49-0000-1000-8000-00805f9b34fb":"Blood Pressure Feature", "00002a35-0000-1000-8000-00805f9b34fb":"Blood Pressure Measurement", serviziocaratteristiche
  • 15. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Monkey.Robotics a.k.a. Xamarin Robotics
  • 16. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Cos’è Monkey.Robotics • Una libreria open source per la comunicazione con i dispositivi basati sul .NET Micro Framework • Progetto di Xamarin Labs • Formato da due stack: • Mobile Stack: Supporto per iOS e Android • Microcontroller Stack: .NET Microframework on Netduino (o schede compatibili) • Plug-in per Xamarin Studio • Utilizzabile anche per la comunicazione con piattaforme non-.NET MF come Arduino • Astrazione del protocollo GATT
  • 17. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Monkey.Robotics Overview
  • 18. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Mobile Stack • Low-level Bluetooth LE (BLE) API • Cross-platform API (iOS e Android al momento) per la comunicazione con device BLE • Low-level WiFI API (in progress) • Cross-platform API (iOS e Android al momento) che supporta la connessione a dispositivi WiFi • Messaging Framework • High-level cross-platform protocol per l’invio dei messaggi via BLE o WiFi • Peripheral Libraries • Strongly typed libraries per la comunicazione con le periferiche specifiche dei vendors come health monitoring devices, smart watchers, etc…
  • 19. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Mobile Stack: GATT protocol IAdapter IDevice IService ICharacteristic Scan and Connect to devices Discover Services Enumerate Characteristic Read and Write data
  • 20. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Messaging Framework HEADER Magic = 1byte ‘M’ Operation = 1byte Data Size =1byte BODY Data = max 255byte Checksum = 1byte
  • 21. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 DEMO Temperatura e umidità
  • 22. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Micro Stack
  • 23. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Microcontroller Stack • Low-level Hardware abstraction • Modular/compositable basata sul concetto di Blocks and Scopes che rappresenta devices e listeners • Sensor and Peripheral Library • Librerie strongly-typed che semplificano e astraggono l’integrazione con centinaia di sensori come Alcohol Sensors o 3-axis Accelerometers
  • 24. #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 25. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Scopes & Blocks BLOCKS Rappresentano l'astrazione di oggetti attivi (devices, convertitori, etc.) ed espongono OutputPort ed InputPort SCOPES Rappresentano gestori di output
  • 26. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 DEMO Robotroller
  • 27. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 What drivers ? 5 gruppi: • Base Devices • Generators • Motors • Sensors Gruppo speciale: • Specialized Blocks
  • 28. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Protocol Matrix • Tabella protocolli di comunicazione per piattaforme embedded
  • 29. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Base Devices Costituiscono il "cuore" della board e sono: • DigitalInputPin • DigitalOutputPin • AnalogInputPin • PwmOutputPin
  • 30. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Generators Sono i generatori di onda e l'implementazione attuale ne prevede due tipi: • Sine Wave • PWM (Pulse Width Modulation) Motors Astraggono il funzionamento dei motori elettrici per due modelli di hardware: • AdafruitMotorShield • HBridgeMotors
  • 31. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Sensors • Button -> Pulsanti, Switch, ... • LightSensor -> Fotoresistenze, ... • Location -> Bussole digitali, barometri, ... • Motion -> Accelerometri, ... • Proximity -> Sensori ad infrarossi, ... • Temperature -> Termometri digitali, sonde ntc, ...
  • 32. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Specialized Blocks Ereditano dalla classe Block • PollingBlock • Scambio di dati tra periferiche ad intervalli di tempo regolari. • I2CPollingBlock • Scambio di dati tra periferiche I2C ad intervalli di tempo regolari. • Wrapper delle "consuete" chiamate ai dispositivi i2C. • Prossimo futuro -> SPIPollingBlock ???
  • 33. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Netduino ● STMicro 32-bit CPU - STM32F405RG ● Speed: 168MHz ● Code Storage: 384 KB ● SRAM: 192 KB ● digital pins 0-1: UART 1 RX, TX ● digital pins 2-3: UART 2 RX, TX/PWM ● digital pins 5-6: PWM, PWM ● digital pins 7-8: UART 3 RX, TX ● digital pins 9-10: PWM, PWM ● digital pins 11-13: PWM/MOSI, MISO, SPCK ● digital pin SD/SC: SDA/SCL
  • 34. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Adafruit Motor Shield ● 2 servomotori da 5V; ● 2 Ponti-H: Toshiba TB6612 per motori da 1.2A; ● Protezione termica dall'overload; ● 4 motori DC bidirezionali; ● 2 motori passo passo; ● protezione termica della polarità.
  • 35. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 BLE 4 Mini - RedbearLab ● Semplice interfaccia RS232 per piattaforme embedded; ● Texas Intruments's CC2540 (CPU indipendente); ● Firmware upgradabile via USB; ● Predisposizione per collegare un'antenna esterna; ● Alimentabile da 3.4V a 11V o con batteria esterna da 3.7V.
  • 36. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 DHT22 ● Tensione di lavoro: 3-5V; ● Umidità rilevabile: 0%-100%, accuratezza 2-5%; ● Temperatura rilevabile: -40° to 125°C, ±0.5°C accuracy; ● Comunicazione a lunga distanza (oltre 50 m); ● Protocollo OneWire proprietario.
  • 37. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Recap • Monkey.Robotics per astrarre la comunicazione tra mobile e micro • Monkey.Robotics per lo sviluppo embedded multipiattaforma • Monkey.Robotics per lo sviluppo embedded rapido • Su GitHub • https://github.com/xamarin/Monkey.Robotics • @xamarinrobotics
  • 38. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Q&A Tutto il materiale di questa sessione su http://www.communitydays.it/ Lascia subito il feedback su questa sessione, potrai essere estratto per i nostri premi! Seguici su Twitter @CommunityDaysIT Facebook http://facebook.com/cdaysit #CDays15

Hinweis der Redaktion

  1. Slide da mostrare prima di iniziare la sessione – non rimuovere!
  2. GENERIC ATTRIBUTE PROFILE The GATT protocol provides a number of commands for the client to discover information about the server. These include: Discover UUIDs for all primary services Find a service with a given UUID Find secondary services for a given primary service Discover all characteristics for a given service Find characteristics matching a given UUID Read all descriptors for a particular characteristic Commands are also provided to read (data transfer from server to client) and write (from client to server) the values of characteristics: A value may be read either by specifying the characteristic's UUID, or by a handle value (which is returned by the information discovery commands above). Write operations always identify the characteristic by handle, but have a choice of whether or not a response from the server is required. 'Long read' and 'Long write' operations can be used when the length of the characteristic's data exceeds the MTU of the radio link. Finally, GATT offers notifications and indications. The client may request a notification for a particular characteristic from the server. The server can then send the value to the client whenever it becomes available. For instance, a temperature sensor server may notify its client every time it takes a measurement. This avoids the need for the client to poll the server, which would require the server's radio circuitry to be constantly operational. An indication is similar to a notification, except that it requires a response from the client, as confirmation that it has received the message.
  3. Ultima slide, obbligatoria