Giter VIP home page Giter VIP logo

docker's Introduction

KnowRob

CI

The purpose of KnowRob is to equip robots with explicit knowledge about the world. Originally, it was implemented using the Prolog programming language. In its second iteration, KnowRob is implemented in C++, but still supports Prolog for rule-based reasoning.

The core of KnowRob is a shared library that implements a hybrid knowledge base. With hybrid, we mean that different reasoning engines can be combined in KowRob's query evaluation process. To this end, KnowRob defines a querying language and manages which parts of a query are evaluated by which reasoner or storage backend. Both reasoners and storage backends are configurable, and can be extended by plugins either in written in C++ or Python. There are a few applications shipped with this repository including a terminal application that allows to interact with KnowRob using a command line interface, and a ROS node that exposes KnowRob's querying interface to the ROS ecosystem.

Getting Started

These instructions will get you a copy of KnowRob up and running on your local machine.

Dependencies

The following list of software is required to build KnowRob:

Optional Dependencies

Some features will only be conditionally compiled if the following dependencies are found:

  • ROS1 >= Melodic, ROS2 is not supported yet

Installation

KnowRob uses CMake as build system. The following steps will guide you through the installation process. Assuming you have cloned the repository to ~/knowrob:

cd ~/knowrob
mkdir build
cd build
cmake ..
make
sudo make install

You may further need to set the SWI_HOME_DIR environment variable to the installation location of swipl:

export SWI_HOME_DIR=/usr/lib/swi-prolog

Alternatively, you may clone the KnowRob repository into a ROS workspace and build it using catkin. Please refer to the ROS documentation for further information.

Development

Any IDE with proper CMake and C++ language support should be able to load the project. For example, you can use CLion or Visual Studio Code. But support for Prolog code is usually quite limited or not existent.

Configuration

KnowRob uses a configuration file to set up the knowledge base. Internally, boost's property tree is used to parse the configuration file. Hence, JSON is one of the supported formats. The configuration file specifies the storage backends, the reasoner, and the ontologies that are loaded into the knowledge base.

An example configuration file is provided in settings/default.json:

  "data-sources": [
    {
      "path": "owl/test/swrl.owl",
      "language": "owl",
      "format": "xml"
    }
  ],
  "data-backends": [
    {
      "type": "MongoDB",
      "name": "mongodb",
      "host": "localhost",
      "port": 27017,
      "db": "mongolog1",
      "read-only": false
    }
  ],
  "reasoner": [
    {
      "type": "Mongolog",
      "name": "mongolog",
      "data-backend": "mongodb"
    }
  ]

For more information about storage backends, please refer to the Backends documentation, and for more information about reasoners, please refer to the Reasoner documentation.

Launching

Being a shared library, KnowRob cannot be launched directly but only in the context of a program that uses it.

One such program is the terminal application that allows to interact with KnowRob using a command line interface. It can be launched as follows:

knowrob-terminal --config-file ~/knowrob/settings/default.json

The configuration file is a required argument, there is no fallback configuration file.

Once the terminal is up and running, you should see a greeting message and a prompt which looks like this:

Welcome to KnowRob.
For online help and background, visit http://knowrob.org/

?- 

Please refer to the CLI for documentation about the syntax of queries that can be typed into the terminal. Limited auto-completion is available. exit/0 will terminate the terminal.

Alternatively, you can expose the KnowRob querying interface as a ROS service. Please refer to the ROS documentation for further information.

Getting Familiar

Here we provide an overview about functionality of KnowRob.

Querying

The core of KnowRob is a querying interface that is built around a custom querying language. Its syntax is similar to Prolog, but it is more simplified and not Turing-complete like Prolog is.

For more information on querying in KnowRob, please have a look here.

Ontologies

KnowRob structures knowledge using ontologies. Ontologies are formal models of a domain that are used to describe the concepts in the domain and the relationships between them. In KnowRob, ontologies are generally represented as RDF graphs using the RDFS and OWL vocabularies.

Ontologies are organized in a hierarchy where each ontology is a specialization of another ontology. A common distinction is made between foundational (or top-level) ontologies, domain ontologies, and application ontologies. A foundational ontology fixes the basic concepts and relationships that are used across different domains. In KnowRob, we define a domain ontology for the robotics domain, and align it with a common foundational ontology. Applications can then import the domain ontology and extend it with application-specific concepts to cover the specific requirements of the application.

For more information on ontologies in KnowRob, please have a look here.

Triple Store and Data Access

