KNOWROB - OVERVIEW Present by: Nguyen Huu Quang What is KNOWROB? • KNOWROB is a knowledge processing system that combines knowledge representation and reasoning methods with techniques for acquiring knowledge and for grounding the knowledge in a physical system. • It can serve as a common semantic framework for integrating information from different sources and is used in ROBOEARTH as local knowledge base on the robot. • Compared to RAPYUTA: RAPYUTA is the ROBOEARTH Cloud Engine. It helps robots to off-load heavy computation by providing secure customizable computing environments in the cloud. General concepts of KNOWROB • The world as a virtual knowledge base: – KNOWROB do not pre-compute all knowledge that could be needed and push this information into the knowledge base. – KNOWROB give the knowledge base the ability to compute knowledge on demand when it is actually needed, and to ask other components if the required information is not available. General concepts of KNOWROB • On-demand computation: – One important application of computables is to load information into the knowledge base. Computable classes can for example generate object instances by asking the vision system for the objects it has detected. Another application is to compute qualitative relations between objects. If the object poses are known, qualitative spatial relations like “in”, “on”, or “next to” can easily be computed on demand. General concepts of KNOWROB • Logic-based representation: – In KNOWROB, we choose Description Logics (DL) as formalism to represent the robot’s knowledge. Description logics are a family of logical languages for knowledge representation, consisting of several dialects with different expressiveness, most of which are a decidable subset of first-order logic. In particular, we use the Web Ontology Language-OWL for storing Description Logic formulas in an XML-based file format. General concepts of KNOWROB • Prolog-based inference: – KNOWROB is implemented based on Prolog because inference in Prolog is mainly a search procedure, and it is very easy to add additional alternatives to each step by just defining an additional predicate. General concepts of KNOWROB • Modular design: – KNOWROB is designed to be usable on a wide range of robot platforms with different capabilities (and even on non-robotic systems). – To flexibly add, remove, or exchange parts of its functional-ity, it is implemented in a very modular way. – Each module can provide two kinds of extensions: First, it can contain additional knowledge as an extension of the KNOWROB ontology, and second also additional reasoning or computation capabilities, realized as new computable classes or properties. System architecture • Functional overview of KNOWROB: System architecture • Functional overview of KNOWROB: Description logic inference • A knowledge processing system needs methods to store knowledge, to query for it, and to combine pieces of knowledge to perform logical inferences. • There are several existing reasoners: Racer, Pellet, HermiT, but unfortunately they are not well-suited to robotics applications. • KNOWROB choose a solution based on Prolog: The knowledge is internally represented in terms of Prolog predicates to which the common Prolog inference methods can be applied. Description logic inference • In KNOWROB, all knowledge is represented in the OWL (Web Ontology Language). • KnowRob is implemented in SWI Prolog. – Prolog is used for loading, storing and reasoning on the knowledge which is represented in OWL. – Prolog is used as a programming language to implement specialized reasoning modules and to interface the knowledge base with external data. Programming languages ? • KNOWROB is implemented in a combination of OWL, Prolog and Java. • OWL: – Description language, no programming language – Class taxonomy of objects, actions, events,… – Instances of these classes (e.g. environment models, experiences) – Robot capabilities/action requirements Programming languages ? • KNOWROB is implemented in a combination of OWL, Prolog and Java. • Prolog: – Logical programming language: conceptually close to the knowledge representation, good at searching and pattern matching – Useful for functionality interacting closely with the internal representation (OWL gets parsed into Prolog triples) – Wrapper predicates to simplify commonly used queries, inference predicates (DL inference, computables,…) – Functionality involving (recursive) search, graph matching, reasoning about ontological structure, … Programming languages ? • KNOWROB is implemented in a combination of OWL, Prolog and Java. • Java: – Object-oriented programming language that can interact with Prolog via the JPL interface – Conceptually further away from the internal knowledge representation – Good library support, therefore useful for external interfaces (WWW, ROS,…) and for integrating libraries (ProbCog, Weka, Visualization…) Programming languages ? • Introduction to Prolog: – There are only three basic constructs in Prolog: facts, rules, and queries. A collection of facts and rules is called a knowledge base (or a database) and Prolog programming is all about writing knowledge bases. – Prolog programs simply are knowledge bases, collections of facts and rules which describe some collection of relationships. – How do we use a Prolog program? By posing queries. Programming languages ? • Introduction to Prolog: – Example: Let’s say we have knowledge base like this woman(mia). woman(jody). woman(yolanda). playsAirGuitar(jody). party. How can we use KB? By posing queries. ?- woman(mia). Prolog will answer yes ?- playsAirGuitar(mia). Prolog will answer no Programming languages ? • Introduction to Prolog: – Example: Let’s say we have knowledge base like this happy(yolanda). listens2Music(mia). listens2Music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2Music(mia). playsAirGuitar(yolanda):- listens2Music(yolanda). Installing and Launching • Installation from binary packages: sudo apt-get install ros-groovy-knowrob • Installation from source (basic installation): rosws merge https://raw.github.com/knowrob/knowrob/ master/rosinstall/knowrob-base.rosinstall rosws update rosdep install knowrob rosmake knowrob Installing and Launching • Launching a package: rosrun rosprolog rosprolog <pkgname> • Example: rosrun rosprolog rosprolog mod_vis KNOWROB package list • • Starting and accessing Prolog – rosprolog: Start an interactive Prolog shell – json_prolog: Start ROS service that offers a query interface Base system – ias_knowledge_base: Core ontology and basic reasoning modules – knowrob_common: Common utilities for handling OWL (import/export, OWL reasoner interface, convenience query predicates), units of measure, and other generic functionality – knowrob_objects: Object-related functionality, supporting spatio-temporal reasoning, generation of the internal object representation, representation and conversion of coordinates – knowrob_actions: Read action properties, project effects of actions and processes, reason about transformations of objects induced by actions – ias_semantic_map: Semantic environment map representation in OWL – ias_prolog_addons: Prolog extensions such as the interface to the Weka and Mallet classification libraries, Jython interface, computation of semantic similarity measures between concepts – semweb: Semantic Web library of SWI prolog with extensions, e.g. computable properties – thea: OWL parser library KNOWROB package list • • • • Reasoning packages – comp_spatial: Compute qualitative spatial relations from object poses – comp_temporal: Compute temporal relations, e.g. Allen's interval algebra – mod_vis: Visualization of the content of the knowledge base – knowrob_cad_models: Load Collada models for visualization and reasoning – mod_srdl: Description of robot components and capabilities and methods for matching these descriptions against requirements of actions – mod_probcog: Interface to the ProbCog statistical relational learning library Interfaces to perception components – prolog_perception: (deprecated) Integration of perception using a Prolog module – comp_cop: Interface to the CoP perception system – knowrob_objects: Generic library for creating the KnowRob-internal object representation Probabilistic reasoning – srldb: Package with the ProbCog library Related packages: – comp_ehow: Import of natural-language web instructions, removed from KnowRob to reduce dependencies Where to download the source code? • KNOWROB is an open source platform. We can download KNOWROB core packages and general issue tracker for it at following address: https://github.com/knowrob/knowrob