RoboChart & RoboSim Modelling Robots and Collections Alvaro - - PowerPoint PPT Presentation

robochart robosim
SMART_READER_LITE
LIVE PREVIEW

RoboChart & RoboSim Modelling Robots and Collections Alvaro - - PowerPoint PPT Presentation

RoboChart & RoboSim Modelling Robots and Collections Alvaro Miyazawa Department of Computer Science University of York January 23, 2019 Outline Introduction RoboChart RoboSim Collection modelling Robotic platform modelling 1 42


slide-1
SLIDE 1

RoboChart & RoboSim

Modelling Robots and Collections Alvaro Miyazawa

Department of Computer Science University of York January 23, 2019

slide-2
SLIDE 2

Outline

Introduction RoboChart RoboSim Collection modelling Robotic platform modelling

1 42

slide-3
SLIDE 3

Introduction

slide-4
SLIDE 4

Motivation

1st phase: Abstract model

state machine

1st phase: Abstract model

state machine controller code hardware simulation discrete environment simulation

2nd phase: Simulation

controller code hardware simulation discrete environment simulation

2nd phase: Simulation

low-level code robot environment

3rd phase: Implementation

2 42

slide-5
SLIDE 5

Motivation

State machines are often used to record, illustrate and explain Usage is informal Potential:

◮ Testing ◮ Code generation ◮ Verification

3 42

slide-6
SLIDE 6

Objective

Graphical notations Formal semantics Specialised, but comprehensive Supporting simulation, analysis and verification

4 42

slide-7
SLIDE 7

Approach

RoboChart Models Requirements

ARGoS

RoboTool C++ PRISM Storm Reactive Modules Formalism CSP and timed-CSP Qualitative Results Simulation Quantitative Results

5 42

slide-8
SLIDE 8

RoboChart

slide-9
SLIDE 9

RoboChart

Standard state machines + time + probability Formal semantics: untimed, timed and probabilistic Well-formedness conditions Tool support:

◮ Modelling ◮ Validation ◮ Code generation: semantics and simulation

6 42

slide-10
SLIDE 10

Module

Models a single Robot 1 Robotic Platform 1+ Controllers Communication

◮ Synchronous ◮ Asynchronous

Robotic Platform may provide shared variables

7 42

slide-11
SLIDE 11

Robotic Platform

Records assumptions about the robot hardware

◮ which events the robot provides ◮ which operations the robot supports ◮ which variables are available

Independent of controller and state-machines Single point of interaction with robot

8 42

slide-12
SLIDE 12

Controller

Models a specific behaviour Contains:

◮ Behavioural state-machines ◮ Operations ◮ Variables ◮ Events

Supports multiple behavioural state-machines Communication between state-machines is synchronous

9 42

slide-13
SLIDE 13

State-Machine

Main behavioural specification construct Models both operations and behaviours Simple, Composite and Final states Initial and junction nodes Non-interlevel transitions Actions: entry, during, exit, transition Local variables

10 42

slide-14
SLIDE 14

Types and Action Language

Types based on Z Mathematical Toolkit Action language:

◮ Assignment ◮ Event signalling ◮ Operation call ◮ Sequential composition

Control statements modelled using junctions and transitions

11 42

slide-15
SLIDE 15

Semantics

Formalised in CSP Coverage:

◮ State-Machines ◮ Controllers ◮ Robotic Platforms ◮ Modules

12 42

slide-16
SLIDE 16

Semantics: Overview

Module = CSP Process

◮ Parallel composition of controllers ◮ Connections define synchronisation sets ◮ Asynchronous communication modelled through buffers ◮ Robotic platform incorporated via renaming

Controller = CSP Process

◮ Parallel composition of state-machines ◮ Connections define synchronisation sets ◮ External interactions via controller established via renaming

13 42

slide-17
SLIDE 17

Semantics: Overview

State-Machine = CSP Process

◮ Parallel composition of states ◮ Transitions are part of the source states ◮ Junctions are part of the incoming transition ◮ Initial nodes and final states are part of the parent state ◮ States interact with each other to enter and exit ◮ States synchronise on transition triggers to support top-down interruption

Action language

◮ Operation call = Process call ◮ Event signalling = Communication on event channel ◮ Assignment = Communication on setter channel

State components

◮ Isolated in memory process due to sharing ◮ Help avoid polling for transition conditions

14 42

slide-18
SLIDE 18

RoboTool

Eclipse plugins Textual editor developed using Xtext Graphical editor developed using Sirius Code generator for the semantics Code generator for simulation Validation rules

15 42

slide-19
SLIDE 19

RoboTool

16 42

slide-20
SLIDE 20

RoboTool

Case studies:

◮ Alpha Algorithm (Single Robot and Collection); ◮ Chemical Detector; ◮ Autonomous Chemical Detector; ◮ Foraging; ◮ Transport; etc.

Generated semantics used for verification using FDR4 FDR4 compression functions highly effective

17 42

slide-21
SLIDE 21

Current developments

