21
A Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer , Roland Reichle, Michael Zapf, Thomas Weise, Kurt Geihs <lastname>@vs.uni-kassel.de Distributed Systems Group, Kassel University, Germany

A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

A Generative Approach tothe Development of

Autonomous Robot Software

Philipp A. Baer, Roland Reichle,Michael Zapf, Thomas Weise, Kurt Geihs

<lastname>@vs.uni-kassel.de

Distributed Systems Group, Kassel University, Germany

Page 2: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 2

Short Introduction

♦ Main target: mobile autonomous robots♦ Message-oriented communication♦ Unreliable communication media

♦ Heterogeneous environments♦ Operating Systems (Windows, Linux, MacOS, ...)♦ Hardware Platforms (Intel, PowerPC, ...)♦ Software Platforms (C++, Java, .NET, ...)

Development framework forautonomous robot software

Page 3: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 3

Overview

I. Case Study: Mobile Robots

II. Model-Driven Development

III. Our Approach: Spica

IV. Lessons Learned

V. Outlook

VI. Summary

Page 4: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 4

I. Case Study: Mobile Robots

♦ Autonomous mobile robots♦ Resemble reactive distributed systems♦ Heterogeneous hardware/software architectures

♦ Modular Robot Software♦ Modules are processes♦ Modules communicate with each other

♦ Unreliable Communication Media♦ Communication may fail♦ Thus must be regarded optional

Page 5: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 5

II. Model-Driven Software Development

♦ Model-Driven Development (MDD) is here to stay♦ Modeling is widely-used and accepted♦ Generalized, proven technique: Model transformation

♦ Goals for Software Development♦ Simplification♦ Generalization with reusability♦ Code generation

♦ Not without controversy♦ Model Complexity♦ Correctness (Model/Assumption/Transformation)

Page 6: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 6

III. Spica Approach

♦ Abstract Architecture Specification (AAS)♦ Domain-specific Modeling Languages♦ Extensible

♦ Transformation Engine (AASTra)♦ Model transformation♦ Code transformation♦ AIR: in-memory parse-tree

♦ Arbitrary code targets♦ Template-based♦ Flexible generation rules

Page 7: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 7

III. Message Structures

♦ Message Definition Language (MDL)

♦ Similar to ASN.1♦ Domain-specific subset♦ Different field types

♦ Tags♦ Tags reference fields♦ Pre-initialize fields

♦ Versioning support

namespace <name>

struct <name> <tag assignments>ident <type> <name> <tags>;…

field <type> <name> <tags>;…revision <tag assignments>…

revision <tag assignments>…

Page 8: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 8

III. Communication Protocols

♦ Protocol Definition Language (PDL)

♦ Custom protocols♦ State-machine-based♦ Use standard transport protocols

♦ Logical processing♦ AND associations: group logically♦ OR associations: alternatives

♦ Extensible through class library-like mechanism♦ Required for every target language

sign(m), send(m,dest) |

Error(“Unable to sign!”);

Page 9: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 9

III. Data-Flow

♦ Data-Flow Definition Language (DFDL)

♦ Communication between Modules♦ Event-based communication♦ Connection-specific protocols♦ Message-specific data management

♦ Data Management Containers (DMC)♦ Message containers♦ Different semantics available

Module A

Module B

ConnectionT-Protocol = …C-Protocol = ……

Connection = …Messages = ……

Connection = …Messages = ……

Message : SrcDMC -> DstDMC

Page 10: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 10

♦ Transformation tool AASTra creates ready-to-run code♦ User only accesses DFDL and MDL code♦ PDL code is not directly accessible

♦ DFDL code: communication endpoints♦ Send operations♦ Receive callbacks

♦ MDL code: message structures

III. Spica User View

DFDLCode

MDLCode

PD

L C

ode

User

MDL

PDL

DFDL

Transform

ation

Page 11: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 11

III. Putting it all together: Carpe Noctem♦ Carpe Noctem Robot Soccer

♦ Autonomous mobile systems♦ Modular software architecture

