Testing Physics Engines with Live Robot...

38
Testing Physics Engines with Live Robot Programming Johan Fabry (DCC UChile) Stephen Sinclair (Inria Chile)

Transcript of Testing Physics Engines with Live Robot...

Page 1: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Testing Physics Engines with Live Robot ProgrammingJohan Fabry (DCC UChile)

Stephen Sinclair (Inria Chile)

Page 2: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

3 Things

1. Physics Engines

2. LRP

3. Unit tests

2

Page 3: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Physics Engines

3

Page 4: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

What happens in Gazebo when you drop a ball?

Page 5: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Gazebo - Bullet

5

Page 6: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Gazebo - ODE

6

Page 7: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Gazebo - Siconos

7

Page 8: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Phys engines don’t always match real world behavior

Page 9: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

How do you test this?

• Don’t care about Root Main Square

• Test real-world situations!

• Different engines, different parameters

• So easy that a roboticist can write them

9

Page 10: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

3 Things

1. Physics Engines need real world tests

2. LRP

3. Unit tests

10

Page 11: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Live Robot Programming

11

Page 12: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Software Engineering For Robotics

12

Robotics =Problem complexity + Technology complexity

Page 13: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Waste less time in incidental complexity

13

Use time on fundamental complexity

Page 14: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

“But why is the robot executing this behavior now?”

Software Example

14

“What would happen if I change epsilon to 5 ?”

(What is the internal state of the algorithm)

(What are the correct parameters for the algorithm)

Page 15: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Spend brainpower on the complexity of the task

15

Have an immediate connection to the

behavior

Page 16: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Live Robot Programming

• Nested State machines

• Direct manipulation of running code

• Direct manipulation of vars in memory

• Direct manipulation of the machine

• (Not linked to specific API/middleware)

16

Page 17: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Immediate Connection

17

Page 18: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

A bouncing ball machine

18

Page 19: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Live Robot Programming

• Direct manipulation of running code

• Direct manipulation of vars in memory

• Direct manipulation of the machine

19

Page 20: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Immediate Connection

20

Page 21: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

“But why is the robot executing this behavior now?”

Software Example

21

“What would happen if I change epsilon to 5 ?”

(What is the internal state of the algorithm)

(What are the correct parameters for the algorithm)

Page 22: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Works with ROS (+others)

22

Page 23: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Great for orchestration

23

Page 24: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Works with other APIs

24

Page 25: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

More about the language in the paper

on the website.http://pleiad.cl/LRP

Page 26: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

3 Things

1. Physics Engines need real world tests

2. Live Robot Programming

3. Unit tests

26

Page 27: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Live Tests for Robotics

27

Page 28: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

How do you test this?

• Don’t care about Root Main Square

• Test real-world situations!

• Different engines, different parameters

• So easy that a roboticist can write them

28

Page 29: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Design principles

• Use trajectory logs of Gazebo

• Machine = State of the world

• Code accesses 1 snapshot of time

• Object trajectory = global variable

• High interactivity with the user

29

Page 30: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

API Examples(It’s a DSL)

• ball pose z

• ball velocity z > 0

•(ball pose ~ 0.02) z > top

• ball time >= stopTime

30

Page 31: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

User interface !

31

Page 32: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Immediate Connection

32

Page 33: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Bouncing ball test:

33

Page 34: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Sensible bounce

34

Page 35: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

More example tests in the paper

Page 36: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

Objectives achieved!

• Don’t care about Root Main Square

• Test real-world situations!

• Different engines, different parameters

• So easy that a roboticist can write them

36

Page 37: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

3 Things

1. Physics Engines need real world tests

2. Live Robot Programming

3. LT4R: Unit tests for nr 1 in nr 2

37

Page 38: Testing Physics Engines with Live Robot Programminglab-sticc.univ-brest.fr/~goulven/sharc2016/presentations-and-papers/... · Live Robot Programming • Nested State machines •

http://pleiad.cl/LRP

38