JFall 2014 - A Storm of Drones

34

Transcript of JFall 2014 - A Storm of Drones

Page 1: JFall 2014 - A Storm of Drones
Page 2: JFall 2014 - A Storm of Drones

Inleiding

• Verdieping van Game of Drones • Technische uitleg van het systeem

• Frameworks, libraries, componenten • Problemen en uitdagingen

• Anders dan standaard JEE • Besturing vereist AI

2

Page 3: JFall 2014 - A Storm of Drones

Artificial Intelligence 101

3

Nodig voor autonome drones

Basisopzet van een AI-systeem: • Sensing: zintuigen,

“aanvoelen” van de omgeving

• Interpreting: interpreteren van de waargenomen waardes, bepalen acties

• Acting: uitvoeren van acties

Interpreting (Behaviors)

Acting(Drone

aansturing)

Sensing(Analyzers)

Page 4: JFall 2014 - A Storm of Drones

Subsumption architecture

4

Sensors'

Actuators'

Scenario'

Behaviour1'

Behaviour2'''''''

Besturing van meerdere drones en de presentatie “Mastermind” van het geheel

Besturing van een enkele drone, autonome operatie Directe interactie met een drone

Opdeling in herbruikbare tasks en behaviors die tasks combineren,

uitschakelen of beïnvloeden

Page 5: JFall 2014 - A Storm of Drones

Sensing: opzet

• Verschillende sensoren • Video, hoogte, gyroscoop…

• Analyzers • Sensing implementatie o.b.v. sensordata drones • Bv. patroonherkenning

• Verschil tussen analyse van eigen sensoren en externe apparaten • Eigen: continue stroom • Extern: event gebaseerd

5

Page 6: JFall 2014 - A Storm of Drones

Sensing: blackboard pattern

6

Verzamelplek van features

Verschillende analyzers als knowledge source die “Features” op het blackboard plaatsen

Interpretation deel: activeert Analyzers en interpreteert “Features”

Page 7: JFall 2014 - A Storm of Drones

Sensing probleem: lokalisering

• Indoor == GPS onbruikbaar • Geen absolute informatie behalve hoogte

• Behaviors vereisen dit wel • Relatieve informatie te onnauwkeurig • Oplossing: patroonherkenning

• Gezichtsdetectie: OpenCV • Kleurherkenning: home made

• Confidence • Scale back

• Focussen en details7

Page 8: JFall 2014 - A Storm of Drones

Interpreting - Behaviors

• Interpreting: • Goal - Sensing == ERROR

• Behavior: autonoom stukje gedrag • Bepaalt goal en daarmee besturing

• Javascript/Java koppeling • Scenario’s en Behaviors zijn steeds

verschillend • Realisatie veel trial-and-error • Verkorten van de develop/build/run cycle

8

Page 9: JFall 2014 - A Storm of Drones

Demo

9

Page 10: JFall 2014 - A Storm of Drones

Interpreting probleem: stabiliteit

• Automatische besturing noodzakelijk • Geen menselijke correcties meer • Wegregelen verstoringen en vertraging

• Probleem: stabiliteit, overshoot • Oplossing: betere feedback loop

• Vele kleine correcties • PID regelaar

10

Page 11: JFall 2014 - A Storm of Drones

Interpreting: PID

11

• Proportioneel, integraal, afgeleide

• Extra: reageren (I) en anticiperen (D)

• Makkelijk te realiseren, moeilijk te configureren • Trial & error

• x,y-as, z-as, rotatie

Page 12: JFall 2014 - A Storm of Drones

Acting

• Beperkte mogelijkheden • Hardware constraints

• Onnauwkeurigheid • Extern (bv. wind) en intern (bv. wrijving) • Sensing detecteert daadwerkelijke resultaat

• Relatieve besturing • “Ga 0,5s naar rechts met 25% vermogen”

12

Page 13: JFall 2014 - A Storm of Drones

Opzet

13

Page 14: JFall 2014 - A Storm of Drones

Componenten

14

Page 15: JFall 2014 - A Storm of Drones

Voorbeeld: Kong

