La descarga está en progreso. Por favor, espere

La descarga está en progreso. Por favor, espere

Microsoft Robotics Studio Miguel Angel Ramos Barroso MVP ASP.NET Microsoft Code Camp Junio 2007.

Presentaciones similares


Presentación del tema: "Microsoft Robotics Studio Miguel Angel Ramos Barroso MVP ASP.NET Microsoft Code Camp Junio 2007."— Transcripción de la presentación:

1 Microsoft Robotics Studio Miguel Angel Ramos Barroso MVP ASP.NET Microsoft Code Camp Junio 2007

2 ¿Robots?

3 Gran variedad de hardware…

4 ¿Qué es una aplicación para Robots? Objetivo: Responder a un sensor Ejemplo: Arrancar un motor cuendo se pulse un botón (sensor)

5 ¿Qué es una aplicación para Robots?

6 Microsoft Robotics Studio (MSRS) Plataforma de desarrollo para programar robots que soporta una gran variedad de hardware y escenarios Runtime Concurrencia Concurrencia Infraestructura en Servicios Infraestructura en Servicios Servicios y Ejemplos Ejemplos y tutoriales Ejemplos y tutoriales Servicios para Robots Servicios para Robots Modelos de Robots Modelos de Robots Microsoft Robotics Studio Herramientas Simulador Simulador Visual Programming Language Visual Programming Language

7 Objetivos conseguidos… Configurar sensores y actuadores en un sistema en ejecución Coordinar sensores y actuadores asincronamente Iniaciar y parar componentes dinamicamente Monitorizar, Interactuar y depurar en tiempo de ejecución Desarrollar cuando el acceso al robot es limitado Extenderse sobre multiples ordenadores Reutiliar componentes através de distintas plataformas de hardware y dispositivos.

8 Entorno de Desarrollo Construido sobre CLR 2.0 Portable Concurrencia y coordinación Infraestructura distribuida Entorno de despliegue muy ligero para los servicios Muy integrado con tecnologias Web Servicios Personalidados Servicios Personalidados Infraestructura distribuida Biblioteca de concurrencia Infraestructura distribuida Biblioteca de concurrencia

9 Entorno de Desarrollo Modelo de aplicación distribuido Distributed Application Model (DSS) Simple, flexible, y orientado a servicios Grano grueso y poco acoplado Compatible con la infraestructura Web actual Modelo concurrente de programcion Concurrent Programming Model (CCR) Enfocado en la coordinación de mensajes Nos oculta los tradicionales threads y locks Habilita la ejucución secuencial sin bloquear los thread entre I/O, evitando las cadenas de callback

10 ¿Qué es una aplicación para Robots?

11 Modelo de aplicación distribuido (DSS)

12 Esquema de aplicación Orquestación de sensores y actuadores. En el se subscriben los servicios Un servicio puede ser Partner de otros muchos servicios

13 Puede representar: Hardware: Sensores, actuadores Software: UI, Almacenamiento Agregados: Mash-Ups, conjuntos de sensores Se reutiliazan gracias a la composición: Separar el estado del comportamiento (No ocultes el estado) Servicios Port State Handlers Service FIFO

14 Ejemplo de Servicio Bumper Estructura del estado. Los manejadores de eventos fuera de la estructura Operaciones sobre el estado: GET, QUERY, UPDATE, DELETE, DROP, SUBSCRIBE

15 Interacciones de servicios Runtime, Hosting Environment y System Services

16 Programación del CCR Los fundamentos para escribir aplicaciones para Robotics.

17 El CCR Runtime Modelo asíncrono de programación Un modelo concurrente sin programarnos a a mano threads, locks o semáforos. Basado en mensajes asíncronos Enfocados en la coordinación de primitivas Ejecución secuencial pero sin tener hilos bloqueados y sin necesidad de callbacks, sólo cuando sea necesario. Contexto de ejecución para los servicios Aislamiento de la infraestructura Aislamiento de otros servicios

18 Mensajes, Puertos y Árbitros Los mensajes son enviados a los Puertos Port myPort = new Port () ; myPort.Post (42) ; Los Puertos contienen: Una FIFO que gestiona los mantiene los valores del puerto… Una lista de continuidades que pueder ser ejecutada dependiendo del mensaje que llegue y el arbitraje La continuacion es representada por un delegado en C# Puede ser anónimo o nombrado Árbitros Implementa los contructores de enlaces o entrelazado de las concurrencia.

19 Primitivas CCR Iteradores en C# como una forma de agenda… Escala millones de elementos concurrentes pendientes, usa solo un hilo por microprocesador, se programa de la forma tradicional. Single item receiver Ejecuta sólo el código cuando llega un mensaje Choice arbiter Elige un mensaje recibido (join o single) de muchos, a través de diferentes piertos, lo ejecuta solo una vez con las condiciones conocidas descartando a otros. JoinStaticDynamic Interleave arbiter Teardown group, Concurrent Group, Exclusive Group

