[Fawkes Git] branch/bschaepers/asp-aspect: 25 revs updated. (0.5.0-3453-gba11c03)

Bjoern Schaepers bjoern.schaepers at rwth-aachen.de
Mon Nov 7 18:49:39 CET 2016


Changes have been pushed for the project "Fawkes Robotics Software Framework".

Gitweb: http://git.fawkesrobotics.org/fawkes.git
Trac:   http://trac.fawkesrobotics.org

The branch, bschaepers/asp-aspect has been updated
  discards  8c40e343989ab73c4dd54dd00aca0d6cff9c26f9 (commit)
  discards  a4ccf792f7e8aa2dc56b7b8aec681433d25b9113 (commit)
  discards  36920462f64b4f5aae158ce8f0b2fa9ccac69944 (commit)
  discards  83afebd42bbb6fcc0d6bc78e976d771a6f9692f9 (commit)
  discards  026a3c991b6b3c03c3f52323b1e4806eef871c73 (commit)
  discards  93e1ab2233d2d363a1b7de79f5e27fad62c0cb7f (commit)
  discards  f8396e93cd29dcf422fdffa110a2b236d3e036c2 (commit)
  discards  33b4a657a8a63e7fd2884731b3625913db46a827 (commit)
  discards  cdaf98b71ffaa206a5970a296311409ed8ef1c83 (commit)
  discards  08631464ada4b381dcebfd87577bf85f9bb5fee5 (commit)
  discards  c2529c2064beb684760087762afae975af1cfa57 (commit)
  discards  b5129ebacf6dce2c52b1e6483a8e55648f76fb1c (commit)
  discards  eda2a2b2116e9d1baf13c8364ef2d703d7911f26 (commit)
  discards  c28d7b925e67ec47329d510df1d4896727053c6c (commit)
  discards  9bbb7d0fb36d3656705cd8a3585fd5c189fad419 (commit)
  discards  c48b00b4b60d243ac6b337c5e9f717624776ae98 (commit)
  discards  c0e0eb609971d97d877d7b830ac29950d1da0174 (commit)
  discards  b55e7a4b2dd2d6c314af32a01262a3198592dd8e (commit)
  discards  2aaa72883c92b3546832be60e12273b229cd5676 (commit)
  discards  535c50e06d3b76bca66b069f3591cb21cd4f4795 (commit)
        to  ba11c03fde668bd4032f410d40207d8be5b57bff (commit)
       via  30df6e1ce34fe1d916bbe0b72aca5770da5d0c8f (commit)
       via  1a65fac5858d004f250f7f8fb12eec4b18aa4ab9 (commit)
       via  748f69bbfbc0786c9582c7155b1b7a49d08ff30a (commit)
       via  a3d9f59247cb0ee73a36e5d1a5ebc3343da12d76 (commit)
       via  a9e2d8b59531106c5f6b983af6582da67fb5b0f4 (commit)
       via  42ff578e47ba3aa4ac7a8fd277489171fd346cfb (commit)
       via  e12a79a33ecd6c77f606be97389793f30dd0d9ae (commit)
       via  e9e72cbfd7c4d18b6da09b9ad2853c11140c8f65 (commit)
       via  4be6453b104a252de0ad2b36b687b69acbbf2ae8 (commit)
       via  0d9b7324776d159cbe24ee38e45357b514fabd80 (commit)
       via  e2448185a39937f55f6af0ac83fe53d7f36d022d (commit)
       via  3e99a68634599ec5edbc7be768a9f355cb3fe98d (commit)
       via  c423af4fb1448469decbaa0881f541102aa6ef09 (commit)
       via  090f5c8d016f74f4de337afc58b06df3d9053bb2 (commit)
       via  8fdff7fd8afdc28f5b291075101d7d9d6edcbc84 (commit)
       via  c20e3c16dd4b6000260133478430aac17c123ea3 (commit)
       via  3d9c85898fbc6cc3b1b952ee1787b6c23930e733 (commit)
       via  ed6a5cb70405c9de549f75590d3bb2bde81055ca (commit)
       via  7814803c8ce13e0666c543396995a231d17c0445 (commit)
       via  f64cfa12b704ecc677ce5b96a190c52e69669f72 (commit)
       via  a0cafa1d28dabf7f1bf3971c23d33f8bd4265c5a (commit)
       via  d7a9d81267efdd9de03b433771d9b6c406f80d7b (commit)
       via  57d984fa1b912f98e5c9fd89d626a7f9e99ad93c (commit)
       via  4c48028893519f687c05948383ab0f4ed9092f8d (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (8c40e343989ab73c4dd54dd00aca0d6cff9c26f9)
            \
             N -- N -- N (ba11c03fde668bd4032f410d40207d8be5b57bff)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

http://git.fawkesrobotics.org/fawkes.git/bschaepers/asp-aspect

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- *Log* ---------------------------------------------------------------
commit ed6a5cb70405c9de549f75590d3bb2bde81055ca
Author:     Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
AuthorDate: Tue Sep 20 17:57:53 2016 +0200
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:21 2016 +0100

    utils: moved string utils for command argv and envs into utils/misc

http://git.fawkesrobotics.org/fawkes.git/commit/ed6a5cb
http://trac.fawkesrobotics.org/changeset/ed6a5cb

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 3d9c85898fbc6cc3b1b952ee1787b6c23930e733
Author:     Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
AuthorDate: Tue Sep 20 18:32:33 2016 +0200
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:22 2016 +0100

    utils: require cpp11
    
    For example this is needed in the new utils classes for string
    conversions to use tuples and nicer for loops.

http://git.fawkesrobotics.org/fawkes.git/commit/3d9c858
http://trac.fawkesrobotics.org/changeset/3d9c858

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit c20e3c16dd4b6000260133478430aac17c123ea3
Author:     Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
AuthorDate: Tue Sep 20 18:34:36 2016 +0200
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:22 2016 +0100

    openprs: properly use moved string utils

http://git.fawkesrobotics.org/fawkes.git/commit/c20e3c1
http://trac.fawkesrobotics.org/changeset/c20e3c1

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 8fdff7fd8afdc28f5b291075101d7d9d6edcbc84
Author:     Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
AuthorDate: Tue Sep 20 18:37:40 2016 +0200
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:22 2016 +0100

    sub_process: moved utils to create sub processes into utils

http://git.fawkesrobotics.org/fawkes.git/commit/8fdff7f
http://trac.fawkesrobotics.org/changeset/8fdff7f

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 090f5c8d016f74f4de337afc58b06df3d9053bb2
Author:     Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
AuthorDate: Tue Sep 20 19:26:05 2016 +0200
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:22 2016 +0100

    utils: require boost asio and system for sb_process utils

http://git.fawkesrobotics.org/fawkes.git/commit/090f5c8
http://trac.fawkesrobotics.org/changeset/090f5c8

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit c423af4fb1448469decbaa0881f541102aa6ef09
Author:     Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
AuthorDate: Tue Sep 20 19:30:53 2016 +0200
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:22 2016 +0100

    openprs: properly use moved sub_process utils

http://git.fawkesrobotics.org/fawkes.git/commit/c423af4
http://trac.fawkesrobotics.org/changeset/c423af4

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 3e99a68634599ec5edbc7be768a9f355cb3fe98d
Author:     Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
AuthorDate: Thu Sep 29 16:23:16 2016 +0200
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:22 2016 +0100

    utils: fixed makefile to create lua/fawkesutils after new requirements

http://git.fawkesrobotics.org/fawkes.git/commit/3e99a68
http://trac.fawkesrobotics.org/changeset/3e99a68

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit e2448185a39937f55f6af0ac83fe53d7f36d022d
Author:     Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
AuthorDate: Thu Oct 6 18:00:00 2016 +0200
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:22 2016 +0100

    utils: added libdeamon to makefile to close sockets in SubProcess

http://git.fawkesrobotics.org/fawkes.git/commit/e244818
http://trac.fawkesrobotics.org/changeset/e244818

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 0d9b7324776d159cbe24ee38e45357b514fabd80
Author:     Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
AuthorDate: Tue Oct 11 21:51:46 2016 +0200
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:22 2016 +0100

    colli: renamed AStar class to avoid conflict with utils/search/astar
    
    Since we compiled the utils with C++11, the linker mixes up the colli
    astar and utils astar classes. They are implemented differently, but
    have the same name and namespace. This lead to a segfault when suddenly
    the search function of the utils was executed in a colli astar instance.
    This is a fist hotfix that just renames the colli astar class.

http://git.fawkesrobotics.org/fawkes.git/commit/0d9b732
http://trac.fawkesrobotics.org/changeset/0d9b732

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 4be6453b104a252de0ad2b36b687b69acbbf2ae8
Author:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
AuthorDate: Thu Oct 20 16:33:40 2016 +0200
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:22 2016 +0100

    Added ASP aspect.

http://git.fawkesrobotics.org/fawkes.git/commit/4be6453
http://trac.fawkesrobotics.org/changeset/4be6453

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit e9e72cbfd7c4d18b6da09b9ad2853c11140c8f65
Author:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
AuthorDate: Thu Oct 20 23:19:33 2016 +0200
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:22 2016 +0100

    ASP Aspect: Use Fawkes logging for Clingo.

http://git.fawkesrobotics.org/fawkes.git/commit/e9e72cb
http://trac.fawkesrobotics.org/changeset/e9e72cb

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit e12a79a33ecd6c77f606be97389793f30dd0d9ae
Author:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
AuthorDate: Thu Oct 27 16:57:30 2016 +0200
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:22 2016 +0100

    ASP-Aspect: Added ClingoControlManager
    
    Similar to CLIPSEnvManager.
    Not yet used by the aspects.

http://git.fawkesrobotics.org/fawkes.git/commit/e12a79a
http://trac.fawkesrobotics.org/changeset/e12a79a

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 42ff578e47ba3aa4ac7a8fd277489171fd346cfb
Author:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
AuthorDate: Sat Oct 29 11:50:46 2016 +0200
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:22 2016 +0100

    ASP-Aspect: Added ClingoManagerAspect.
    
    Still not in use.

http://git.fawkesrobotics.org/fawkes.git/commit/42ff578
http://trac.fawkesrobotics.org/changeset/42ff578

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit a9e2d8b59531106c5f6b983af6582da67fb5b0f4
Author:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
AuthorDate: Sun Oct 30 13:57:12 2016 +0100
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:22 2016 +0100

    ASP-Aspect: Prepared aspect and inifin for the control manager.

http://git.fawkesrobotics.org/fawkes.git/commit/a9e2d8b
http://trac.fawkesrobotics.org/changeset/a9e2d8b

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit a3d9f59247cb0ee73a36e5d1a5ebc3343da12d76
Author:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
AuthorDate: Sun Oct 30 20:52:38 2016 +0100
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:22 2016 +0100

    ASPAspect: Use the clingo control manager for the aspects.

http://git.fawkesrobotics.org/fawkes.git/commit/a3d9f59
http://trac.fawkesrobotics.org/changeset/a3d9f59

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 748f69bbfbc0786c9582c7155b1b7a49d08ff30a
Author:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
AuthorDate: Mon Oct 31 16:26:27 2016 +0100
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:22 2016 +0100

    ASP-Aspect: Added access wrapper class.
    
    This way the model symbols are stored next to the clingo control and
    user of the control manager have access to the symbols and not only the
    solver.

http://git.fawkesrobotics.org/fawkes.git/commit/748f69b
http://trac.fawkesrobotics.org/changeset/748f69b

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 1a65fac5858d004f250f7f8fb12eec4b18aa4ab9
Author:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
AuthorDate: Mon Oct 31 16:44:19 2016 +0100
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:22 2016 +0100

    ASP-Aspect: Use a different name for the member.
    
    Clingo is also the name of the namespace, this confuses syntax
    highlighting and may confuse humans too, so change it.

http://git.fawkesrobotics.org/fawkes.git/commit/1a65fac
http://trac.fawkesrobotics.org/changeset/1a65fac

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 30df6e1ce34fe1d916bbe0b72aca5770da5d0c8f
Author:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
AuthorDate: Mon Oct 31 17:04:05 2016 +0100
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:22 2016 +0100

    ASP-Aspect: Added external handling.

http://git.fawkesrobotics.org/fawkes.git/commit/30df6e1
http://trac.fawkesrobotics.org/changeset/30df6e1

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit ba11c03fde668bd4032f410d40207d8be5b57bff
Author:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
AuthorDate: Wed Nov 2 11:44:34 2016 +0100
Commit:     Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
CommitDate: Mon Nov 7 18:49:22 2016 +0100

    ASP-Aspect: Add the asp plugin to the Makefile.

http://git.fawkesrobotics.org/fawkes.git/commit/ba11c03
http://trac.fawkesrobotics.org/changeset/ba11c03

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


- *Summary* -----------------------------------------------------------
 .../interfaces/RobotMemoryInterface.h}             |   24 +++-
 src/plugins/robot-memory/Makefile                  |    1 +
 src/plugins/robot-memory/aspect/Makefile           |    4 +-
 .../computables/blackboard_computable.cpp          |  122 ++++++++++++++++
 .../computables/blackboard_computable.h            |   50 +++++++
 .../robot-memory/{ => computables}/computable.cpp  |    0
 .../robot-memory/{ => computables}/computable.h    |    0
 .../{ => computables}/computables_manager.cpp      |    0
 .../{ => computables}/computables_manager.h        |    0
 .../interfaces/RobotMemoryInterface.cpp            |  146 +++++++++++++++++++-
 .../interfaces/RobotMemoryInterface.h_ext          |   24 +++-
 .../interfaces/RobotMemoryInterface.tolua          |   20 ++-
 .../interfaces/RobotMemoryInterface.xml            |    6 +-
 src/plugins/robot-memory/robot_memory.cpp          |   11 +-
 src/plugins/robot-memory/robot_memory.h            |    2 +-
 src/plugins/robot-memory/robot_memory_setup.cpp    |    5 +
 src/plugins/robot-memory/robot_memory_thread.cpp   |   22 +++-
 src/plugins/robot-memory/robot_memory_thread.h     |    2 +
 src/plugins/robot-memory/test-plugin/Makefile      |    3 +-
 .../robot-memory/test-plugin/robot_memory_test.cpp |   43 ++++++-
 .../robot-memory/test-plugin/robot_memory_test.h   |    6 +-
 .../test-plugin/robot_memory_test_thread.cpp       |    2 +-
 22 files changed, 458 insertions(+), 35 deletions(-)
 copy src/{plugins/robot-memory/interfaces/RobotMemoryInterface.h_ext => libs/interfaces/RobotMemoryInterface.h} (84%)
 create mode 100644 src/plugins/robot-memory/computables/blackboard_computable.cpp
 create mode 100644 src/plugins/robot-memory/computables/blackboard_computable.h
 rename src/plugins/robot-memory/{ => computables}/computable.cpp (100%)
 rename src/plugins/robot-memory/{ => computables}/computable.h (100%)
 rename src/plugins/robot-memory/{ => computables}/computables_manager.cpp (100%)
 rename src/plugins/robot-memory/{ => computables}/computables_manager.h (100%)