Knowledge is represented in form of contextualized triples -- each subject-predicate-object triple has additional fields that contextualize the triple. A configurable storage backend is used to store and retrieve triples -- currently, triple stores based on Prolog, MongoDB and Redland are supported.

One important aspect in knowledge representation for robots is that a lot of knowledge is implicitly encoded in the control structures of the robot. Hence, one goal is to make this implicit knowledge explicit. This is done by mapping data to symbols in an ontology. In case of querying, this is often referred to as Ontology-based Data Access (OBDA).

For more information on storages in KnowRob, please have a look here.

Reasoning

KnowRob uses an ensemble of reasoners approach where inferences of different reasoners are combined into correlated knowledge pieces. The reason for choosing this approach is that there is no single formalism that is suited for every reasoning tasks. Instead, given a problem, one should decide what the most suitable formalism is to tackle it. Consequently, KnowRob can be configured to solve specific problems by loading corresponding reasoning modules that implement a common interface.

For more information on reasoning in KnowRob, please have a look here.

Further Information

More documentation can be found in the following pages:

In addition, the following resources are available:

docker's People

Contributors

asilx avatar bbferka avatar bbrieber avatar daniel86 avatar gheorghelisca avatar jspricke avatar jworch avatar mh0rst avatar mpomarlan avatar mtenorth avatar zyfang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

docker's Issues

No remote includes

Story: code-iai/knowrob_backlog#1

  • make sure that no resource is included remotely. All resources must be available
    on the openEASE server
  • Test without internet connection

Keeping generated videos persistent

Story: code-iai/knowrob_backlog#16

  • Send video frames via ROS message to openEASE server
  • Save RGB frames temporary
  • Generate video from frames server-side
  • Play generated video in web interface
  • Allow user to download the video
  • Let the user brows through all generated videos

ACAT robot episodes

Story: code-iai/knowrob_backlog#34

  • Talk to Gheorghe and Michael, define set of variations for the episodes
  • Run experiment with variations
  • Publish on openEASE

Install touch screen in the lab

Story: code-iai/knowrob_backlog#5

  • Get dedicated computer for touch screen
  • Computer accesses web version of openEASE
  • Install touch screen in the lab

Adjustable layout of the Web interface

The boxes that form the Web interface should be resizable, should adapt to different screen resolutions, and ideally, the user should be able to arrange them in different ways, open and close them, etc.

Invalid characters in user name

for example name.surname@domain won't work, plus it does not give feedback to users that something is wrong. Only some output written by flask:

SecurityException: Illegal character(s) . detected in field user_container_name

User containers have unlimited access to internal network and internet.

Currently, a user could access the internal IAI network and the internet from his container.
To prevent unauthorized access to internal IAI resources, we should limit access from docker to external resources with iptables like this (replace eth0 with the server's ethernet network interface):

iptables -N DOCKEROUT
# Insert new filter chain as first filter in builtin FORWARD chain
iptables -I FORWARD 1 -i docker0 ! -o docker0 -j DOCKEROUT
# Allow Google DNS
iptables -A DOCKEROUT -o eth0 -d 8.8.8.8 -j ACCEPT
iptables -A DOCKEROUT -o eth0 -d 8.8.4.4 -j ACCEPT
# Allow answers to established connections
iptables -A DOCKEROUT -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
# Drop all other packets which leave docker
iptables -A DOCKEROUT -j DROP

This script will probably break some functionality like sending mails, downloading/converting CAD models or any other function that accesses external servers. We need to find out the used addresses and make exceptions for them. Alternatively we could fully exempt the internal IP addresses of webrob and other openease containers from any filtering. This could be done in the start-webrob script, after launching all containers - probably with some docker inspect X and iptables magic.
In the meantime, we could at least blacklist the internal IAI network, all other traffic is still allowed:

iptables -N DOCKEROUT
# Insert new filter chain as first filter in builtin FORWARD chain
iptables -I FORWARD 1 -i docker0 ! -o docker0 -j DOCKEROUT
# Allow answers to established connections
iptables -A DOCKEROUT -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
# Drop all packets that target the internal IAI network
iptables -A DOCKEROUT -o eth0 -d 192.168.100.0/24 -j DROP

When importing episodes, index mongo against "timestamp" as well

For the simulation scenarios we need the mongodb to index against the "timestamp" key.

As a suggestion, maybe adding to the queries.json file a place where a javascript code can be added and it shall be executed when loading the episodes (e.g. indexing against "timestamp")

Touchscreen, WM and chromium kiosk mode

Touchscreen events don't get emitted in the browser.
Probably window manager consuming them.
Investigate this, reconfigure used WM (i think xfwm4) or switch to other WM.

Key Combination

The key combination written in the tutorial are not up to date anymore. Whereas CTRL+ENTER was replaced by ENTER only, what happened to CTRL+; for getting the next solution?

Chromium Browser: Mesh textures are rendering black

Story: code-iai/knowrob_backlog#10

Displaying mesh textures does not work with chromium.
The browser client does not send any GET requests for textures to the server,
thus there is something wrong with the JS mechanism that loads DAE meshes.

Offline openEASE

Story: code-iai/knowrob_backlog#1

  • openEASE must be able to run offline
  • Use networking tools to figure out when/why/what is downloaded from the web

Clickable Graph in openEASE

  • The nodes in the graph vis should be clickable
  • Other components should get notifications about the clicked entity
  • A query library for that entity should be shown

Story: code-iai/knowrob_backlog#30

Reloading of JS and CSS files

Story: code-iai/knowrob_backlog#14

Browser cache does not realize that JS files changed.
User has to delete the cookies stored for the web service
or has to reload the files manually.

In html, for reach JS import statement, a hash should be appended as argument.
The hash can be changed whenever a new version of the file is available
in order to bypass browser cache.

Support for non-browser clients

If the user does not log in via the browser, the container will not be started. An alternative solution could be a special end point to which the client has to send the login credentials which then launches the container.

Fork robotwebtools

Story: code-iai/knowrob_backlog#9
Fork robotwebtools for better synchronization

Timeout in dockerbridge

Randomly happens on login.
Seems like an issue with intermediate file transfer container.
A minute is a lot in this case, lowering timeout to 10secs for now

ERROR:root:JsonRpcError(-32603): UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60) -- Traceback (most recent call last):