20 Ejemplo: Iterators IEnumerator MultistageIterator() IEnumerator MultistageIterator(){ bool result = false; bool result = false; Port port = new Port (); Port port = new Port (); // Stage A, send request // Stage A, send request port.Post(true); port.Post(true); yield return Arbiter.Receive(false, port, delegate(bool b) {result=b; }); yield return Arbiter.Receive(false, port, delegate(bool b) {result=b; }); // Stage B, received first result, send second request // Stage B, received first result, send second request port.Post(result); port.Post(result); yield return Arbiter.Receive(false, port, delegate(bool b) {result=b; }); yield return Arbiter.Receive(false, port, delegate(bool b) {result=b; }); // Stage C, received second result, print it // Stage C, received second result, print it Console.WriteLine(result); Console.WriteLine(result);}

21 Ejemplo: Choice PortSet port = new PortSet (); Activate( Arbiter.Choice(port, MyIntHandler, MyStringHandler) ); void MyIntHandler(int i) { Console.WriteLine("Received: " + i); Console.WriteLine("Received: " + i);} void MyStringHandler(string s) { Console.WriteLine("Received: " + s); Console.WriteLine("Received: " + s);}

22 Ejemplo: Join Port balancePort = new Port (); Port depositPort = new Port (); Activate(Arbiter.JoinedReceive<int,double>(true, depositPort, balancePort, depositPort, balancePort, delegate(int b, double d) { delegate(int b, double d) { balance.post(b + d); }) );

23 Ejemplo: Dynamic Join PortSet resultsPort = new PortSet (); new PortSet (); // parallel computation by posting requests For (int i=0;i<N;i++) { computePort.Post(new DoWork(someData,resultsPort)); computePort.Post(new DoWork(someData,resultsPort));} // requests complete asynchronously with unknown number // of failures vs. successes Activate(Arbiter.MultipleItemReceive(resultsPort, delegate (ICollection successes, delegate (ICollection successes, ICollection failures) ICollection failures){ foreach(Result r in results) foreach(Result r in results) { …… …… }});

24 Ejemplo: Interleave Interleave coordination = Arbiter.Interleave( new TeardownGroup( new TeardownGroup( Arbiter.Receive (false, port, ShutdownHandler) Arbiter.Receive (false, port, ShutdownHandler) ), ), new ExclusiveGroup( new ExclusiveGroup( Arbiter.Receive (true,port,UpdateHandler), Arbiter.Receive (true,port,UpdateHandler), Arbiter.Receive (true,port,InsertHandler) Arbiter.Receive (true,port,InsertHandler) ), ), new ConcurrentGroup( new ConcurrentGroup( Arbiter.Receive (true,port,QueryHandler) Arbiter.Receive (true,port,QueryHandler) )); )); Activate(coordination);

25 [ServiceHandler(ServiceHandlerBehavior.Concurrent)] public IEnumerator GetHandler(Get get) { get.ResponsePort.Post(_state); get.ResponsePort.Post(_state); yield break; yield break;} [ServiceHandler(ServiceHandlerBehavior.Exclusive)] public IEnumerator UpdateHandler(Update update) { _state.CurrentResult += update.Body.Value; _state.CurrentResult += update.Body.Value; update.ResponsePort.Post(new UpdateResponse()); update.ResponsePort.Post(new UpdateResponse()); yield break; yield break;} Coodinación de Servicios De forma declarativa

26

27 Recursos Web site http://www.microsoft.com/robotics Community Newsgroup http://msdn.microsoft.com/robotics/ Wiki with Patterns and Trouble Shooting http://channel9.msdn.com/wiki/default.aspx/Ch annel9.MSRoboticsStudio http://channel9.msdn.com/wiki/default.aspx/Ch annel9.MSRoboticsStudio

28 © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

29 Lego Mindstorms NXT 1.NXT Brick 2.Touch Sensor 3.Sound Sensor 4.Light Sensor 5.Ultrasonic Sensor 6.Servo Motors (3) NXT Programming Software (LabView) Bluetooth & USB Communications

30 NXT Projects

31 Summary Broad third party support

32 Microsoft Robotics Studio Application deployment models Supports standalone and distributed processing scenarios Disconnected autonomous operation (with optional networked monitoring) Distributed execution (execution across compute units) Connected operation (remote execution on PC)

33 Robotics Studio Runtime Joystick service UI service Microsoft Robotics Studio Interaction through the browser Service state observable at all levels of the application Services are capable of providing rich representation of data Robot Motor services Sensor services

34 Browser Robot Dashboard ScriptingConnect Robotics Studio Runtime JS Service Motor services Sensor services Microsoft Robotics Studio Driving a robot with the browser and JScript

35 Robotics Runtime Concurrency and coordination runtime Runtime Activation Discovery Diagnostics Monitoring UX Storage DecentralizedSystemServices Algorithms … Sensors Actuators ReferenceServices Services Simulation Visualization AuthoringServices SensorsActuators Custom/Application Services OrchestrationControl


Descargar ppt "Microsoft Robotics Studio Miguel Angel Ramos Barroso MVP ASP.NET Microsoft Code Camp Junio 2007."

Presentaciones similares


Anuncios Google