15

1

2

Wijs drones toe aan teams

Page 16: JFall 2014 - A Storm of Drones

Voorbeeld: Kong

16

1, 2

Start Kong scenario

3

Page 17: JFall 2014 - A Storm of Drones

Voorbeeld: Kong

17

1, 5

Start game

2

3 4

Page 18: JFall 2014 - A Storm of Drones

Voorbeeld: Kong

18

1

Playing game

2 3

4

Page 19: JFall 2014 - A Storm of Drones

Voorbeeld: Kong

19

1

Einde scenario

2 3

4

Page 20: JFall 2014 - A Storm of Drones

Frameworks

20

YADrone: •Java-implementatie van ARDrone SDK

Vert.X: •Remoting, Eventing en Bus

OpenCV: •Standaard Library voor implementatie computer vision

Augmenters & video streaming

Reveal.js, AngularJS •HTML5 Presentatie framework

Page 21: JFall 2014 - A Storm of Drones

Vert.x

21

JVM/Vert.x Container

Bus (Hazelcast)

events

Verticle Behavior Verticle

Timer

Analyzer

new Thread() .start()

Page 22: JFall 2014 - A Storm of Drones

YADrone

• 100% java-based framework voor ARDrone • Reverse engineered vanaf

ARDrone SDK • Veel bugs

• CommandManager, ConfigurationManager VideoManager, NavDataManager • Listener-producer • Vertaling naar AT-Commandos

22

Page 23: JFall 2014 - A Storm of Drones

Augmenters & Video streaming

• Video pipeline implementatie • Augmenters voor presentatie

23

Analyzers

Augmenters Encoder

Page 24: JFall 2014 - A Storm of Drones

Presentatie

• Reveal.js als HTML5 presentatie framework • Externe interactie —> Integratie met

AngularJS • Draait als verticle binnen Vert.x • Interactie scenario’s - presentatie

• —> Go to slide x • —> Start video stream • —> Start muziek • <— Start scenario

24

Page 25: JFall 2014 - A Storm of Drones

Problemen

25

Page 26: JFall 2014 - A Storm of Drones

dd Defcon

Video streaming

• MJPEG stabiliteit • Delay/encoding (RTMP) • Latency

26

• Stabiliteit: • Socket timeouts (tickle) • Video en navdata hick-ups • Config aanpassingen

• Latency in YADrone • Bandbreedte bij meerdere

drones

Page 27: JFall 2014 - A Storm of Drones

Netwerk & Security• Elke drone heeft eigen AP

• unencrypted • first come, first serve

• ARDrone via WPA2 koppelen aan Airport • firmware aanpassing noodzakelijk • m.b.v. Android app

27

Page 28: JFall 2014 - A Storm of Drones

Vragen?

28

Page 29: JFall 2014 - A Storm of Drones

Links• YADrone: http://vsis-www.informatik.uni-hamburg.de/oldServer/teaching//

projects/yadrone/ • YADrone (Salves versie met bugfixes): https://github.com/ronsmits/YADrone • ARDrone WPA: https://github.com/daraosn/ardrone-wpa2 • ARDrone SDK: https://projects.ardrone.org/ • Subsumption architecture: http://en.wikipedia.org/wiki/

Subsumption_architecture • Java ScriptEngine: http://docs.oracle.com/javase/7/docs/api/javax/script/

ScriptEngine.html • PID Controllers: http://en.wikipedia.org/wiki/PID_controller

• MindWave - http://store.neurosky.com/products/mindwave-1 • Reveal.JS: http://lab.hakim.se/reveal-js/#/ • Vert.x: http://vertx.io/ • OpenCV: http://opencv.org/

29

Page 30: JFall 2014 - A Storm of Drones

Backupslides

30

Page 31: JFall 2014 - A Storm of Drones

PID: Kp

31

Page 32: JFall 2014 - A Storm of Drones

PID: Ki

32

Page 33: JFall 2014 - A Storm of Drones

PID: Kd

33

Page 34: JFall 2014 - A Storm of Drones

Optioneel: YADrone opzet

34