- *Diffs* -------------------------------------------------------------

- *commit* ed6a5cb70405c9de549f75590d3bb2bde81055ca - - - - - - - - - -
Author:  Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
Date:    Tue Sep 20 17:57:53 2016 +0200
Subject: utils: moved string utils for command argv and envs into utils/misc

 .../utils/misc/string_commands.cpp}                |    0
 .../string.h => libs/utils/misc/string_commands.h} |    0
 2 files changed, 0 insertions(+), 0 deletions(-)


- *commit* 3d9c85898fbc6cc3b1b952ee1787b6c23930e733 - - - - - - - - - -
Author:  Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
Date:    Tue Sep 20 18:32:33 2016 +0200
Subject: utils: require cpp11

 src/libs/utils/Makefile |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

_Diff for modified files_:
diff --git a/src/libs/utils/Makefile b/src/libs/utils/Makefile
index 5f8c937..d84e9b3 100644
--- a/src/libs/utils/Makefile
+++ b/src/libs/utils/Makefile
@@ -43,11 +43,17 @@ LDFLAGS += $(LDFLAGS_LIBMAGIC)
 
 OBJS_all = $(OBJS_libfawkesutils) $(OBJS_lua_fawkesutils)
 LIBS_all  = $(LIBDIR)/libfawkesutils.so
-ifeq ($(HAVE_TOLUA),1)
+ifeq ($(HAVE_TOLUA)$(HAVE_CPP11),11)
+  CFLAGS += $(CFLAGS_CPP11)
   LIBS_all += $(LUALIBDIR)/fawkesutils.so
   TARGETS_all += $(SRCDIR)/fawkesutils_tolua.cpp
 else
-  WARN_TARGETS += warning_tolua_wrapper
+  ifneq ($(HAVE_CPP11),1)
+    WARN_TARGETS += warning_cpp11
+  endif
+  ifneq ($(HAVE_TOLUA),1)
+    WARN_TARGETS += warning_tolua_wrapper
+  endif
 endif
 
 ifneq ($(HAVE_INOTIFY),1)
@@ -60,6 +66,9 @@ all: $(WARN_TARGETS)
 warning_libmagic:
 	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TYELLOW)Restricted file type detection support$(TNORMAL) (file[-devel] (libmagic) not installed)"
 	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TYELLOW)File monitoring utils cannot be built$(TNORMAL) (inotify headers not found)"
+warning_cpp11:
+	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting utils$(TNORMAL) " \
+		"(CPP11 not available)"
 endif
 
 $(LUALIBDIR)/fawkesutils.$(SOEXT): | $(LIBDIR)/libfawkesutils.$(SOEXT)

- *commit* c20e3c16dd4b6000260133478430aac17c123ea3 - - - - - - - - - -
Author:  Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
Date:    Tue Sep 20 18:34:36 2016 +0200
Subject: openprs: properly use moved string utils

 src/libs/utils/misc/string_commands.cpp            |    3 ++-
 src/libs/utils/misc/string_commands.h              |    6 +++---
 .../openprs/aspect/openprs_kernel_manager.cpp      |    2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

_Diff for modified files_:
diff --git a/src/libs/utils/misc/string_commands.cpp b/src/libs/utils/misc/string_commands.cpp
index 80a4122..960ae90 100644
--- a/src/libs/utils/misc/string_commands.cpp
+++ b/src/libs/utils/misc/string_commands.cpp
@@ -1,6 +1,6 @@
 
 /***************************************************************************
- *  string.cpp - string utilities
+ *  string.cpp - string utilities for command argv and envs
  *
  *  Created: Fri Aug 22 15:32:47 2014
  *  Copyright  2014  Tim Niemueller [www.niemueller.de]
@@ -26,6 +26,7 @@
 #include <tuple>
 #include <string>
 #include <cstring>
+#include <vector>
 
 namespace fawkes {
 #if 0 /* just to make Emacs auto-indent happy */
diff --git a/src/libs/utils/misc/string_commands.h b/src/libs/utils/misc/string_commands.h
index 74745e6..ab864b4 100644
--- a/src/libs/utils/misc/string_commands.h
+++ b/src/libs/utils/misc/string_commands.h
@@ -1,6 +1,6 @@
 
 /***************************************************************************
- *  string.h - string utilities
+ *  string.h - string utilities for command argv and envs
  *
  *  Created: Fri Aug 22 14:49:05 2014
  *  Copyright  2014  Tim Niemueller [www.niemueller.de]
@@ -20,8 +20,8 @@
  *  Read the full text in the LICENSE.GPL file in the doc directory.
  */
 
-#ifndef __PLUGINS_OPENPRS_UTILS_STRING_H_
-#define __PLUGINS_OPENPRS_UTILS_STRING_H_
+#ifndef __PLUGINS_UTILS_STRING_H_
+#define __PLUGINS_UTILS_STRING_H_
 
 #include <string>
 #include <vector>
diff --git a/src/plugins/openprs/aspect/openprs_kernel_manager.cpp b/src/plugins/openprs/aspect/openprs_kernel_manager.cpp
index 3ff143a..79320c9 100644
--- a/src/plugins/openprs/aspect/openprs_kernel_manager.cpp
+++ b/src/plugins/openprs/aspect/openprs_kernel_manager.cpp
@@ -22,7 +22,7 @@
 
 #include <plugins/openprs/aspect/openprs_kernel_manager.h>
 #include <plugins/openprs/utils/proc.h>
-#include <plugins/openprs/utils/string.h>
+#include <utils/misc/string_commands.h>
 #include <logging/logger.h>
 #include <config/config.h>
 #include <utils/time/time.h>

