UNIVERSITÀ DEGLI
STUDI DI BERGAMO
A Robotics Task Coordination Case Study
Davide Brugali, Luca Gherardi,Patrizia Scandurra
May 9, 2011 - Shanghai, China
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
Introduction
Separation of concerns: computation and coordination
The case study
High level solution
Coordination FSM
Implementation
2
Outline
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
Goal: separate of concerns in the development of component based systems (in our case particular attention on Computation and Coordination).
Solution: model and implement Computation and the Coordination through 2 different frameworks (SCA and ASM).
3
Introduction
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
Computation: concerned with data processing algorithms required by an application.
Configuration: determines which system components should exist, and how they are inter-connected.
Communication: deals with the exchange of data.
Coordination: concerned with the interaction of the various system components.
4
Separation of concerns
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
Computation: how the functionalities are realized.
Algorithms: data structures and operations.
Coordination: when the functionalities are used.
Interaction among components: cooperation and competition.
They have to be modeled and implemented in a separate way.
We chose two different frameworks.
5
Computation Vs. Coordination
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
We adopted the Service Component Architecture.
Set of specifications which describe a model for building applications.
6
Computation and SCA
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
We adopted the Abstract State Machines
Evolution of the FSM
Formal Method
Automatic validation and verification of correctness.
Runtime monitoring and self-adaptation.
Provides rigor without mathematical overkill.
7
Coordination and ASM
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
Developed by P. Scandurra and F. Albani at University of Bergamo.
Extension of the SCA Eclipse plugin (front-end).
Extension of the Tuscany runtime (back-end).
8
SCA - ASM
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
Three participants:
Laser scanner: executes scans (n measures) on demand and writes results on a data buffer: scan( from, nSteps ).
3D Perception and Obstacle Avoidance applications.
9
LaserScanner
Client 1 3D Perception
Client 2Obstacle Avoidance
The case study scenario
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
A scan operation requires an amount of time that is not fixed.
A client could request single and multiple scans.
A scan request could be received while the scanner is already scanning.
Policy 1: discard requests.
Policy 2: queue requests.
10
The case study requirements
COORDINATION ISSUE
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
Situation A: synchronous request
11
Client 1 Laser Scanner
Three possible situations
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
Situation B: asynchronous request
12
Client 1 Laser Scanner
Three possible situations
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
Situation C: two or more asynchronous request
13
Client 2 Laser ScannerClient 1
Three possible situations
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
14
Laser Scanner
Measures Buffer
Client 1
Sensor Component
Applicable for situations A and B - Direct interaction
High level solution A
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
Laser Scanner
Measures Buffer
Client 2 Sensor Coordinator
Client 1
Sensor Component
15
Applicable for situation C - Direct interaction
High level solution B
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
16
SCANNING
IDLEBUSY
scan(from, nSteps, nScans)
"Ack"
"Done" &&
remScans > 0
"Done" &&
remScans = 0
Sensor Coordinator FSMPolicy 1
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
SCANNING
IDLEBUSY
scan(from, nSteps, nScans)
"Ack"
("Done" AND remScans > 0)OR
("Done" AND remScans = 0AND pendingReq > 0)
"Done" ANDremScans = 0 AND
pendingReq = 0
scan(from, nSteps , nScans)
scan(from, nSteps , nScans)
17
Sensor Coordinator FSMPolicy 2
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
18
The implementation
scan(from, nSteps)
update(eventName)
request(from, nSteps, nScans)MeasuresBufferWriting
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
19
The Sensor Coordinator ASMPolicy 1
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
20
The Sensor Coordinator ASMPolicy 1
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
21
The Sensor Coordinator ASMPolicy 1
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
22
The Sensor Coordinator ASMPolicy 1
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
The use of two different frameworks for modeling and implementing computation and coordination:
Improves flexibility and reusability: we can modify the implementation without having to change the coordination and vice-versa.
We can reuse a simple composite into a bigger composite (hierarchical containment).
23
Conclusions
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
The use of two different frameworks for modeling and implementing computation and coordination:
Improves flexibility and reusability: we can modify the implementation without having to change the coordination and vice-versa.
We can reuse a simple composite into a bigger composite (hierarchical containment).
SCA and ASM promise good results also in robotics domain !!!
23
Conclusions
lunedì 9 maggio 2011
Davide Brugali, Luca Gherardi, Patrizia ScandurraMay 9, 2011 - Shanghai, China
UNIVERSITÀ DEGLI
STUDI DI BERGAMO
The research leading to the results has received funding from the European Community’s Seventh Framework Programme (FP7/2007-2013) under grant agreement no. FP7-ICT-231940-BRICS (Best Practice in Robotics).
24
Thank you for your attention !!
lunedì 9 maggio 2011