Generation of simulations Generation of probabilistic semantics Generation of sematics for Isabelle/UTP

18 42

slide-22
SLIDE 22

RoboSim

Based on RoboChart Explicit cyclic pattern for simulation Related to RoboChart models via refinement

19 42

slide-23
SLIDE 23

Collection Modelling

slide-24
SLIDE 24

Motivation

RoboChart

The focus of RoboChart is the modelling, analysis and simulation

  • f individual robots.

20 42

slide-25
SLIDE 25

Motivation

RoboChart

The focus of RoboChart is the modelling, analysis and simulation

  • f individual robots.

Other notations

Support in other notations tends to be concrete.

20 42

slide-26
SLIDE 26

Objective

Support modelling, analysis and simulation of collections Reuse RoboChart models and semantics

21 42

slide-27
SLIDE 27

Extensions

new implicit type ID and module constant id; robotic platform events are broadcast and directional; broadcast events have implicit ID parameters: to and from; input events can restrict from and record its value;

  • utput events can restrict to parameter; and

new diagram describes group of collections and how they communicate.

22 42

slide-28
SLIDE 28

Models

23 42

slide-29
SLIDE 29

Semantics of collections

(9 i : {1..N} • AggregationRobot(i)) J{ |report.in, report.out, ack.in, ack.out| }K   

9 i : {1..N} • 9 j : ({1..N} \ {i}) • Buffer(, report, i, report, j)

9

9 i : {1..N} • 9 j : ({1..N} \ {i}) • Buffer(, ack, i, ack, j)

  

24 42

slide-30
SLIDE 30

Alpha Algorithm

25 42

slide-31
SLIDE 31

Alpha Algorithm (old)

26 42

slide-32
SLIDE 32

Alpha Algorithm (new)

27 42

slide-33
SLIDE 33

Events and their semantics

ev![|pred|]!e semantics ev.out.id?to : {x | x ← ID, pred}!e − → Skip ev[| v = from | pred |]?u semantics ev.in?from : {x | x ← ID, pred}.id?y − → set v!from − → set u!y − → Skip

28 42

slide-34
SLIDE 34

Current status Partial support for modelling Code generation for semantics Validation

29 42

slide-35
SLIDE 35

Current status Partial support for modelling Code generation for semantics Validation Ongoing work Complete modelling support Extend simulation generation

29 42

slide-36
SLIDE 36

Current status Partial support for modelling Code generation for semantics Validation Ongoing work Complete modelling support Extend simulation generation Future work Optimise verification Investigate data abstraction and induction with FDR4 Investigate theorem proving with Isabelle/UTP

29 42

slide-37
SLIDE 37

Robotic platform modelling

slide-38
SLIDE 38

Motivation

RoboChart focuses on modelling controllers Robotic platform is abstracted as a set of events, variables and operations Existing XML-based notations: URDF, SDF, Collada

◮ not convenient for modelling ◮ not abstract enough ◮ no facilities for modelling behaviour

30 42

slide-39
SLIDE 39

Objectives

Restructure and refactor SDF Provide graphical representation Extend with facilities to

◮ model behaviours ◮ map between operations, events and variables to sensors and actuators

Formal semantics integrated with RoboSim Linked to RoboChart via abstraction Generate both SDF models and platform dependent simulation code

31 42

slide-40
SLIDE 40

Simple Model

32 42

slide-41
SLIDE 41

Simple Model

33 42

slide-42
SLIDE 42

Simple Model

34 42

slide-43
SLIDE 43

Simple Model

35 42

slide-44
SLIDE 44

Simple Model

36 42

slide-45
SLIDE 45

Semantics

Inputs

distance : T → R

Outputs

las, ras : T → R

Behaviour Revolute

v = R × b × das/K + K × das J × as′ + b × as = K × i L × i′ + R × i = v − K × as

Behaviour IR

voltage = 4 × e−0.028×distance

37 42

slide-46
SLIDE 46

Simple Model

A = (Revolute[ [das := ldas, . . .] ] | Revolute[ [das := rdas, . . .] ] | IR) Step(l, r) = µ X • (A init ldas, rdas = l, r) until (voltage > 3); obstacle − → X

  • M = var l, r : R • l, r := 0, 0; µ X • Step(l, r) △
  • move.ls.as −

→ {l, r} : true, ls = rd × (l + r)/2 ∧ as = rd × (l − r)/aL

  • ; X
slide-47
SLIDE 47

Simple Model

A = (Revolute[ [das := ldas, . . .] ] | Revolute[ [das := rdas, . . .] ] | IR) Step(l, r) = µ X • (A init ldas, rdas = l, r) until (voltage > 3); obstacle − → X

  • M = var l, r : R • l, r := 0, 0; µ X • Step(l, r) △
  • move.ls.as −

→ {l, r} : true, ls = rd × (l + r)/2 ∧ as = rd × (l − r)/aL

  • ; X
slide-48
SLIDE 48

Simple Model

