Presentation is loading. Please wait.

Presentation is loading. Please wait.

Daniele Nardi, Carlo Matteo Scalzo Context-based Robotic Systems Dipartimento di Informatica e Sistemistica Sistemi Intelligenti per lEmergenza e la Difesa.

Similar presentations


Presentation on theme: "Daniele Nardi, Carlo Matteo Scalzo Context-based Robotic Systems Dipartimento di Informatica e Sistemistica Sistemi Intelligenti per lEmergenza e la Difesa."— Presentation transcript:

1 Daniele Nardi, Carlo Matteo Scalzo Context-based Robotic Systems Dipartimento di Informatica e Sistemistica Sistemi Intelligenti per lEmergenza e la Difesa Civile sied.dis.uniroma1.it

2 OpenRDK Workshop, Rome, March 2009Pagina 2 Meanings of context Cognitive science: Human uses of contextual information (Context-07 Conference in Roskilde) Artificial Intelligence: View of a given representation (Mc Carthy) Hypothetical Reasoning Robotics: Turner 1998 …

3 OpenRDK Workshop, Rome, March 2009Pagina 3 Context A context is any identifiable configuration of environmental, mission-related and agent-related features that has predictive power for behaviour [Turner 1998] Used for behaviour selection

4 OpenRDK Workshop, Rome, March 2009Pagina 4 Motivation/related work How can the knowledge that robot is in a specific rescue scenario be used to improve performance? Terrain classification for specialized behaviours [Dornege and Kleiner 2008] Tuning localization and mapping based on environmental knowledge [Several authors] Multi-Objective exploration [Calisi et. al 2007] Driving object/people perception tracking [Several authors]

5 OpenRDK Workshop, Rome, March 2009Pagina 5 Architecture (multi hyper graph)

6 OpenRDK Workshop, Rome, March 2009Pagina 6 PerceptSLAMNav+ Expl Behaviour Blackboard (Repository) Contextual representation Practical (RDK) Architecture Contextual reasoning Context building

7 OpenRDK Workshop, Rome, March 2009Pagina 7 Architecture in detail

8 OpenRDK Workshop, Rome, March 2009Pagina 8 Current implementation in OpenRDK* 100 variables –Input data –Input parameters Knowledge based system to –Build single context (using all possible sources) –Reason about context to determine suitable values for module parameters implemented in PROLOG –IF THEN parameter = value A modular framework for Robotic Software Development

9 OpenRDK Workshop, Rome, March 2009Pagina 9 Experimental validation Against whom ? Our rescue system with/without context Which testbed ? USARSim Real Robots Which tasks ? Localization and Mapping Mapping and Navigation Exploration and victim detection Which performance metric?

10 OpenRDK Workshop, Rome, March 2009Pagina 10 Our experimental system: SPQR-rescue Experiments with and without context

11 OpenRDK Workshop, Rome, March 2009Pagina 11 Qualitative example: Navigation and Mapping

12 OpenRDK Workshop, Rome, March 2009Pagina 12 Navigation and mapping (cntd)

13 OpenRDK Workshop, Rome, March 2009Pagina 13 Localization and Mapping with RFIDs

14 OpenRDK Workshop, Rome, March 2009Pagina 14 Mapping, Navigation and Exploration

15 OpenRDK Workshop, Rome, March 2009Pagina 15 Context setting

16 OpenRDK Workshop, Rome, March 2009Pagina 16 Experiment results

17 OpenRDK Workshop, Rome, March 2009Pagina 17 Victim search and exploration in USARSim S&R mission Measures of performance: –amount of environment explored –number victims Modules (with parameters): –navigation (planner, speed, jog) –mapping (on, scanmatch, elevation) –exploration (on, mobility, victims, distance, frontier) –victim perception (multi, snapshot, snap_distance) Mission knowledge always available (with and without context)

18 OpenRDK Workshop, Rome, March 2009Pagina 18 Experimental Setting: USARSIM Environment Indoor map used at German Open 2008 Rescue robot Pioneer 2AT SICK LRF HOKUYO (inclined) Victim sensor

19 OpenRDK Workshop, Rome, March 2009Pagina 19 Contextual rules