File "/usr/local/lib/python2.7/dist-packages/pyjsonrpc/rpclib.py", line 114, in call
  result = rpc_function(*positional_params, **named_params)
File "dockerbridge.py", line 155, in files_writesecret
  filemanager.tocontainer(container, data, '/etc/rosauth/secret')
File "/opt/dockerbridge/filemanager.py", line 71, in tocontainer
  self.__writefile(container, source, targetfile, user)
File "/opt/dockerbridge/filemanager.py", line 210, in __writefile
  self.__stop_and_remove(cont, True)
File "/opt/dockerbridge/filemanager.py", line 248, in __stop_and_remove
  self.docker.wait(container, timeout=60)
File "/usr/local/lib/python2.7/dist-packages/docker/utils/decorators.py", line 21, in wrapped
  return f(self, resource_id, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/docker/api/container.py", line 455, in wait
  res = self._post(url, timeout=timeout)
File "/usr/local/lib/python2.7/dist-packages/docker/utils/decorators.py", line 47, in inner
  return f(self, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 135, in _post
  return self.post(url, **self._set_request_timeout(kwargs))
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 535, in post
  return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 488, in request
  resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 609, in send
  r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 499, in send
  raise ReadTimeout(e, request=request)
ReadTimeout: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

Convert OWL logs to graph structure

Story: code-iai/knowrob_backlog#15

  • read tasks/actions from OWL into graph structure (possibly Java class)
  • Keep graph structure in memory, not required to save it to hard drive
  • Filtering logs for interesting tasks/actions
  • Prolog predicate that allows users to generate the graph for a episode

Mesh Downloading

  • use environment variable for configuration of mesh repositories
  • create mesh management page (browse through available meshes; allow updating meshes from that page)
  • initialize mesh cache on first start

Saphari Episodes: Local integration

Story: code-iai/knowrob_backlog#3

  • Integrate episode logs in local openEASE installation
  • Put data into local episode FTP directory
  • Create experiment meta data
  • Import mongo data into docker DB
  • Test loading the episode data

Task Graph visualization during Video play

  • annotate videos with episode and time interval
  • map video frame to timepoint
  • update task tree visualization accordingly
  • visualize task tree in designator area above video

Taxonomy Graph Visualization

  • Make graph vis generic, so that it can be used for task trees and taxonomy graph (Is there a JS library that can be used? that would be preferable)
  • There should be one predicate that can be used to show different types of graphs (e.g., graph_publish(tasktree('RobotExepriment_sf5ghdf', ....)) or graph_publish(taxonomy('GraspingSomething', ....))
  • task graph in designator or chart area?
  • taxonomy graph in chart area

Story: code-iai/knowrob_backlog#30

Auto-mongoimport for new experiments

When an admin user selects an experiment, the mongo size of the experiment is checked and if the size is 0, mongoimports are initiated automatically

ACAT simulation episodes

Story: code-iai/knowrob_backlog#35

  • Talk to Mihai and Michael, define set of variations for the episodes
  • Run experiment with variations
  • Publish on openEASE

dockerclean removes images in use

Calling dockerclean yields a state where images used by some containers are removed and containers can not start anymore. For example:

$ ./scripts/start-apt-cacher 
apt-cacher container exists, starting it...
Error response from daemon: get 2ca745e397eb6f091b40dcef8b07da7582d38d90f01d1946c9d1f53e0b75a47d: volume not found
Error: failed to start containers: apt-cacher-run
Failed to start apt-cacher container.

Removing foobar'd containers manually, then rebuilding fixes it. For example:

$ doocker rm apt-cacher-run

docker version: 1.13.1

Task graph visualization in openEASE

Story: code-iai/knowrob_backlog#15
Depends on: #78

  • Display (textual) statistics (maybe statistics view or internal data view)
  • Display a graph inside the image view
  • Make nodes of the graph selectable (highlight selected node)
  • No event handling except of highlighting yet
  • Prolog predicate that triggers the visualization

Improve how user can define video configurations

Corresponds to: code-iai/knowrob_backlog#16

  • Allow different configurations for the same episode
  • Nice interface for initial configuration
  • Fix time range configuration bug: allow to make interval bigger (as long as inside of episode interval)

Authentication fails after updating to docker v1.7 and getting the latest changes regarding to tutorials

On my machine, i have been experiencing the failure of authentication after the aforementioned updates I have done.

I am getting the following error logs in the knowrob container of the user after logging in and choosing "knowrob" as the application:

"[ERROR] [1436786872.096424133]: Could not read from file '/etc/rosauth/secret'
process[rosbridge_websocket-4]: started with pid [76]
process[rosapi-5]: started with pid [109]
[auth_node-3] process has died [pid 47, exit code 254, cmd /opt/ros/hydro/lib/rosauth/ros_mac_authentication __name:=auth_node __log:=/home/ros/.ros/log/321d90c2-2952-11e5-9290-0242ac1100bf/auth_node-3.log].
log file: /home/ros/.ros/log/321d90c2-2952-11e5-9290-0242ac1100bf/auth_node-3*.log"

Thereafter, it tries to authenticate in an infinite manner:

"[INFO] [WallTime: 1436786875.139900] Client connected. 4 clients total.
[INFO] [WallTime: 1436786875.140236] Awaiting proper authentication...
[WARN] [WallTime: 1436786875.303856] Client 3 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786875.304814] Client 3 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786875.305553] Client 3 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786875.306256] Client 3 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786875.306997] Client 3 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786875.307702] Client 3 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786875.308404] Client 3 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786875.309122] Client 3 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786875.309814] Client 3 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786875.310508] Client 3 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786875.311196] Client 3 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786875.311837] Client 3 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786875.312517] Client 3 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786875.313219] Client 3 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786875.313984] Client 3 did not authenticate. Closing connection.
[INFO] [WallTime: 1436786876.127594] Client connected. 5 clients total.
[INFO] [WallTime: 1436786876.127976] Awaiting proper authentication...
[WARN] [WallTime: 1436786876.316268] Client 4 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786876.316916] Client 4 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786876.317342] Client 4 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786876.317741] Client 4 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786876.318137] Client 4 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786876.318528] Client 4 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786876.318937] Client 4 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786876.319350] Client 4 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786876.319747] Client 4 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786876.320159] Client 4 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786876.320555] Client 4 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786876.320950] Client 4 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786876.321353] Client 4 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786876.321749] Client 4 did not authenticate. Closing connection.
[WARN] [WallTime: 1436786876.322143] Client 4 did not authenticate. Closing connection.
"

Things I tried and didn't fix the problem:

  • I added "VOLUME /etc/rosauth" at the end of knowrob-daemon_local build file.
  • I changed the parameter "/ros_mac_authentication/secret_file_location" to "/etc/ease_secret/secret"
    in knowrob_ease.luch
  • I tried to add some basic text in /etc/auth/secret in the line where data_tutorials is started in start-webrob.

Saphari Episodes: Public Release

Story: code-iai/knowrob_backlog#3

  • Push everything from local to public openEASE
  • Make a blog entry on openease.org / write to mailinglist: Include a video of the episode, include description of episode

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.