A = (Revolute[ [das := ldas, . . .] ] | Revolute[ [das := rdas, . . .] ] | IR) Step(l, r) = µ X • (A init ldas, rdas = l, r) until (voltage > 3); obstacle − → X

  • M = var l, r : R • l, r := 0, 0; µ X • Step(l, r) △
  • move.ls.as −

→ {l, r} : true, ls = rd × (l + r)/2 ∧ as = rd × (l − r)/aL

  • ; X
slide-49
SLIDE 49

Simple Model

A = (Revolute[ [das := ldas, . . .] ] | Revolute[ [das := rdas, . . .] ] | IR) Step(l, r) = µ X • (A init ldas, rdas = l, r) until (voltage > 3); obstacle − → X

  • M = var l, r : R • l, r := 0, 0; µ X • Step(l, r) △
  • move.ls.as −

→ {l, r} : true, ls = rd × (l + r)/2 ∧ as = rd × (l − r)/aL

  • ; X
slide-50
SLIDE 50

Simple Model

A = (Revolute[ [das := ldas, . . .] ] | Revolute[ [das := rdas, . . .] ] | IR) Step(l, r) = µ X • (A init ldas, rdas = l, r) until (voltage > 3); obstacle − → X

  • M = var l, r : R • l, r := 0, 0; µ X • Step(l, r) △
  • move.ls.as −

→ {l, r} : true, ls = rd × (l + r)/2 ∧ as = rd × (l − r)/aL

  • ; X
slide-51
SLIDE 51

Simple Model

A = (Revolute[ [das := ldas, . . .] ] | Revolute[ [das := rdas, . . .] ] | IR) Step(l, r) = µ X • (A init ldas, rdas = l, r) until (voltage > 3); obstacle − → X

  • M = var l, r : R • l, r := 0, 0; µ X • Step(l, r) △
  • move.ls.as −

→ {l, r} : true, ls = rd × (l + r)/2 ∧ as = rd × (l − r)/aL

  • ; X
slide-52
SLIDE 52

Simple Model

A = (Revolute[ [das := ldas, . . .] ] | Revolute[ [das := rdas, . . .] ] | IR) Step(l, r) = µ X • (A init ldas, rdas = l, r) until (voltage > 3); obstacle − → X

  • M = var l, r : R • l, r := 0, 0; µ X • Step(l, r) △
  • move.ls.as −

→ {l, r} : true, ls = rd × (l + r)/2 ∧ as = rd × (l − r)/aL

  • ; X
  • 38

42

slide-53
SLIDE 53

Semantics

Behaviours

A = (Revolute[ [das := ldas, . . .] ] | Revolute[ [das := rdas, . . .] ] | IR)

39 42

slide-54
SLIDE 54

Semantics

Behaviours

A = (Revolute[ [das := ldas, . . .] ] | Revolute[ [das := rdas, . . .] ] | IR) Step(l, r) = µ X • (A init ldas, rdas = l, r) until (voltage > 3);

  • bstacle −

→ X

  • 39

42

slide-55
SLIDE 55

Semantics

Behaviours

A = (Revolute[ [das := ldas, . . .] ] | Revolute[ [das := rdas, . . .] ] | IR) Step(l, r) = µ X • (A init ldas, rdas = l, r) until (voltage > 3);

  • bstacle −

→ X

  • M = var l, r : R • l, r := 0, 0;

µ X •   Step(l, r) △ move.ls.as− → {l, r} : true, ls = rd × (l + r)/2 ∧ as = rd × (l − r)/aL

  • ; X

 

39 42

slide-56
SLIDE 56

Semantics

A: behaviours of the platform model. Step: behaviours in A until input events are true. M: behaviours in Step interrupted by variables assignments, operation calls and output events

40 42

slide-57
SLIDE 57

Conclusions

RoboChart supports modelling including time and probability Formal semantics specified in CSP Tool support for modelling, verification and simulation RoboSim models can be

◮ derived from RoboChart models ◮ related to RoboChart models formally

Partial support for modelling collections and robotic platforms

41 42

slide-58
SLIDE 58

Current work

Modelling support for platform modelling Case studies in platform modelling Generation of

◮ SDF models ◮ simulation code ◮ formal semantics

Integration with RoboChart models via abstraction

42 / 42

slide-59
SLIDE 59

References

Ana Cavalcanti, Alvaro Miyazawa, Augusto Sampaio, Wei Li, Pedro Ribeiro, and Jon Timmis. Modelling and verification for swarm robotics. In Carlo A. Furia and Kirsten Winter, editors, Integrated Formal Methods, pages 1–19, Cham, 2018. Springer International Publishing. DOI: 10.1007/978-3-319-98938-9 1. Alvaro Miyazawa, Pedro Ribeiro, Wei Li, Ana Cavalcanti, Jon Timmis, and Jim Woodcock. Robochart: modelling and verification of the functional behaviour of robotic applications. Software and Systems Modeling, 2019. DOI: 10.1007/s10270-018-00710-z (To Appear).