20 OpenRDK Workshop, Rome, March 2009Pagina 20 Experimental evaluation: qualitative Repeated several times: -reduced stalls -larger explored area -more victims found -better reports generated Examples

21 OpenRDK Workshop, Rome, March 2009Pagina 21 Results of the exploration and victim detection

22 OpenRDK Workshop, Rome, March 2009Pagina 22 Conclusion Contextualization as a design pattern can be very effective in improving the performance of robots Single representation of context: improved acquisition of contextual information reasoning about context for –tuning performance –fault diagnosis and recovery Contextual knowledge is a requirement for rescue systems

23 OpenRDK Workshop, Rome, March 2009Pagina 23 Future Work Context acquisition Push modularization Mixed initiative high level control Contextual exploration with multiple robots

24 OpenRDK Workshop, Rome, March 2009Pagina 24 Implementation: OpenRDK PerceptSLAM Nav + Expl Behaviour Blackboard (Repository) Context- based controller

25 OpenRDK Workshop, Rome, March 2009Pagina 25 Perce pt SLAM Nav + Expl Behaviou r Blackboard (Repository) Context- based controlle r Implementation: OpenRDK

26 OpenRDK Workshop, Rome, March 2009Pagina 26 Programming languages C++ / Prolog interface Prolog / C++ interface Prolog

27 OpenRDK Workshop, Rome, March 2009Pagina 27 Context-based controller The context-based controller is a single (standard) OpenRDK module A Prolog engine is embedded (as a C++ library) in the context-based controller ECLiPSe Prolog was chosen as the Prolog engine because it can be easily embedded in a C++ system

28 OpenRDK Workshop, Rome, March 2009Pagina 28 Context-based controller ECLiPSe Prolog Blackboard (Repository) SLAM... Percept

29 OpenRDK Workshop, Rome, March 2009Pagina 29 Control loop [1/2] Context-based controller ECLiPSe Prolog Blackboard (Repository) SLAM... Percept

30 OpenRDK Workshop, Rome, March 2009Pagina 30 Control loop [2/2] Context-based controller ECLiPSe Prolog Blackboard (Repository) SLAM... Percept

31 OpenRDK Workshop, Rome, March 2009Pagina 31 Context-based controller in OpenRDK : init() The Prolog engine must be initialized in the init() function of the module –ec-init() starts the ECLiPSe Prolog engine The knowledge base (one or more Prolog source files) must be compiled after the initialization of the Prolog engine –posting the goal compile(prologSource) compiles the kb