- *commit* 8fdff7fd8afdc28f5b291075101d7d9d6edcbc84 - - - - - - - - - -
Author:  Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
Date:    Tue Sep 20 18:37:40 2016 +0200
Subject: sub_process: moved utils to create sub processes into utils

 .../utils => libs/utils/sub_process}/proc.cpp      |    0
 .../utils => libs/utils/sub_process}/proc.h        |    0
 2 files changed, 0 insertions(+), 0 deletions(-)


- *commit* 090f5c8d016f74f4de337afc58b06df3d9053bb2 - - - - - - - - - -
Author:  Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
Date:    Tue Sep 20 19:26:05 2016 +0200
Subject: utils: require boost asio and system for sb_process utils

 src/libs/utils/Makefile |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

_Diff for modified files_:
diff --git a/src/libs/utils/Makefile b/src/libs/utils/Makefile
index d84e9b3..12da36a 100644
--- a/src/libs/utils/Makefile
+++ b/src/libs/utils/Makefile
@@ -16,9 +16,13 @@
 BASEDIR = ../../..
 include $(BASEDIR)/etc/buildsys/config.mk
 include $(BUILDSYSDIR)/lua.mk
+include $(BASEDIR)/etc/buildsys/boost.mk
 
 FILTER_OUT=%_tolua.o
 
+REQ_BOOST_LIBS = asio system
+HAVE_BOOST_LIBS = $(call boost-have-libs,$(REQ_BOOST_LIBS))
+
 ifneq ($(wildcard $(SYSROOT)/usr/include/magic.h $(SYSROOT)/opt/local/include/magic.h),)
   HAVE_LIBMAGIC = 1
   LIBS_LIBMAGIC = magic
@@ -42,10 +46,13 @@ CFLAGS  += $(CFLAGS_LIBMAGIC)
 LDFLAGS += $(LDFLAGS_LIBMAGIC)
 
 OBJS_all = $(OBJS_libfawkesutils) $(OBJS_lua_fawkesutils)
-LIBS_all  = $(LIBDIR)/libfawkesutils.so
-ifeq ($(HAVE_TOLUA)$(HAVE_CPP11),11)
-  CFLAGS += $(CFLAGS_CPP11)
+
+ifeq ($(HAVE_TOLUA)$(HAVE_CPP11)$(HAVE_BOOST_LIBS),111)
+  CFLAGS += $(CFLAGS_CPP11) $(call boost-libs-cflags,$(REQ_BOOST_LIBS))
   LIBS_all += $(LUALIBDIR)/fawkesutils.so
+  LDFLAGS += $(call boost-libs-ldflags,$(REQ_BOOST_LIBS))
+
+  LIBS_all  = $(LIBDIR)/libfawkesutils.so
   TARGETS_all += $(SRCDIR)/fawkesutils_tolua.cpp
 else
   ifneq ($(HAVE_CPP11),1)
@@ -54,6 +61,9 @@ else
   ifneq ($(HAVE_TOLUA),1)
     WARN_TARGETS += warning_tolua_wrapper
   endif
+  ifneq ($(HAVE_BOOST_LIBS),1)
+    WARN_TARGETS_BOOST = $(foreach l,$(REQ_BOOST_LIBS),$(if $(call boost-have-lib,$l),, warning_boost_$l))
+  endif
 endif
 
 ifneq ($(HAVE_INOTIFY),1)
@@ -61,7 +71,7 @@ ifneq ($(HAVE_INOTIFY),1)
 endif
 
 ifeq ($(OBJSSUBMAKE),1)
-all: $(WARN_TARGETS)
+all: $(WARN_TARGETS) $(WARN_TARGETS_BOOST)
 .PHONY: warning_libmagic warning_inotify
 warning_libmagic:
 	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TYELLOW)Restricted file type detection support$(TNORMAL) (file[-devel] (libmagic) not installed)"
@@ -69,6 +79,9 @@ warning_libmagic:
 warning_cpp11:
 	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting utils$(TNORMAL) " \
 		"(CPP11 not available)"
+$(WARN_TARGETS_BOOST): warning_boost_%:
+	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Cannot build utils library$(TNORMAL) (Boost library $* not found)"endif
+
 endif
 
 $(LUALIBDIR)/fawkesutils.$(SOEXT): | $(LIBDIR)/libfawkesutils.$(SOEXT)

- *commit* c423af4fb1448469decbaa0881f541102aa6ef09 - - - - - - - - - -
Author:  Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
Date:    Tue Sep 20 19:30:53 2016 +0200
Subject: openprs: properly use moved sub_process utils

 .../openprs/aspect/openprs_kernel_manager.cpp      |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/openprs/aspect/openprs_kernel_manager.cpp b/src/plugins/openprs/aspect/openprs_kernel_manager.cpp
index 79320c9..38fb262 100644
--- a/src/plugins/openprs/aspect/openprs_kernel_manager.cpp
+++ b/src/plugins/openprs/aspect/openprs_kernel_manager.cpp
@@ -21,7 +21,7 @@
  */
 
 #include <plugins/openprs/aspect/openprs_kernel_manager.h>
-#include <plugins/openprs/utils/proc.h>
+#include <utils/sub_process/proc.h>
 #include <utils/misc/string_commands.h>
 #include <logging/logger.h>
 #include <config/config.h>

- *commit* 3e99a68634599ec5edbc7be768a9f355cb3fe98d - - - - - - - - - -
Author:  Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
Date:    Thu Sep 29 16:23:16 2016 +0200
Subject: utils: fixed makefile to create lua/fawkesutils after new requirements

 src/libs/utils/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

_Diff for modified files_:
diff --git a/src/libs/utils/Makefile b/src/libs/utils/Makefile
index 12da36a..abb419d 100644
--- a/src/libs/utils/Makefile
+++ b/src/libs/utils/Makefile
@@ -52,7 +52,7 @@ ifeq ($(HAVE_TOLUA)$(HAVE_CPP11)$(HAVE_BOOST_LIBS),111)
   LIBS_all += $(LUALIBDIR)/fawkesutils.so
   LDFLAGS += $(call boost-libs-ldflags,$(REQ_BOOST_LIBS))
 
-  LIBS_all  = $(LIBDIR)/libfawkesutils.so
+  LIBS_all  += $(LIBDIR)/libfawkesutils.so
   TARGETS_all += $(SRCDIR)/fawkesutils_tolua.cpp
 else
   ifneq ($(HAVE_CPP11),1)

- *commit* e2448185a39937f55f6af0ac83fe53d7f36d022d - - - - - - - - - -
Author:  Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
Date:    Thu Oct 6 18:00:00 2016 +0200
Subject: utils: added libdeamon to makefile to close sockets in SubProcess

 src/libs/utils/Makefile |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

_Diff for modified files_:
diff --git a/src/libs/utils/Makefile b/src/libs/utils/Makefile
index abb419d..eb81688 100644
--- a/src/libs/utils/Makefile
+++ b/src/libs/utils/Makefile
@@ -45,6 +45,14 @@ OBJS_lua_fawkesutils = fawkesutils_tolua.o
 CFLAGS  += $(CFLAGS_LIBMAGIC)
 LDFLAGS += $(LDFLAGS_LIBMAGIC)
 
+HAVE_LIBDAEMON = $(if $(shell $(PKGCONFIG) --exists 'libdaemon'; echo $${?/1/}),1,0)
+ifeq ($(HAVE_LIBDAEMON),1)
+  CFLAGS  +=  -DHAVE_LIBDAEMON $(shell $(PKGCONFIG) --cflags 'libdaemon')
+  LDFLAGS += $(shell $(PKGCONFIG) --libs 'libdaemon')
+else
+  WARN_TARGETS += warning_libdaemon
+endif
+
 OBJS_all = $(OBJS_libfawkesutils) $(OBJS_lua_fawkesutils)
 
 ifeq ($(HAVE_TOLUA)$(HAVE_CPP11)$(HAVE_BOOST_LIBS),111)
@@ -81,6 +89,8 @@ warning_cpp11:
 		"(CPP11 not available)"
 $(WARN_TARGETS_BOOST): warning_boost_%:
 	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Cannot build utils library$(TNORMAL) (Boost library $* not found)"endif
+warning_libdaemon:
+	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Sub-process cannot close all file handles$(TNORMAL) (libdaemon not found)"
 
 endif
 

- *commit* 0d9b7324776d159cbe24ee38e45357b514fabd80 - - - - - - - - - -
Author:  Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
Date:    Tue Oct 11 21:51:46 2016 +0200
Subject: colli: renamed AStar class to avoid conflict with utils/search/astar

 src/plugins/colli/search/astar.cpp        |   20 ++++++++++----------
 src/plugins/colli/search/astar.h          |    6 +++---
 src/plugins/colli/search/astar_search.cpp |    2 +-
 src/plugins/colli/search/astar_search.h   |    4 ++--
 4 files changed, 16 insertions(+), 16 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/colli/search/astar.cpp b/src/plugins/colli/search/astar.cpp
index 8038016..75be545 100644
--- a/src/plugins/colli/search/astar.cpp
+++ b/src/plugins/colli/search/astar.cpp
@@ -52,7 +52,7 @@ namespace fawkes
  * @param logger The fawkes logger
  * @param config The fawkes configuration
  */