♦ Heterogeneous Platforms♦ Hardware (Intel, PowerPC)♦ Software (C#, Java, C++)

♦ Entirely based on Spica-Models♦ 46 Message types♦ 18 Module models♦ 54 Connections♦ Currently no PDL protocols

Page 12: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 12

IV. Lessons Learned

♦ AAS languages are specialized subsets/combinations♦ MDL = subset of ASN.1♦ PDL = subset of SDL + PL

♦ Drawbacks♦ Early development/research phase♦ Writing Templates is complex♦ No accepted standard

♦ Advantages♦ Meets the needs of autonomous mobile systems♦ Flexible transformation tool

… with customizable in-/output

Page 13: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 13

V. Outlook♦ Extension of AAS languages

♦ MDL: cryptographically secure fields♦ PDL: integrate capabilities of other languages/techniques♦ DFDL: dynamic binding (service discovery)

♦ Secure dynamic binding is regarded most important

♦ Graphical modeling for DFDL (UML, ...)♦ Not necessary for MDL?♦ Not suited for PDL?

♦ More convenient template creation

Page 14: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 14

VI.Summary♦ Spica: A development framework for autonomous robot

systems♦ Based on the MDD-approach♦ Domain-specific modelling languages (MDL, PDL, DFDL)♦ Customizable target languages

♦ Spica integration for Soccer Robots♦ Event-based interaction♦ Modular software infrastructure

Page 15: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 15

Thank you!

Philipp A. Baer <[email protected]>

Page 16: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 16

References1. I. T. Union. Information Technology—Abstract Syntax Notation One

(ASN.1): Specification of Basic Notation. ITU-T Recommendation X.680, July 2002.

3. J. Ellsberger, D. Hogrefe, A. Sarma. SDL : formal object-oriented language for communicating systems, Prentice Hall, 1997.

5. Carpe Noctem Robocup Team Website. http://carpenoctem.das-lab.net/.

7. Object Management Group UML Website. http://www.uml.org/.

9. ANTLR Parser Generator. http://antlr.org/.

11. StringTemplate Template Engine. http://www.stringtemplate.org/.

Page 17: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 17

incomingError

handleverify

outgoing

handleincoming

getpublic key

public keyrequest

error error

error

errorverify pk req

no pk got pk

incoming

Network I/O

Program I/O

Transition

Outgoing (to the net)

Incoming (from the net)

III. Sample Protocol

Page 18: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 18

III. MDL Transformation Example 1

♦ MDL model:struct BaseMessage [Vendor=0,Type=0,Version=0] {

ident uint8 endian [Endian];ident uint8 vendor [Vendor];ident uint8 type [Type];ident uint8 version [Version];field uint32 msgid;

}

♦ Defines a header (ident) and one message field (field)♦ Header fields must be continuous!

2. AASTra generates the AIR♦ Step 1.1: parsing♦ Step 1.2: model checking♦ Step 1.3: cross-referencing

21

BaseMessage

0

endian vendor type version msgid

…is_Type tname

tags=…is_identdefault=…

tags=…versionshas_type

…base_type

derived=…signature

Messageversion

Messageattributes

Fieldattributes

Page 19: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 19

III. MDL Transformation Example 2

1. AASTra then triggers file generation♦ AIR tree processing: whole tree at once or single nodes

target Messages {FileSpec = Java/<node.namespace.Values; separator="/">/<node.name>.javaTreeHandling = Node:structsTemplates = …,templates/Java/<name>.stgEntryPoint = <name>}

♦ FileSpec Path to the target file to generate♦ TreeHandling Specifies how the AIR tree is handled♦ Templates A comma-separated list of tempalte files♦ EntryPoint Name of the main template file

References the target name

Output a multi-value attribute attributeusing a slash as separator.

Output thenode name

Enables/disables per-nodes processingand specifies the corresp. parent node.

Page 20: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 20

III. MDL Transformation Example 3

1. Code generation♦ Templates access AIR elements

lang_class(s) ::= <<public class <s> <if(s.super_type)> extends<first(s.super_type.Values) : { st |<st.signature; separator=".">}><endif>{<algo_declaration(s)><lang_constructor(s)>...}<\n>>>

Process the first elementof a multi-value attribute.

Output a multi-value attributeusing a dot as separator.

Conditional: Process the Instructionsonly if the attribute super_type exists.Output the node name

Page 21: A Generative Approach to the Development of Autonomous ... fileA Generative Approach to the Development of Autonomous Robot Software Philipp A. Baer, Roland Reichle, Michael Zapf,

2007-03.28 Spica—Development Environment for Robot Software 21

III. MDL Transformation Example 3♦ Code generation

♦ Code skeleton of the generated BaseMessage:

…public class BaseMessage {public BaseMessage() {}public short getMessageType() { … }public boolean getModified() { … }…public short getType() { … }public void setType(short value) { … }…public void encode(EncodeCNER encoder) throws IOException,Exception { … }public void decode(DecodeCNER decoder) throws IOException, Exception { … }…

}

♦ Generated implementation is either♦ inherited♦ or instantiated