32 OpenRDK Workshop, Rome, March 2009Pagina 32 bool ContextPrologModule::init() { SESSION_TRY_START(session) // Start Eclipse Prolog engine char* eclipsedir = const_cast ((session->getString(PROPERTY_ECLIPSE_DIR)).c_str()); string prologsource = session->getString(PROPERTY_PROLOG_SOURCE); ec_set_option_ptr(EC_OPTION_ECLIPSEDIR, eclipsedir); if(ec_init() < 0) { RDK_ERROR_PRINTF("%s: could not initialize ECLiPSe\n",getModuleName().c_str()) ; return false ; } init()[1/2]

33 OpenRDK Workshop, Rome, March 2009Pagina 33 // Compile Prolog source file string cmd = "compile('" + prologsource + "')"; char* compile = const_cast (cmd.c_str()); post_goal(compile); if(EC_resume() < 0) RDK_ERROR_PRINTF("%s: could not load Prolog source\n",getModuleName().c_str()); session->listenToTimer(500.); SESSION_END(session) return true; SESSION_CATCH_TERMINATE(session) return false; } init()[2/2]

34 OpenRDK Workshop, Rome, March 2009Pagina 34 A real example of control loop Controller inputs: –2D map(received from the SLAM module) –2.5D map (received from the height-map module) Controller outputs: –max speed value (sent to the motion planning module) –motion planner to use (sent to the motion planning module)

35 OpenRDK Workshop, Rome, March 2009Pagina 35 A real example of control loop Step 1: extracting contextual knowledge from controllers inputs Ifclutterness-measure(2D-Map) > 0.5 Then clutterness = high Else clutterness = low Ifroughness-measure(2.5D-Map) > 0.5 Then roughness = high Else roughness = low C++ / Prolog interface

36 OpenRDK Workshop, Rome, March 2009Pagina 36 C++ / Prolog interface String clutterness; if (clutternessMeasure(2dmap) > 0.5) then clutterness = high; else clutterness = low; EC_atom prologClutterness(const_cast (clutterness.c_str())); ECLiPSe Prolog terms can be created from C++ Strings using the EC_atom class

37 OpenRDK Workshop, Rome, March 2009Pagina 37 A real example of control loop Step 2: reasoning IF (clutterness = high OR roughness = high) THEN max-speed = low ELSE max-speed = high IF (clutterness = high) THEN motion-planner = rkt ELSE motion-planner = dwa

38 OpenRDK Workshop, Rome, March 2009Pagina 38 Reasoning in Prolog The knowledge base contains all the rules used by the reasoning process % maxSpeedRule( Clutterness, Roughness, MaxSpeed ) maxSpeedRule( high, _, low ) :- !. maxSpeedRule( _, high, low) :- !. maxSpeedRule( _, _, high ):- !.

39 OpenRDK Workshop, Rome, March 2009Pagina 39 A real example of control loop Step 3: translating contextual knowledge in parameters for other modules If (maxSpeed = high) Then maxSpeedValue = 1 m / s If (maxSpeed = low) Then maxSpeedValue = 0.2 m / s If (motionPlanner = rkt) Then motionPlanningMode = 0 If (motionPlanner = dwa) Then motionPlanningMode = 1 Prolog / C++ interface

40 OpenRDK Workshop, Rome, March 2009Pagina 40 Prolog / C++ interface % maxSpeedValue ( maxSpeed, maxSpeedValue ) maxSpeedValue ( high, 1 ) :- !. maxSpeedValue ( low, 0.2) :- !. ECLiPSe Prolog terms can be translated into C++ doubles using the is_double() function double maxSpeedValue; ((EC_word) maxSpeed).is_double(&maxSpeedValue);

41 OpenRDK Workshop, Rome, March 2009Pagina 41 Performance issues The ECLiPSe Prolog engine is a C++ library: calling a predicate is almost as fast as calling a C++ function The reasoning process is implemented as a Prolog program with no backtracking and no dynamic clause database management (i.e., no assert / retract) The context-based controller OpenRDK module do not slow down the entire system

42 OpenRDK Workshop, Rome, March 2009Pagina 42 Declarative Programming and Fast Prototyping Why should we use Prolog to implement reasoning ? Couldnt we use C++ ?

43 OpenRDK Workshop, Rome, March 2009Pagina 43 Reasoning: C++ implementation Reasoning rules hardwired in the code (rules are specified using C++ if-then-else) Pros: –No configuration is needed (OpenRDK is implemented in C++) Cons: –To change the rules (or parts thereof) one has to modify the source code of the module –Writing complex rules using if-then-else constructs makes the code hard to read and mantain

44 OpenRDK Workshop, Rome, March 2009Pagina 44 Reasoning: Prolog implementation Reasoning rules are specified in a knowledge base (one or more Prolog source files), which is compiled when the module is initialized Pros: –Rapid Prototyping: reasoning rules can be modified in the Prolog source file, no change to the source code of the module is needed –Complex rules can be easily expressed and managed –More advanced features: negation as failure, constraint programming Cons: –To embed ECLiPSe Prolog in C++, a configuration phase is needed

45 OpenRDK Workshop, Rome, March 2009Pagina 45 How to create an OpenRDK module embedding a Prolog engine Configuration of the Prolog engine (i.e., linking it as a C++ library) The module is a standard OpenRDK module: it reads its inputs from the blackboard and writes its outputs to the blackboard The module is initialized by starting the Prolog engine and compiling the Prolog source files Internally, C++ data can be easily translated into Prolog terms (and vice-versa) using specific C++ functions The Prolog engine can be queried using specific C++ functions, thus obtaining the results of the reasoning phase

46 OpenRDK Workshop, Rome, March 2009Pagina 46 Any Questions ?

47 OpenRDK Workshop, Rome, March 2009Pagina 47 Contacts


Download ppt "Daniele Nardi, Carlo Matteo Scalzo Context-based Robotic Systems Dipartimento di Informatica e Sistemistica Sistemi Intelligenti per lEmergenza e la Difesa."

Similar presentations


Ads by Google