-AStar::AStar( LaserOccupancyGrid * occGrid, Logger* logger, Configuration* config )
+AStarColli::AStarColli( LaserOccupancyGrid * occGrid, Logger* logger, Configuration* config )
  : logger_( logger )
 {
   logger_->log_debug("AStar", "(Constructor): Initializing AStar");
@@ -86,7 +86,7 @@ AStar::AStar( LaserOccupancyGrid * occGrid, Logger* logger, Configuration* confi
 /** Destructor.
  *  This destructor deletes all the states allocated during construction.
  */
-AStar::~AStar()
+AStarColli::~AStarColli()
 {
   logger_->log_debug("AStar", "(Destructor): Destroying AStar");
   for( int i = 0; i < max_states_; i++ )
@@ -106,7 +106,7 @@ AStar::~AStar()
  * @param solution a vector that will be filled with the found path
  */
 void
-AStar::solve( const point_t &robo_pos, const point_t &target_pos, vector<point_t> &solution )
+AStarColli::solve( const point_t &robo_pos, const point_t &target_pos, vector<point_t> &solution )
 {
   // initialize counter, vectors/lists/queues
   astar_state_count_ = 0;
@@ -146,7 +146,7 @@ AStar::solve( const point_t &robo_pos, const point_t &target_pos, vector<point_t
  *  Its really easy, you can find it like this everywhere.
  */
 AStarState*
-AStar::search( )
+AStarColli::search( )
 {
   AStarState * best = 0;
 
@@ -197,7 +197,7 @@ AStar::search( )
  *    afterwards a number that is smaller tham 14 bits!
  */
 int
-AStar::calculate_key( int x, int y )
+AStarColli::calculate_key( int x, int y )
 {
   return (x << 15) | y;  // This line is a crime! But fast ;-)
 }
@@ -209,7 +209,7 @@ AStar::calculate_key( int x, int y )
  *   Afterwards these children are put on the openlist.
  */
 void
-AStar::generate_children( AStarState * father )
+AStarColli::generate_children( AStarState * father )
 {
   AStarState * child;
   int key;
@@ -301,7 +301,7 @@ AStar::generate_children( AStarState * father )
  *    because we are calculating on a grid...
  */
 int
-AStar::heuristic( AStarState * state )
+AStarColli::heuristic( AStarState * state )
 {
   //  return (int)( abs( state->x_ - target_state_.x_ ));
   return (int)( abs( state->x_ - target_state_.x_ ) +
@@ -313,7 +313,7 @@ AStar::heuristic( AStarState * state )
  *  This method checks, if a state is a goal state.
  */
 bool
-AStar::is_goal( AStarState * state )
+AStarColli::is_goal( AStarState * state )
 {
   return ( (target_state_.x_ == state->x_) &&
            (target_state_.y_ == state->y_) );
@@ -325,7 +325,7 @@ AStar::is_goal( AStarState * state )
  *    tree into the solution/plan vector.
  */
 void
-AStar::get_solution_sequence( AStarState * node, vector<point_t> &solution )
+AStarColli::get_solution_sequence( AStarState * node, vector<point_t> &solution )
 {
   AStarState * state = node;
   while ( state != 0 ) {
@@ -350,7 +350,7 @@ AStar::get_solution_sequence( AStarState * node, vector<point_t> &solution )
  * @return a new modified point.
  */
 point_t
-AStar::remove_target_from_obstacle( int target_x, int target_y, int step_x, int step_y  )
+AStarColli::remove_target_from_obstacle( int target_x, int target_y, int step_x, int step_y  )
 {
   // initializing lists...
   while ( open_list_.size() > 0 )
diff --git a/src/plugins/colli/search/astar.h b/src/plugins/colli/search/astar.h
index b984e1e..588c248 100644
--- a/src/plugins/colli/search/astar.h
+++ b/src/plugins/colli/search/astar.h
@@ -46,11 +46,11 @@ typedef struct point_struct point_t;
  *  This is an implementation of the A* search algorithm in a
  *    highly efficient way (I hope ;-).
  */
-class AStar
+class AStarColli
 {
  public:
-  AStar( LaserOccupancyGrid * occGrid, Logger* logger, Configuration* config );
-  ~AStar();
+  AStarColli( LaserOccupancyGrid * occGrid, Logger* logger, Configuration* config );
+  ~AStarColli();
 
   /* =========================================== */
   /* ************* PUBLIC METHODS ************** */
diff --git a/src/plugins/colli/search/astar_search.cpp b/src/plugins/colli/search/astar_search.cpp
index 9b20a31..70c282a 100644
--- a/src/plugins/colli/search/astar_search.cpp
+++ b/src/plugins/colli/search/astar_search.cpp
@@ -52,7 +52,7 @@ Search::Search( LaserOccupancyGrid * occ_grid, Logger* logger, Configuration* co
   logger_->log_debug("search", "(Constructor): Entering");
   std::string cfg_prefix = "/plugins/colli/search/";
   cfg_search_line_allowed_cost_max_  = config->get_int((cfg_prefix + "line/cost_max").c_str());
-  astar_ = new AStar( occ_grid, logger, config );
+  astar_ = new AStarColli( occ_grid, logger, config );
   logger_->log_debug("search", "(Constructor): Exiting");
 }
 
diff --git a/src/plugins/colli/search/astar_search.h b/src/plugins/colli/search/astar_search.h
index 14ff889..bed2fee 100644
--- a/src/plugins/colli/search/astar_search.h
+++ b/src/plugins/colli/search/astar_search.h
@@ -34,7 +34,7 @@ namespace fawkes
 #endif
 
 class LaserOccupancyGrid;
-class AStar;
+class AStarColli;
 class Logger;
 class Configuration;
 
@@ -77,7 +77,7 @@ class Search: public AbstractSearch
   bool is_obstacle_between( const point_t &a, const point_t &b, const int maxcount );
 
 
-  AStar * astar_;              /**< the A* search algorithm */
+  AStarColli * astar_;              /**< the A* search algorithm */
   std::vector< point_t > plan_; /**< the local representation of the plan */
 
   point_t robo_position_, target_position_;

- *commit* 4be6453b104a252de0ad2b36b687b69acbbf2ae8 - - - - - - - - - -
Author:  Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
Date:    Thu Oct 20 16:33:40 2016 +0200
Subject: Added ASP aspect.

 src/plugins/asp/.gitignore            |    1 +
 src/plugins/asp/Makefile              |   68 +++++++++++++++++++++++++++
 src/plugins/asp/asp.config            |    2 +
 src/plugins/asp/asp.creator           |    1 +
 src/plugins/asp/asp.files             |   11 +++++
 src/plugins/asp/asp.includes          |    8 +++
 src/plugins/asp/asp_plugin.cpp        |   47 +++++++++++++++++++
 src/plugins/asp/asp_thread.cpp        |   58 +++++++++++++++++++++++
 src/plugins/asp/asp_thread.h          |   54 ++++++++++++++++++++++
 src/plugins/asp/aspect/Makefile       |   61 +++++++++++++++++++++++++
 src/plugins/asp/aspect/asp.cpp        |   81 +++++++++++++++++++++++++++++++++
 src/plugins/asp/aspect/asp.h          |   59 ++++++++++++++++++++++++
 src/plugins/asp/aspect/asp_inifin.cpp |   74 ++++++++++++++++++++++++++++++
 src/plugins/asp/aspect/asp_inifin.h   |   46 +++++++++++++++++++
 14 files changed, 571 insertions(+), 0 deletions(-)


- *commit* e9e72cbfd7c4d18b6da09b9ad2853c11140c8f65 - - - - - - - - - -
Author:  Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
Date:    Thu Oct 20 23:19:33 2016 +0200
Subject: ASP Aspect: Use Fawkes logging for Clingo.

 src/plugins/asp/asp_thread.cpp        |    1 +
 src/plugins/asp/asp_thread.h          |    2 +
 src/plugins/asp/aspect/asp_inifin.cpp |   38 ++++++++++++++++++++++++++++++--
 src/plugins/asp/aspect/asp_inifin.h   |    7 ++++++
 4 files changed, 45 insertions(+), 3 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/asp/asp_thread.cpp b/src/plugins/asp/asp_thread.cpp
index 285ece6..99b5805 100644
--- a/src/plugins/asp/asp_thread.cpp
+++ b/src/plugins/asp/asp_thread.cpp
@@ -42,6 +42,7 @@ ASPThread::ASPThread(void)
 void
 ASPThread::init(void)
 {
+	ASPIniFin.setLogger(logger);
 	return;
 }
 
diff --git a/src/plugins/asp/asp_thread.h b/src/plugins/asp/asp_thread.h
index 590d390..92ac825 100644
--- a/src/plugins/asp/asp_thread.h
+++ b/src/plugins/asp/asp_thread.h
@@ -25,6 +25,7 @@
 
 #include <aspect/aspect_provider.h>
 #include "aspect/asp_inifin.h"
+#include <aspect/logging.h>
 #include <core/threading/thread.h>
 
 namespace fawkes {
@@ -33,6 +34,7 @@ namespace fawkes {
 
 class ASPThread
 : public fawkes::Thread,
+  public fawkes::LoggingAspect,
   public fawkes::AspectProviderAspect
 {
 	private:
diff --git a/src/plugins/asp/aspect/asp_inifin.cpp b/src/plugins/asp/aspect/asp_inifin.cpp
index 0dbeb8d..2a39bf7 100644
--- a/src/plugins/asp/aspect/asp_inifin.cpp
+++ b/src/plugins/asp/aspect/asp_inifin.cpp
@@ -25,6 +25,7 @@
 #include "asp_inifin.h"
 #include <clingo.hh>
 #include <core/threading/thread_finalizer.h>
+#include <logging/logger.h>
 
 namespace fawkes {
 #if 0 /* just to make Emacs auto-indent happy */
@@ -35,10 +36,14 @@ namespace fawkes {
  * ASPAspect initializer/finalizer.
  * This initializer/finalizer will provide the ASP node handle to threads with the ASPAspect.
  * @author Björn Schäpers
+ *
+ * @property ASPAspectIniFin::Log
+ * @brief The logger used for Clingo Output.
  */
 
-/** Constructor. */
-ASPAspectIniFin::ASPAspectIniFin(void) : AspectIniFin("ASPAspect")
+/** Constructor.
+ */
+ASPAspectIniFin::ASPAspectIniFin(void) : AspectIniFin("ASPAspect"), Log(nullptr)
 {
 	return;
 }
@@ -53,7 +58,23 @@ ASPAspectIniFin::init(Thread *thread)
 		thread->name());
 	} //if ( asp_thread == nullptr )
 
-	asp_thread->init_ASPAspect(LockPtr<Clingo::Control>(new Clingo::Control));
+	auto clingoLogger = [this](const Clingo::WarningCode code, char const *msg)
+		{
+			fawkes::Logger::LogLevel level = fawkes::Logger::LL_NONE;
+			switch ( code )
+			{
+				case Clingo::WarningCode::AtomUndefined      :
+				case Clingo::WarningCode::OperationUndefined :
+				case Clingo::WarningCode::RuntimeError       : level = fawkes::Logger::LL_ERROR; break;
+				case Clingo::WarningCode::Other              :
+				case Clingo::WarningCode::VariableUnbounded  : level = fawkes::Logger::LL_WARN;
+				case Clingo::WarningCode::FileIncluded       :
+				case Clingo::WarningCode::GlobalVariable     : level = fawkes::Logger::LL_INFO; break;
+			} //switch ( code )
+			Log->log(level, "Clingo", msg);
+			return;
+		};
+	asp_thread->init_ASPAspect(LockPtr<Clingo::Control>(new Clingo::Control({}, clingoLogger, 100)));
 	return;
 }
 
@@ -71,4 +92,15 @@ ASPAspectIniFin::finalize(Thread *thread)
 	return;
 }
 
+/**
+ * @brief Sets the logger to use for Clingo messages.
+ * @param[in] logger The new logger.
+ */
+void
+ASPAspectIniFin::setLogger(Logger *logger)
+{
+	Log = logger;
+	return;
+}
+
 } // end namespace fawkes
diff --git a/src/plugins/asp/aspect/asp_inifin.h b/src/plugins/asp/aspect/asp_inifin.h
index f62ef73..d112084 100644
--- a/src/plugins/asp/aspect/asp_inifin.h
+++ b/src/plugins/asp/aspect/asp_inifin.h
@@ -32,13 +32,20 @@ namespace fawkes {
 }
 #endif
 
+class Logger;
+
 class ASPAspectIniFin : public AspectIniFin
 {
+	private:
+	Logger *Log;
+
 	public:
 	ASPAspectIniFin(void);
 
 	void init(Thread *thread) override;
 	void finalize(Thread *thread) override;
+
+	void setLogger(Logger *logger);
 };
 
 } // end namespace fawkes

- *commit* e12a79a33ecd6c77f606be97389793f30dd0d9ae - - - - - - - - - -
Author:  Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
Date:    Thu Oct 27 16:57:30 2016 +0200
Subject: ASP-Aspect: Added ClingoControlManager

 src/plugins/asp/asp.files                          |    2 +
 src/plugins/asp/aspect/clingo_control_manager.cpp  |  116 ++++++++++++++++++++
 .../asp/aspect/{asp.h => clingo_control_manager.h} |   37 +++---
 3 files changed, 136 insertions(+), 19 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/asp/asp.files b/src/plugins/asp/asp.files
index df59585..41a8afd 100644
--- a/src/plugins/asp/asp.files
+++ b/src/plugins/asp/asp.files
@@ -7,5 +7,7 @@ asp_thread.cpp
 aspect/Makefile
 aspect/asp.h
 aspect/asp.cpp
+aspect/clingo_control_manager.h
+aspect/clingo_control_manager.cpp
 aspect/asp_inifin.h
 aspect/asp_inifin.cpp

- *commit* 42ff578e47ba3aa4ac7a8fd277489171fd346cfb - - - - - - - - - -
Author:  Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
Date:    Sat Oct 29 11:50:46 2016 +0200
Subject: ASP-Aspect: Added ClingoManagerAspect.

 src/plugins/asp/asp.files                          |    8 ++-
 .../asp/aspect/clingo_manager.cpp}                 |   44 +++++-----
 src/plugins/asp/aspect/{asp.h => clingo_manager.h} |   29 ++----
 src/plugins/asp/aspect/clingo_manager_inifin.cpp   |   91 ++++++++++++++++++++
 .../{asp_inifin.h => clingo_manager_inifin.h}      |   22 +++---
 5 files changed, 138 insertions(+), 56 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/asp/asp.files b/src/plugins/asp/asp.files
index 41a8afd..3c8dad7 100644
--- a/src/plugins/asp/asp.files
+++ b/src/plugins/asp/asp.files
@@ -7,7 +7,11 @@ asp_thread.cpp
 aspect/Makefile
 aspect/asp.h
 aspect/asp.cpp
-aspect/clingo_control_manager.h
-aspect/clingo_control_manager.cpp
 aspect/asp_inifin.h
 aspect/asp_inifin.cpp
+aspect/clingo_control_manager.h
+aspect/clingo_control_manager.cpp
+aspect/clingo_manager.h
+aspect/clingo_manager.cpp
+aspect/clingo_manager_inifin.h
+aspect/clingo_manager_inifin.cpp

- *commit* a9e2d8b59531106c5f6b983af6582da67fb5b0f4 - - - - - - - - - -
Author:  Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
Date:    Sun Oct 30 13:57:12 2016 +0100
Subject: ASP-Aspect: Prepared aspect and inifin for the control manager.

 src/plugins/asp/aspect/asp.cpp        |   13 ++++++++---
 src/plugins/asp/aspect/asp.h          |    4 ++-
 src/plugins/asp/aspect/asp_inifin.cpp |   34 +++++++++++++++++++++++++++++---
 src/plugins/asp/aspect/asp_inifin.h   |    6 +++++
 4 files changed, 48 insertions(+), 9 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/asp/aspect/asp.cpp b/src/plugins/asp/aspect/asp.cpp
index 3163f22..7650e4a 100644
--- a/src/plugins/asp/aspect/asp.cpp
+++ b/src/plugins/asp/aspect/asp.cpp
@@ -36,14 +36,19 @@ namespace fawkes {
  * @ingroup Aspects
  * @author Björn Schäpers
  *
- * @property fawkes:LockPtr<Clingo::Control> ASPAspect::ClingoControl
- * Clingo Control for exclusive usage.
+ * @property ASPAspect::ControlName
+ * @brief The name for the control in the manager.
+ *
+ * @property ASPAspect::ClingoControl
+ * @brief Clingo Control for exclusive usage.
  */
 
 
-/** Constructor.
+/**
+ * Constructor.
+ * @param[in] controlName The desired control name.
  */
-ASPAspect::ASPAspect(void)
+ASPAspect::ASPAspect(const std::string&& controlName) : ControlName(std::move(controlName))
 {
 	add_aspect("ASPAspect");
 	return;
diff --git a/src/plugins/asp/aspect/asp.h b/src/plugins/asp/aspect/asp.h
index e356fa7..72782e0 100644
--- a/src/plugins/asp/aspect/asp.h
+++ b/src/plugins/asp/aspect/asp.h
@@ -41,6 +41,8 @@ namespace fawkes {
 class ASPAspect : public virtual Aspect
 {
 	private:
+	const std::string ControlName;
+
 	void init_ASPAspect(LockPtr<Clingo::Control> clingoControl);
 	void finalize_ASPAspect();
 
@@ -48,7 +50,7 @@ class ASPAspect : public virtual Aspect
 	LockPtr<Clingo::Control> ClingoControl;
 
 	public:
-	ASPAspect(void);
+	ASPAspect(const std::string&& controlName);
 	virtual ~ASPAspect(void);
 
 	friend class ASPAspectIniFin;
diff --git a/src/plugins/asp/aspect/asp_inifin.cpp b/src/plugins/asp/aspect/asp_inifin.cpp
index 2a39bf7..c6f1887 100644
--- a/src/plugins/asp/aspect/asp_inifin.cpp
+++ b/src/plugins/asp/aspect/asp_inifin.cpp
@@ -21,33 +21,48 @@
  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
  */
 
-#include "asp.h"
-#include "asp_inifin.h"
 #include <clingo.hh>
 #include <core/threading/thread_finalizer.h>
 #include <logging/logger.h>
 
+#include "asp.h"
+#include "asp_inifin.h"
+#include "clingo_control_manager.h"
+
 namespace fawkes {
 #if 0 /* just to make Emacs auto-indent happy */
 }
 #endif
 
-/** @class ASPAspectIniFin <plugins/asp/aspect/asp_inifin.h>
+/**
+ * @class ASPAspectIniFin <plugins/asp/aspect/asp_inifin.h>
  * ASPAspect initializer/finalizer.
  * This initializer/finalizer will provide the ASP node handle to threads with the ASPAspect.
  * @author Björn Schäpers
  *
  * @property ASPAspectIniFin::Log
  * @brief The logger used for Clingo Output.
+ *
+ * @property ASPAspectIniFin::CtrlMgr
+ * @brief The control manager.
  */
 
-/** Constructor.
+/**
+ * Constructor.
  */
 ASPAspectIniFin::ASPAspectIniFin(void) : AspectIniFin("ASPAspect"), Log(nullptr)
 {
 	return;
 }
 
+/**
+ * @brief Destructor.
+ */
+ASPAspectIniFin::~ASPAspectIniFin(void)
+{
+	return;
+}
+
 void
 ASPAspectIniFin::init(Thread *thread)
 {
@@ -103,4 +118,15 @@ ASPAspectIniFin::setLogger(Logger *logger)
 	return;
 }
 
+/**
+ * @brief Sets the control manager.
+ * @param[in] ctrlMgr The new control manager.
+ */
+void
+ASPAspectIniFin::setControlManager(const LockPtr<ClingoControlManager>& ctrlMgr)
+{
+	CtrlMgr = ctrlMgr;
+	return;
+}
+
 } // end namespace fawkes
diff --git a/src/plugins/asp/aspect/asp_inifin.h b/src/plugins/asp/aspect/asp_inifin.h
index d112084..1563622 100644
--- a/src/plugins/asp/aspect/asp_inifin.h
+++ b/src/plugins/asp/aspect/asp_inifin.h
@@ -25,6 +25,8 @@
 #define __PLUGINS_ASP_ASPECT_ASP_INIFIN_H_
 
 #include <aspect/inifins/inifin.h>
+#include <core/utils/lockptr.h>
+
 #include "asp.h"
 
 namespace fawkes {
@@ -32,20 +34,24 @@ namespace fawkes {
 }
 #endif
 
+class ClingoControlManager;
 class Logger;
 
 class ASPAspectIniFin : public AspectIniFin
 {
 	private:
 	Logger *Log;
+	LockPtr<ClingoControlManager> CtrlMgr;
 
 	public:
 	ASPAspectIniFin(void);
+	~ASPAspectIniFin(void);
 
 	void init(Thread *thread) override;
 	void finalize(Thread *thread) override;
 
 	void setLogger(Logger *logger);
+	void setControlManager(const LockPtr<ClingoControlManager>& ctrlMgr);
 };
 
 } // end namespace fawkes

- *commit* a3d9f59247cb0ee73a36e5d1a5ebc3343da12d76 - - - - - - - - - -
Author:  Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
Date:    Sun Oct 30 20:52:38 2016 +0100
Subject: ASPAspect: Use the clingo control manager for the aspects.

 src/plugins/asp/asp_thread.cpp                    |   21 +++++++++++-
 src/plugins/asp/asp_thread.h                      |    8 ++++-
 src/plugins/asp/aspect/asp.cpp                    |    7 ++++-
 src/plugins/asp/aspect/asp.h                      |    3 +-
 src/plugins/asp/aspect/asp_inifin.cpp             |   34 +-------------------
 src/plugins/asp/aspect/asp_inifin.h               |    2 -
 src/plugins/asp/aspect/clingo_control_manager.cpp |   13 +++++++-
 src/plugins/asp/aspect/clingo_control_manager.h   |    4 ++-
 src/plugins/asp/aspect/clingo_manager_inifin.cpp  |    2 +-
 src/plugins/asp/aspect/clingo_manager_inifin.h    |    2 +-
 10 files changed, 51 insertions(+), 45 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/asp/asp_thread.cpp b/src/plugins/asp/asp_thread.cpp
index 99b5805..19da8c3 100644
--- a/src/plugins/asp/asp_thread.cpp
+++ b/src/plugins/asp/asp_thread.cpp
@@ -29,12 +29,27 @@ using namespace fawkes;
  * ASP environment thread.
  *
  * @author Björn Schäpers
+ *
+ * @property ASPThread::ASPIniFin
+ * @brief The initi-/finalizer for the ASPAspect.
+ *
+ * @property ASPThread::ClingoIniFin
+ * @brief The initi-/finalizer for the ClingoManagerAspect.
+ *
+ * @property ASPThread::CtrlMgr
+ * @brief The clingo control manager.
  */
 
 /** Constructor. */
 ASPThread::ASPThread(void)
   : Thread("ASPThread", Thread::OPMODE_WAITFORWAKEUP),
-	AspectProviderAspect(std::list<fawkes::AspectIniFin*>(1, &ASPIniFin))
+	AspectProviderAspect([this](void) {
+		std::list<fawkes::AspectIniFin*> ret;
+		ret.emplace_back(&ASPIniFin);
+		ret.emplace_back(&ClingoIniFin);
+		return ret;
+	}()),
+	CtrlMgr(new ClingoControlManager)
 {
 	return;
 }
@@ -42,7 +57,9 @@ ASPThread::ASPThread(void)
 void
 ASPThread::init(void)
 {
-	ASPIniFin.setLogger(logger);
+	CtrlMgr->setLogger(logger);
+	ASPIniFin.setControlManager(CtrlMgr);
+	ClingoIniFin.setControlManager(CtrlMgr);
 	return;
 }
 
diff --git a/src/plugins/asp/asp_thread.h b/src/plugins/asp/asp_thread.h
index 92ac825..68bee30 100644
--- a/src/plugins/asp/asp_thread.h
+++ b/src/plugins/asp/asp_thread.h
@@ -24,10 +24,13 @@
 #define __PLUGINS_ASP_ASP_THREAD_H_
 
 #include <aspect/aspect_provider.h>
-#include "aspect/asp_inifin.h"
 #include <aspect/logging.h>
 #include <core/threading/thread.h>
 
+#include "aspect/asp_inifin.h"
+#include "aspect/clingo_control_manager.h"
+#include "aspect/clingo_manager_inifin.h"
+
 namespace fawkes {
 	class AspectIniFin;
 }
@@ -39,6 +42,8 @@ class ASPThread
 {
 	private:
 	fawkes::ASPAspectIniFin ASPIniFin;
+	fawkes::ClingoManagerAspectIniFin ClingoIniFin;
+	fawkes::LockPtr<fawkes::ClingoControlManager> CtrlMgr;
 
 	protected:
 	/** Stub to see name in backtrace for easier debugging. @see Thread::run() */
@@ -50,7 +55,6 @@ class ASPThread
 	void init(void) override;
 	void loop(void) override;
 	void finalize(void) override;
-
 };
 
 #endif
diff --git a/src/plugins/asp/aspect/asp.cpp b/src/plugins/asp/aspect/asp.cpp
index 7650e4a..fcd57c8 100644
--- a/src/plugins/asp/aspect/asp.cpp
+++ b/src/plugins/asp/aspect/asp.cpp
@@ -39,6 +39,9 @@ namespace fawkes {
  * @property ASPAspect::ControlName
  * @brief The name for the control in the manager.
  *
+ * @property ASPAspect::LogComponent
+ * @brief The component for the logger.
+ *
  * @property ASPAspect::ClingoControl
  * @brief Clingo Control for exclusive usage.
  */
@@ -47,8 +50,10 @@ namespace fawkes {
 /**
  * Constructor.
  * @param[in] controlName The desired control name.
+ * @param[in] logComponent The component for the logger.
  */
-ASPAspect::ASPAspect(const std::string&& controlName) : ControlName(std::move(controlName))
+ASPAspect::ASPAspect(const std::string&& controlName, const std::string&& logComponent) :
+	ControlName(std::move(controlName)), LogComponent(std::move(logComponent))
 {
 	add_aspect("ASPAspect");
 	return;
diff --git a/src/plugins/asp/aspect/asp.h b/src/plugins/asp/aspect/asp.h
index 72782e0..b86b869 100644
--- a/src/plugins/asp/aspect/asp.h
+++ b/src/plugins/asp/aspect/asp.h
@@ -42,6 +42,7 @@ class ASPAspect : public virtual Aspect
 {
 	private:
 	const std::string ControlName;
+	const std::string LogComponent;
 
 	void init_ASPAspect(LockPtr<Clingo::Control> clingoControl);
 	void finalize_ASPAspect();
@@ -50,7 +51,7 @@ class ASPAspect : public virtual Aspect
 	LockPtr<Clingo::Control> ClingoControl;
 
 	public:
-	ASPAspect(const std::string&& controlName);
+	ASPAspect(const std::string&& controlName, const std::string&& logComponent = std::string());
 	virtual ~ASPAspect(void);
 
 	friend class ASPAspectIniFin;
diff --git a/src/plugins/asp/aspect/asp_inifin.cpp b/src/plugins/asp/aspect/asp_inifin.cpp
index c6f1887..ecd27eb 100644
--- a/src/plugins/asp/aspect/asp_inifin.cpp
+++ b/src/plugins/asp/aspect/asp_inifin.cpp
@@ -40,9 +40,6 @@ namespace fawkes {
  * This initializer/finalizer will provide the ASP node handle to threads with the ASPAspect.
  * @author Björn Schäpers
  *
- * @property ASPAspectIniFin::Log
- * @brief The logger used for Clingo Output.
- *
  * @property ASPAspectIniFin::CtrlMgr
  * @brief The control manager.
  */
@@ -50,7 +47,7 @@ namespace fawkes {
 /**
  * Constructor.
  */
-ASPAspectIniFin::ASPAspectIniFin(void) : AspectIniFin("ASPAspect"), Log(nullptr)
+ASPAspectIniFin::ASPAspectIniFin(void) : AspectIniFin("ASPAspect")
 {
 	return;
 }
@@ -73,23 +70,7 @@ ASPAspectIniFin::init(Thread *thread)
 		thread->name());
 	} //if ( asp_thread == nullptr )
 
-	auto clingoLogger = [this](const Clingo::WarningCode code, char const *msg)
-		{
-			fawkes::Logger::LogLevel level = fawkes::Logger::LL_NONE;
-			switch ( code )
-			{
-				case Clingo::WarningCode::AtomUndefined      :
-				case Clingo::WarningCode::OperationUndefined :
-				case Clingo::WarningCode::RuntimeError       : level = fawkes::Logger::LL_ERROR; break;
-				case Clingo::WarningCode::Other              :
-				case Clingo::WarningCode::VariableUnbounded  : level = fawkes::Logger::LL_WARN;
-				case Clingo::WarningCode::FileIncluded       :
-				case Clingo::WarningCode::GlobalVariable     : level = fawkes::Logger::LL_INFO; break;
-			} //switch ( code )
-			Log->log(level, "Clingo", msg);
-			return;
-		};
-	asp_thread->init_ASPAspect(LockPtr<Clingo::Control>(new Clingo::Control({}, clingoLogger, 100)));
+	asp_thread->init_ASPAspect(CtrlMgr->create_control(asp_thread->ControlName, asp_thread->LogComponent));
 	return;
 }
 
@@ -108,17 +89,6 @@ ASPAspectIniFin::finalize(Thread *thread)
 }
 
 /**
- * @brief Sets the logger to use for Clingo messages.
- * @param[in] logger The new logger.
- */
-void
-ASPAspectIniFin::setLogger(Logger *logger)
-{
-	Log = logger;
-	return;
-}
-
-/**
  * @brief Sets the control manager.
  * @param[in] ctrlMgr The new control manager.
  */
diff --git a/src/plugins/asp/aspect/asp_inifin.h b/src/plugins/asp/aspect/asp_inifin.h
index 1563622..141ffb9 100644
--- a/src/plugins/asp/aspect/asp_inifin.h
+++ b/src/plugins/asp/aspect/asp_inifin.h
@@ -40,7 +40,6 @@ class Logger;
 class ASPAspectIniFin : public AspectIniFin
 {
 	private:
-	Logger *Log;
 	LockPtr<ClingoControlManager> CtrlMgr;
 
 	public:
@@ -50,7 +49,6 @@ class ASPAspectIniFin : public AspectIniFin
 	void init(Thread *thread) override;
 	void finalize(Thread *thread) override;
 
-	void setLogger(Logger *logger);
 	void setControlManager(const LockPtr<ClingoControlManager>& ctrlMgr);
 };
 
diff --git a/src/plugins/asp/aspect/clingo_control_manager.cpp b/src/plugins/asp/aspect/clingo_control_manager.cpp
index b508ef7..6019d76 100644
--- a/src/plugins/asp/aspect/clingo_control_manager.cpp
+++ b/src/plugins/asp/aspect/clingo_control_manager.cpp
@@ -39,9 +39,8 @@ namespace fawkes {
 
 /**
  * Constructor.
- * @param[in] logger The logger for the controls.
  */
-ClingoControlManager::ClingoControlManager(Logger *logger) : Log(logger)
+ClingoControlManager::ClingoControlManager(void) : Log(nullptr)
 {
 	return;
 }
@@ -53,6 +52,16 @@ ClingoControlManager::~ClingoControlManager(void)
 }
 
 /**
+ * @brief Sets the logger for all Clingo Controls.
+ * @param[in] logger The logger.
+ */
+void ClingoControlManager::setLogger(Logger *logger)
+{
+	Log = logger;
+	return;
+}
+
+/**
  * Create a new control. The control is registered internally under the specified name.
  * It must be destroyed when done with it. Only a single control can be created for a particular control name.
  * @param[in] ctrl_name The Name by which to register the control.
diff --git a/src/plugins/asp/aspect/clingo_control_manager.h b/src/plugins/asp/aspect/clingo_control_manager.h
index 41a5406..be16d12 100644
--- a/src/plugins/asp/aspect/clingo_control_manager.h
+++ b/src/plugins/asp/aspect/clingo_control_manager.h
@@ -44,9 +44,11 @@ class ClingoControlManager
 	std::unordered_map<std::string, LockPtr<Clingo::Control>> Controls;
 
 	public:
-	ClingoControlManager(Logger *logger);
+	ClingoControlManager(void);
 	virtual ~ClingoControlManager(void);
 
+	void setLogger(Logger *logger);
+
 	LockPtr<Clingo::Control> create_control(const std::string& ctrl_name, const std::string& log_component_name);
 	void destroy_control(const std::string& ctrl_name);
 
diff --git a/src/plugins/asp/aspect/clingo_manager_inifin.cpp b/src/plugins/asp/aspect/clingo_manager_inifin.cpp
index 6478dd7..391167c 100644
--- a/src/plugins/asp/aspect/clingo_manager_inifin.cpp
+++ b/src/plugins/asp/aspect/clingo_manager_inifin.cpp
@@ -82,7 +82,7 @@ ClingoManagerAspectIniFin::finalize(Thread *thread)
  * @param[in] clingoCtrlMgr Clingo control manager
  */
 void
-ClingoManagerAspectIniFin::set_manager(LockPtr<ClingoControlManager>& clingoCtrlMgr)
+ClingoManagerAspectIniFin::setControlManager(LockPtr<ClingoControlManager>& clingoCtrlMgr)
 {
 	ClingoCtrlMgr = clingoCtrlMgr;
 	return;
diff --git a/src/plugins/asp/aspect/clingo_manager_inifin.h b/src/plugins/asp/aspect/clingo_manager_inifin.h
index a33cc52..a142d88 100644
--- a/src/plugins/asp/aspect/clingo_manager_inifin.h
+++ b/src/plugins/asp/aspect/clingo_manager_inifin.h
@@ -45,7 +45,7 @@ class ClingoManagerAspectIniFin : public AspectIniFin
 	void init(Thread *thread) override;
 	void finalize(Thread *thread) override;
 
-	void set_manager(LockPtr<ClingoControlManager>& clingoCtrlMgr);
+	void setControlManager(LockPtr<ClingoControlManager>& clingoCtrlMgr);
 };
 
 } // end namespace fawkes

- *commit* 748f69bbfbc0786c9582c7155b1b7a49d08ff30a - - - - - - - - - -
Author:  Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
Date:    Mon Oct 31 16:26:27 2016 +0100
Subject: ASP-Aspect: Added access wrapper class.

 src/plugins/asp/Makefile                          |   12 +-
 src/plugins/asp/asp.files                         |    2 +
 src/plugins/asp/aspect/Makefile                   |   10 +-
 src/plugins/asp/aspect/asp.cpp                    |   12 +-
 src/plugins/asp/aspect/asp.h                      |   12 +-
 src/plugins/asp/aspect/asp_inifin.cpp             |    2 +-
 src/plugins/asp/aspect/clingo_access.cpp          |  356 +++++++++++++++++++++
 src/plugins/asp/aspect/clingo_access.h            |   82 +++++
 src/plugins/asp/aspect/clingo_control_manager.cpp |   29 +--
 src/plugins/asp/aspect/clingo_control_manager.h   |   11 +-
 10 files changed, 473 insertions(+), 55 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/asp/Makefile b/src/plugins/asp/Makefile
index d1b8a48..9df80ff 100644
--- a/src/plugins/asp/Makefile
+++ b/src/plugins/asp/Makefile
@@ -41,14 +41,14 @@ ifeq ($(HAVE_CPP11),1)
   ifeq ($(HAVE_CLINGO),1)
     PRESUBDIRS += aspect
 
-	CFLAGS  += $(CFLAGS_CLINGO) $(CFLAGS_CPP11)
-	LDFLAGS += $(LDFLAGS_CLINGO) $(LDFLAGS_CPP11)
+    CFLAGS  += $(CFLAGS_CLINGO) $(CFLAGS_CPP11)
+    LDFLAGS += $(LDFLAGS_CLINGO) $(LDFLAGS_CPP11)
 
-	PLUGINS_all = $(PLUGINDIR)/asp.so
+    PLUGINS_all = $(PLUGINDIR)/asp.so
 
-	INSTALL_extra = asp_files
-else
-	WARN_TARGETS += warning_clingo
+    INSTALL_extra = asp_files
+  else
+    WARN_TARGETS += warning_clingo
   endif
 else
   WARN_TARGETS += warning_cpp11
diff --git a/src/plugins/asp/asp.files b/src/plugins/asp/asp.files
index 3c8dad7..3ed9f3c 100644
--- a/src/plugins/asp/asp.files
+++ b/src/plugins/asp/asp.files
@@ -9,6 +9,8 @@ aspect/asp.h
 aspect/asp.cpp
 aspect/asp_inifin.h
 aspect/asp_inifin.cpp
+aspect/clingo_access.h
+aspect/clingo_access.cpp
 aspect/clingo_control_manager.h
 aspect/clingo_control_manager.cpp
 aspect/clingo_manager.h
diff --git a/src/plugins/asp/aspect/Makefile b/src/plugins/asp/aspect/Makefile
index 5c66c4e..9a43079 100644
--- a/src/plugins/asp/aspect/Makefile
+++ b/src/plugins/asp/aspect/Makefile
@@ -36,12 +36,12 @@ LDFLAGS_CLINGO = -L$(HOME)/clingo/build/debug/ -Wl,-rpath=$(HOME)/clingo/build/d
 
 ifeq ($(HAVE_CPP11),1)
   ifeq ($(HAVE_CLINGO),1)
-	CFLAGS  += $(CFLAGS_CLINGO) $(CFLAGS_CPP11)
-	LDFLAGS += $(LDFLAGS_CLINGO) $(LDFLAGS_CPP11)
+    CFLAGS  += $(CFLAGS_CLINGO) $(CFLAGS_CPP11)
+    LDFLAGS += $(LDFLAGS_CLINGO) $(LDFLAGS_CPP11)
 
-	LIBS_all = $(LIBDIR)/libfawkesaspaspect.so
-else
-	WARN_TARGETS += warning_clingo
+    LIBS_all = $(LIBDIR)/libfawkesaspaspect.so
+  else
+    WARN_TARGETS += warning_clingo
   endif
 else
   WARN_TARGETS += warning_cpp11
diff --git a/src/plugins/asp/aspect/asp.cpp b/src/plugins/asp/aspect/asp.cpp
index fcd57c8..5aee875 100644
--- a/src/plugins/asp/aspect/asp.cpp
+++ b/src/plugins/asp/aspect/asp.cpp
@@ -22,7 +22,7 @@
  */
 
 #include "asp.h"
-#include <clingo.hh>
+#include "clingo_access.h"
 
 namespace fawkes {
 #if 0 /* just to make Emacs auto-indent happy */
@@ -69,12 +69,12 @@ ASPAspect::~ASPAspect(void)
 /** Init ASP aspect.
  * This sets the Clingo Control.
  * It is guaranteed that this is called for an ASP Thread before start is called (when running regularly inside Fawkes).
- * @param control The Clingo Control
+ * @param[in] clingo The Clingo Control.
  */
 void
-ASPAspect::init_ASPAspect(LockPtr<Clingo::Control> control)
+ASPAspect::init_ASPAspect(const LockPtr<ClingoAccess>& clingo)
 {
-	ClingoControl = control;
+	Clingo = clingo;
 	return;
 }
 
@@ -82,9 +82,9 @@ ASPAspect::init_ASPAspect(LockPtr<Clingo::Control> control)
  * This clears the Clingo Control.
  */
 void
-ASPAspect::finalize_ASPAspect()
+ASPAspect::finalize_ASPAspect(void)
 {
-	ClingoControl.clear();
+	Clingo.clear();
 	return;
 }
 
diff --git a/src/plugins/asp/aspect/asp.h b/src/plugins/asp/aspect/asp.h
index b86b869..e749f8a 100644
--- a/src/plugins/asp/aspect/asp.h
+++ b/src/plugins/asp/aspect/asp.h
@@ -29,26 +29,24 @@
 
 #include <string>
 
-namespace Clingo {
-  class Control;
-}
-
 namespace fawkes {
 #if 0 /* just to make Emacs auto-indent happy */
 }
 #endif
 
+class ClingoAccess;
+
 class ASPAspect : public virtual Aspect
 {
 	private:
 	const std::string ControlName;
 	const std::string LogComponent;
 
-	void init_ASPAspect(LockPtr<Clingo::Control> clingoControl);
-	void finalize_ASPAspect();
+	void init_ASPAspect(const LockPtr<ClingoAccess>& clingo);
+	void finalize_ASPAspect(void);
 
 	protected:
-	LockPtr<Clingo::Control> ClingoControl;
+	LockPtr<ClingoAccess> Clingo;
 
 	public:
 	ASPAspect(const std::string&& controlName, const std::string&& logComponent = std::string());
diff --git a/src/plugins/asp/aspect/asp_inifin.cpp b/src/plugins/asp/aspect/asp_inifin.cpp
index ecd27eb..a4f48d7 100644
--- a/src/plugins/asp/aspect/asp_inifin.cpp
+++ b/src/plugins/asp/aspect/asp_inifin.cpp
@@ -21,12 +21,12 @@
  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
  */
 
-#include <clingo.hh>
 #include <core/threading/thread_finalizer.h>
 #include <logging/logger.h>
 
 #include "asp.h"
 #include "asp_inifin.h"
+#include "clingo_access.h"
 #include "clingo_control_manager.h"
 
 namespace fawkes {
diff --git a/src/plugins/asp/aspect/clingo_control_manager.cpp b/src/plugins/asp/aspect/clingo_control_manager.cpp
index 6019d76..865c872 100644
--- a/src/plugins/asp/aspect/clingo_control_manager.cpp
+++ b/src/plugins/asp/aspect/clingo_control_manager.cpp
@@ -19,13 +19,12 @@
  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
  */
 
+#include "clingo_access.h"
 #include "clingo_control_manager.h"
 
 #include <core/exception.h>
 #include <logging/logger.h>
 
-#include <clingo.hh>
-
 namespace fawkes {
 #if 0 /* just to make Emacs auto-indent happy */
 }
@@ -68,31 +67,16 @@ void ClingoControlManager::setLogger(Logger *logger)
  * @param[in] log_component_name The Prefix for log entries. If empty it will be set to "Clingo".
  * @return A new plain Clingo Control.
  */
-LockPtr<Clingo::Control>
-ClingoControlManager::create_control(const std::string& ctrl_name, const std::string& log_component_name)
+LockPtr<ClingoAccess> ClingoControlManager::create_control(const std::string& ctrl_name,
+		const std::string& log_component_name)
 {
 	if ( Controls.count(ctrl_name) != 0 )
 	{
 		throw Exception("Clingo Control '%s' already exists!", ctrl_name.c_str());
 	} //if ( Controls.count(ctrl_name) != 0 )
 
-	auto clingoLogger = [this,log_component_name](const Clingo::WarningCode code, char const *msg)
-		{
-			fawkes::Logger::LogLevel level = fawkes::Logger::LL_NONE;
-			switch ( code )
-			{
-				case Clingo::WarningCode::AtomUndefined      :
-				case Clingo::WarningCode::OperationUndefined :
-				case Clingo::WarningCode::RuntimeError       : level = fawkes::Logger::LL_ERROR; break;
-				case Clingo::WarningCode::Other              :
-				case Clingo::WarningCode::VariableUnbounded  : level = fawkes::Logger::LL_WARN;
-				case Clingo::WarningCode::FileIncluded       :
-				case Clingo::WarningCode::GlobalVariable     : level = fawkes::Logger::LL_INFO; break;
-			} //switch ( code )
-			Log->log(level, log_component_name.empty() ? "Clingo" : log_component_name.c_str(), msg);
-			return;
-		};
-	LockPtr<Clingo::Control> ctrl(new Clingo::Control({}, clingoLogger, 100));
+	Clingo::SymbolSpan s;
+	LockPtr<ClingoAccess> ctrl(new ClingoAccess(Log, log_component_name));
 
 	Controls.emplace(ctrl_name, ctrl);
 
@@ -111,12 +95,11 @@ ClingoControlManager::destroy_control(const std::string& ctrl_name)
 	return;
 }
 
-
 /**
  * Get map of controls.
  * @return The map from control name to control lock ptr.
  */
-const std::unordered_map<std::string, LockPtr<Clingo::Control>>&
+const std::unordered_map<std::string, LockPtr<ClingoAccess>>&
 ClingoControlManager::controls(void) const
 {
 	return Controls;
diff --git a/src/plugins/asp/aspect/clingo_control_manager.h b/src/plugins/asp/aspect/clingo_control_manager.h
index be16d12..fdc7cf4 100644
--- a/src/plugins/asp/aspect/clingo_control_manager.h
+++ b/src/plugins/asp/aspect/clingo_control_manager.h
@@ -26,22 +26,19 @@
 
 #include <unordered_map>
 
-namespace Clingo {
-	class Control;
-}
-
 namespace fawkes {
 #if 0 /* just to make Emacs auto-indent happy */
 }
 #endif
 
+class ClingoAccess;
 class Logger;
 
 class ClingoControlManager
 {
 	private:
 	Logger *Log;
-	std::unordered_map<std::string, LockPtr<Clingo::Control>> Controls;
+	std::unordered_map<std::string, LockPtr<ClingoAccess>> Controls;
 
 	public:
 	ClingoControlManager(void);
@@ -49,10 +46,10 @@ class ClingoControlManager
 
 	void setLogger(Logger *logger);
 
-	LockPtr<Clingo::Control> create_control(const std::string& ctrl_name, const std::string& log_component_name);
+	LockPtr<ClingoAccess> create_control(const std::string& ctrl_name, const std::string& log_component_name);
 	void destroy_control(const std::string& ctrl_name);
 
-	const std::unordered_map<std::string, LockPtr<Clingo::Control>>& controls(void) const;
+	const std::unordered_map<std::string, LockPtr<ClingoAccess>>& controls(void) const;
 };
 
 } // end namespace fawkes

- *commit* 1a65fac5858d004f250f7f8fb12eec4b18aa4ab9 - - - - - - - - - -
Author:  Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
Date:    Mon Oct 31 16:44:19 2016 +0100
Subject: ASP-Aspect: Use a different name for the member.

 src/plugins/asp/aspect/asp.cpp |    6 +++---
 src/plugins/asp/aspect/asp.h   |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/asp/aspect/asp.cpp b/src/plugins/asp/aspect/asp.cpp
index 5aee875..5b53228 100644
--- a/src/plugins/asp/aspect/asp.cpp
+++ b/src/plugins/asp/aspect/asp.cpp
@@ -42,7 +42,7 @@ namespace fawkes {
  * @property ASPAspect::LogComponent
  * @brief The component for the logger.
  *
- * @property ASPAspect::ClingoControl
+ * @property ASPAspect::ClingoAcc
  * @brief Clingo Control for exclusive usage.
  */
 
@@ -74,7 +74,7 @@ ASPAspect::~ASPAspect(void)
 void
 ASPAspect::init_ASPAspect(const LockPtr<ClingoAccess>& clingo)
 {
-	Clingo = clingo;
+	ClingoAcc = clingo;
 	return;
 }
 
@@ -84,7 +84,7 @@ ASPAspect::init_ASPAspect(const LockPtr<ClingoAccess>& clingo)
 void
 ASPAspect::finalize_ASPAspect(void)
 {
-	Clingo.clear();
+	ClingoAcc.clear();
 	return;
 }
 
diff --git a/src/plugins/asp/aspect/asp.h b/src/plugins/asp/aspect/asp.h
index e749f8a..c9885d1 100644
--- a/src/plugins/asp/aspect/asp.h
+++ b/src/plugins/asp/aspect/asp.h
@@ -46,7 +46,7 @@ class ASPAspect : public virtual Aspect
 	void finalize_ASPAspect(void);
 
 	protected:
-	LockPtr<ClingoAccess> Clingo;
+	LockPtr<ClingoAccess> ClingoAcc;
 
 	public:
 	ASPAspect(const std::string&& controlName, const std::string&& logComponent = std::string());

- *commit* 30df6e1ce34fe1d916bbe0b72aca5770da5d0c8f - - - - - - - - - -
Author:  Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
Date:    Mon Oct 31 17:04:05 2016 +0100
Subject: ASP-Aspect: Added external handling.

 src/plugins/asp/aspect/clingo_access.cpp |   55 ++++++++++++++++++++++++++++++
 src/plugins/asp/aspect/clingo_access.h   |    3 ++
 2 files changed, 58 insertions(+), 0 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/asp/aspect/clingo_access.cpp b/src/plugins/asp/aspect/clingo_access.cpp
index 5d7b822..fd4a60e 100644
--- a/src/plugins/asp/aspect/clingo_access.cpp
+++ b/src/plugins/asp/aspect/clingo_access.cpp
@@ -353,4 +353,59 @@ ClingoAccess::ground(const Clingo::PartSpan& parts)
 	return true;
 }
 
+/**
+ * @brief Assigns an external value.
+ * @param[in] atom The atom to assign.
+ * @param[in] value The assigned value.
+ * @return If it could be assigned.
+ */
+bool
+ClingoAccess::assign_external(const Clingo::Symbol atom, const Clingo::TruthValue value)
+{
+	MutexLocker locker(&ControlMutex);
+	if ( Solving )
+	{
+		return false;
+	} //if ( Solving )
+
+	if ( Debug )
+	{
+		Log->log_info(LogComponent.c_str(), "Assigning %s to %s.", [value](void)
+			{
+				const char *ret = "Unknown Value";
+				switch ( value )
+				{
+					case Clingo::TruthValue::Free  : ret = "Free";  break;
+					case Clingo::TruthValue::True  : ret = "True";  break;
+					case Clingo::TruthValue::False : ret = "False"; break;
+				} //switch ( value )
+				return ret;
+			}, atom.string());
+	} //if ( Debug )
+	Control.assign_external(atom, value);
+	return true;
+}
+
+/**
+ * @brief Releases an external value.
+ * @param[in] atom The atom to release.
+ * @return If it could be released.
+ */
+bool
+ClingoAccess::release_external(const Clingo::Symbol atom)
+{
+	MutexLocker locker(&ControlMutex);
+	if ( Solving )
+	{
+		return false;
+	} //if ( Solving )
+
+	if ( Debug )
+	{
+		Log->log_info(LogComponent.c_str(), "Releasing %s.", atom.string());
+	} //if ( Debug )
+	Control.release_external(atom);
+	return true;
+}
+
 } // end namespace fawkes
diff --git a/src/plugins/asp/aspect/clingo_access.h b/src/plugins/asp/aspect/clingo_access.h
index 6f6ed18..ebeb189 100644
--- a/src/plugins/asp/aspect/clingo_access.h
+++ b/src/plugins/asp/aspect/clingo_access.h
@@ -75,6 +75,9 @@ class ClingoAccess
 	bool loadFile(const std::string& path);
 
 	bool ground(const Clingo::PartSpan& parts);
+
+	bool assign_external(const Clingo::Symbol atom, const Clingo::TruthValue value);
+	bool release_external(const Clingo::Symbol atom);
 };
 
 } // end namespace fawkes

- *commit* ba11c03fde668bd4032f410d40207d8be5b57bff - - - - - - - - - -
Author:  Bjoern Schaepers <bjoern.schaepers at rwth-aachen.de>
Date:    Wed Nov 2 11:44:34 2016 +0100
Subject: ASP-Aspect: Add the asp plugin to the Makefile.

 src/plugins/Makefile |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/Makefile b/src/plugins/Makefile
index b0e0275..850ce5c 100644
--- a/src/plugins/Makefile
+++ b/src/plugins/Makefile
@@ -28,7 +28,8 @@ SUBDIRS	= bbsync bblogger webview ttmainloop rrd rrdweb \
 	  clips-tf openprs openprs-agent eclipse-clp \
 	  mongodb mongodb_log robot-memory clips-robot-memory pddl-robot-memory \
 	  openni refboxcomm ros player xmlrpc gossip \
-	  robot_state_publisher gazebo dynamixel navgraph-interactive
+	  robot_state_publisher gazebo dynamixel navgraph-interactive \
+	  asp
 
 include $(BUILDSYSDIR)/rules.mk
 




-- 
Fawkes Robotics Framework                 http://www.fawkesrobotics.org


More information about the fawkes-commits mailing list