Changes have been pushed for the repository "fawkesrobotics/fawkes".

Clone:  https://github.com/fawkesrobotics/fawkes.git
Gitweb: https://github.com/fawkesrobotics/fawkes

The branch, dswoboda/game-state-loading has been updated
  discards  e1915c5f3b59bee79c1ff62491e7d838211d68a5 (commit)
  discards  917429adb61cec0f21ec8517fba58dab320245d2 (commit)
  discards  e992ccb77e8a0d679f48ee79b4740ae6ab866f0f (commit)
  discards  879bc80bc45ede8ac46d9dc17da85db15e8bff3f (commit)
  discards  24419bed3fac5ee8fe7187f753f96ee37fd683ac (commit)
  discards  db4192bdeb8005c119b905ba92ddeb584009c5c0 (commit)
  discards  52a37b83737d91803a6dc1f34db3d591513e2c9d (commit)
  discards  f1b6fad2b0b9d5d9d13ab7f3ab685d66be8fdfc6 (commit)
  discards  c018158b8491bd1b7e52fbc469034ebc088fe23c (commit)
  discards  fcc16e80c9308f4ac41a16889f64ddf6d7ef9b4b (commit)
  discards  34ed069f98db9a211f508d479e40c13bfb193beb (commit)
  discards  105df432eb6b5d11480baa69810e71cd47aa6f9d (commit)
  discards  3f2b1dd312228cf64c866979462ee900791c14e6 (commit)
  discards  414003de9fd87309a60a19f7c3743d6b668a5e28 (commit)
  discards  9126e1e75387bfba1296edd358edf7e9406c0a0b (commit)
  discards  3ea36f19b6932904c28fad63db03375b6d79b7fd (commit)
  discards  de0fa1bbeb50aaf383d67ac36f4c728c2e877856 (commit)
  discards  a0cd56298cf834a2b0eb7c91058afd0e7f149bb7 (commit)
  discards  630e1e0047f24a082b5fabdf615300e9e29e3fc5 (commit)
  discards  3c8d49aebfff6a528d58e8d96e7d9e7ffb01e881 (commit)
  discards  a5112e3a53636b658e20214854487879d90c4bae (commit)
  discards  e7553a97a5d4d34a1a15a5ed5ea6e84c48406ca9 (commit)
  discards  46d4470b6fef75868e52b0df046f3bf528bc3c76 (commit)
  discards  f93aea1c086f9a0694852365c0402b4e4370657c (commit)
  discards  07357b1753aeb2a0f15eba14dc25956f43b0ae38 (commit)
  discards  10964703d82f013a568a87b3004f579fa02a3710 (commit)
  discards  c1802b6fc299b633922bb705c0733f0a350dad4f (commit)
  discards  8daa69d8ab28930d55fb9980bd9ec15fceee0eec (commit)
  discards  8314fd5932c762c4b3799dfb3e0e731d5de48155 (commit)
  discards  c7bc6ac95160cb1f64bdccb4adb45e6466a6c700 (commit)
  discards  1bd43472b9928186eec5a6a504dd2ee168d15c1d (commit)
  discards  4e6ced58061f6f1f5ccaad00c5f2a2a237460427 (commit)
  discards  4acbbd43d260280394378fa5922b8ee315490bf6 (commit)
  discards  41542385d92045953441af3658820c42d2254461 (commit)
  discards  8377bada9358fd21c6b0e6e8590f8800591c9d3d (commit)
        to  67dcb6983b724750993609027ad9b9c49f243563 (commit)
       via  7a047c089235c9db507140b5e510494fbd5b2640 (commit)
       via  65dff357971ac6817a3fa5670c677ead7656c372 (commit)
       via  3402bda6276c9b59e93a313e54838b69807ebb49 (commit)
       via  5f64c65341c655ad8cca7f67396e99cf2b6e4457 (commit)
       via  60322e730acd3d0ce13b129166356b8b826c2652 (commit)
       via  d9cbb7b7bd36968922fc323985a635bd1ad23449 (commit)
       via  3f8db455e88720ee3f1f57006ceab5057eceda68 (commit)
       via  bfaeff57fcc9a39ceefa5c604432fbde81886f4b (commit)
       via  23f675ce2ee9a05a88c127d804961d5023cd503e (commit)
       via  2d8024221efe6c9945994dcd6183db3002d250cd (commit)
       via  4b15adfd3973f87ed076433b2a0de86762c6a0b2 (commit)
       via  7bcf865ee77b4e98727fa057b133d9dc9686eda1 (commit)
       via  bb49eb8ab6c8ba355981178cf6de3f48b8a3fbda (commit)
       via  06aaecf0a477e5d7389f9a5ade2304fb8c971ce1 (commit)
       via  87163b94c240d95cd7949cf4e63e4bcb28a8f0f8 (commit)
       via  a6e3959aae46b6b06435b05f75b0ca16181e2fc0 (commit)
       via  abdd38c44f0f63873292aba54788e60cac2ee09b (commit)
       via  987ae26a95f79482e414acabd072ce3ec6c367bb (commit)
       via  4747873b6a27c3f408c9a9bd335a3791c48ab310 (commit)
       via  258ca2c4f0fa887104ff3719439051e5e59b95c6 (commit)
       via  3305eba65e931f3c9bac3ae2c16d87f76821ef2d (commit)
       via  029fa9298faa6c12a4a652957ee5ed9b56e178c9 (commit)
       via  68b0176765608f17f565172051d1ce1ee7c5a5b9 (commit)
       via  46e2cf4666440b65253b6546d2e31e8e29f9efce (commit)
       via  8ced7c0843b0a0d109f8222963c64d3343f0ee91 (commit)
       via  fa5032e05fd049be1c8950b31d12f2aa41a6410d (commit)
       via  771faba90d69a3119216a630ad2166d482694ff6 (commit)
       via  68cf09a2d066c426f57796bc9ecc496765a66f08 (commit)
       via  7ecfa844e069a9140bffe97228e7cbe43f1fd846 (commit)
       via  83fe1e9743f9a0bae754cca130d2dfa7f1433981 (commit)
       via  3f28a5a32db2385f0b52524ca0ec29d60f2b87a5 (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 (e1915c5f3b59bee79c1ff62491e7d838211d68a5)
            \
             N -- N -- N (67dcb6983b724750993609027ad9b9c49f243563)

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.

https://github.com/fawkesrobotics/fawkes/tree/dswoboda/game-state-loading

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 3f28a5a32db2385f0b52524ca0ec29d60f2b87a5
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Sun Oct 18 13:14:46 2020 +0200
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:37 2021 +0200

    reactivate mongodb_log plugin

https://github.com/fawkesrobotics/fawkes/commit/3f28a5a32

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 83fe1e9743f9a0bae754cca130d2dfa7f1433981
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Sat Oct 24 17:52:36 2020 +0200
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:37 2021 +0200

    mongodb_log: track world fact history in DB from logs
    
    track incoming log messages, detect domain fact asserations and
    retractions, log the content in a persistent mongodb database such that
    the world model at any time can be restored.

https://github.com/fawkesrobotics/fawkes/commit/83fe1e974

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 7ecfa844e069a9140bffe97228e7cbe43f1fd846
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Sun Oct 25 15:51:47 2020 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:37 2021 +0200

    mongodb_log: fix error in string parsing
    
    fix error that cut fact ids too short, leading to incomplete fact ids
    being stored in the database, causing update failures.

https://github.com/fawkesrobotics/fawkes/commit/7ecfa844e

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 68cf09a2d066c426f57796bc9ecc496765a66f08
Author:     Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
AuthorDate: Sun Aug 16 15:30:45 2020 +0200
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    webview: apply microhttpd interface changes

https://github.com/fawkesrobotics/fawkes/commit/68cf09a2d

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 771faba90d69a3119216a630ad2166d482694ff6
Author:     Till Hofmann <hofm...@kbsg.rwth-aachen.de>
AuthorDate: Sat Oct 10 00:42:47 2020 +0200
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    webview: fix type of upload_data_size for microhttpd
    
    The upload_data_size is not a long unsigned * but a size_t *. These are
    the same on x86_64, but not on i686.

https://github.com/fawkesrobotics/fawkes/commit/771faba90

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit fa5032e05fd049be1c8950b31d12f2aa41a6410d
Author:     Till Hofmann <hofm...@kbsg.rwth-aachen.de>
AuthorDate: Sat Oct 10 00:47:08 2020 +0200
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    webview: fix license header in microhttpd_compat header

https://github.com/fawkesrobotics/fawkes/commit/fa5032e05

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 8ced7c0843b0a0d109f8222963c64d3343f0ee91
Author:     Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
AuthorDate: Thu Oct 29 09:04:55 2020 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    robot-memory: properly require c++17
    
    The aspect belonging to robot-memory also requires c++ 17.

https://github.com/fawkesrobotics/fawkes/commit/8ced7c084

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 46e2cf4666440b65253b6546d2e31e8e29f9efce
Author:     Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
AuthorDate: Thu Oct 29 09:06:15 2020 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    robot-memory: implement aggregate
    
    This changes the function signature as mongodb uses dedicated pipeline
    objects for aggregation instead of general document views.
    
    Adaptions in all plugins using aggregate are required.

https://github.com/fawkesrobotics/fawkes/commit/46e2cf466

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 68b0176765608f17f565172051d1ce1ee7c5a5b9
Author:     Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
AuthorDate: Thu Oct 29 09:12:16 2020 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    pddl-planner: fix broken update queries
    
    Also use a basic builder instead of relying on more error prone
    from_json building.

https://github.com/fawkesrobotics/fawkes/commit/68b017676

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 029fa9298faa6c12a4a652957ee5ed9b56e178c9
Author:     Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
AuthorDate: Thu Oct 29 10:06:33 2020 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    pddl-robot-memory: adapt to mongocxx aggregate
    
    Also do some explicit type checks to generate more meaningful failures
    in case the aggregation returns unexpected results.

https://github.com/fawkesrobotics/fawkes/commit/029fa9298

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 3305eba65e931f3c9bac3ae2c16d87f76821ef2d
Author:     Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
AuthorDate: Thu Oct 29 10:09:35 2020 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    pddl-robot-memory: do not restrict pddl files to src/agents

https://github.com/fawkesrobotics/fawkes/commit/3305eba65

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 258ca2c4f0fa887104ff3719439051e5e59b95c6
Author:     Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
AuthorDate: Thu Oct 29 10:11:53 2020 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    pddl-robot-memory: properly fill dict from document

https://github.com/fawkesrobotics/fawkes/commit/258ca2c4f

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 4747873b6a27c3f408c9a9bd335a3791c48ab310
Author:     Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
AuthorDate: Thu Oct 29 10:14:21 2020 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    pddl-robot-memory: support int arrays and throw on unsupported type

https://github.com/fawkesrobotics/fawkes/commit/4747873b6

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 987ae26a95f79482e414acabd072ce3ec6c367bb
Author:     Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
AuthorDate: Thu Oct 29 10:55:23 2020 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    pddl-planner: use basic builder namespace

https://github.com/fawkesrobotics/fawkes/commit/987ae26a9

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit abdd38c44f0f63873292aba54788e60cac2ee09b
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Sun Nov 8 17:14:26 2020 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    mongodb_log: fix port
    
    originally the local port was used, replace with robot-memory-local port
    for robot 1, so that it can be access from CLIPS.

https://github.com/fawkesrobotics/fawkes/commit/abdd38c44

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit a6e3959aae46b6b06435b05f75b0ca16181e2fc0
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Sun Nov 8 17:26:32 2020 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    mongodb: add date object from iso 8601 string to bson doc
    
    mongodb uses ISO8601 UTC representation of time objects when a
    collection is viewed with a client. With this method, a bson date object
    can be created using that same representation in CLIPS. This supports
    user guided queries.

https://github.com/fawkesrobotics/fawkes/commit/a6e3959aa

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 87163b94c240d95cd7949cf4e63e4bcb28a8f0f8
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Sun Nov 8 17:29:07 2020 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    mongodb: add methods to perform aggregate queries in CLIPS
    
    RobotMemory supports aggregates using pipelines. Extend this
    functionality to ClipsRobotMemory, to allow pipeline based aggregate
    queries with match and projection to be created and executed from CLIPS.

https://github.com/fawkesrobotics/fawkes/commit/87163b94c

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 06aaecf0a477e5d7389f9a5ade2304fb8c971ce1
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Sun Nov 8 17:31:09 2020 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    cx: load a stored games tate from a mongodb collection
    
    given a game id (time) and point in time (time) create a query and
    projection on an aggregate to get the game state at the given timepoint
    in the game in a shared world-model like fact representation.

https://github.com/fawkesrobotics/fawkes/commit/06aaecf0a

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit bb49eb8ab6c8ba355981178cf6de3f48b8a3fbda
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Sun Nov 15 11:39:33 2020 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    cx: fix wrong return value in wm-robmem-load-from-storage

https://github.com/fawkesrobotics/fawkes/commit/bb49eb8ab

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 7bcf865ee77b4e98727fa057b133d9dc9686eda1
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Mon Dec 21 00:25:35 2020 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    mongodb_log: use gametime and clips id to update already saved facts
    
    previous version used only clips fact id, resulting in inconsistent
    updates across multiple robots since fact ids are unique, therefore use
    unique gametime as an additional match

https://github.com/fawkesrobotics/fawkes/commit/7bcf865ee

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 4b15adfd3973f87ed076433b2a0de86762c6a0b2
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Mon Dec 21 00:42:19 2020 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    cx: add missing check of modification wm-sync-domain-object-added
    
    modify without modification does not lead to a new fact pointer. Check
    if a new pointer was created before attempting to work with it.

https://github.com/fawkesrobotics/fawkes/commit/4b15adfd3

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 2d8024221efe6c9945994dcd6183db3002d250cd
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Wed Jan 20 19:35:33 2021 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    mongodb_log: set to log only on Icks

https://github.com/fawkesrobotics/fawkes/commit/2d8024221

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 23f675ce2ee9a05a88c127d804961d5023cd503e
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Wed Jan 27 13:48:43 2021 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    mongodb_log: add gamestate to logged data
    
    tracking when the gamestate is set to running allows better suggestions for 
the gamestate loading script.

https://github.com/fawkesrobotics/fawkes/commit/23f675ce2

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit bfaeff57fcc9a39ceefa5c604432fbde81886f4b
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Wed Jan 27 13:51:29 2021 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    mongodb_log: add rule firing to logged data
    
    monitor the firing of rules to provide better information for the gamestate 
loading script, as the states that are in the middle of a rule execution can be 
excluded, leading to less potential conflicts.

https://github.com/fawkesrobotics/fawkes/commit/bfaeff57f

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 3f8db455e88720ee3f1f57006ceab5057eceda68
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Thu Feb 18 23:04:12 2021 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    mongodb_log: fix bug that skipped last entry of values array
    
    the last entry of the values slot was ignored due to an oversight. Fixed
    now.

https://github.com/fawkesrobotics/fawkes/commit/3f8db455e

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit d9cbb7b7bd36968922fc323985a635bd1ad23449
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Thu Feb 18 23:05:09 2021 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    mongodb_log: add refbox and order facts to logging
    
    Previously only domain facts were logged. These do not contain enough
    information to generate a gamereport,therefore add refbox and order
    facts.

https://github.com/fawkesrobotics/fawkes/commit/d9cbb7b7b

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 60322e730acd3d0ce13b129166356b8b826c2652
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Thu Feb 18 23:06:10 2021 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    mongodb_log: add different categories for gamephase and gamestate
    
    previously gamephase and gamestate were treated as equals in the logging
    of phase changes, add categories to keep them apart.

https://github.com/fawkesrobotics/fawkes/commit/60322e730

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 5f64c65341c655ad8cca7f67396e99cf2b6e4457
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Wed Mar 24 16:03:28 2021 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    mongodb_log: add refbox/comm to tracked facts
    
    The facts in refboxx/comm are needed for complete gamestate restoration.
    Add these facts to the tracking list.

https://github.com/fawkesrobotics/fawkes/commit/5f64c6534

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 3402bda6276c9b59e93a313e54838b69807ebb49
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Wed Mar 24 16:04:15 2021 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    mongodb_log: fix broken retraction tracking
    
    Only retractions of /domain where monitored. Add the missing fact key
    prefixes of all the other tracked facts to ensure proper retraction
    tracking.

https://github.com/fawkesrobotics/fawkes/commit/3402bda62

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 65dff357971ac6817a3fa5670c677ead7656c372
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Sat Mar 27 20:11:14 2021 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    mongodb_log: switch to regex based comparison

https://github.com/fawkesrobotics/fawkes/commit/65dff3579

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 7a047c089235c9db507140b5e510494fbd5b2640
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Sat Mar 27 20:20:39 2021 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    mongodb_log: use variable for collection name

https://github.com/fawkesrobotics/fawkes/commit/7a047c089

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 67dcb6983b724750993609027ad9b9c49f243563
Author:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
AuthorDate: Sat Mar 27 20:34:45 2021 +0100
Commit:     Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
CommitDate: Sun Mar 28 14:58:52 2021 +0200

    mongodb_log: fix formatting

https://github.com/fawkesrobotics/fawkes/commit/67dcb6983

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


- *Summary* -----------------------------------------------------------


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

- *commit* 3f28a5a32db2385f0b52524ca0ec29d60f2b87a5 - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Sun Oct 18 13:14:46 2020 +0200
Subject: reactivate mongodb_log plugin

 .../mongodb_log/mongodb_log_logger_thread.cpp      | 171 ++++++++++-----------
 src/plugins/mongodb_log/mongodb_log_plugin.cpp     |  52 +------
 2 files changed, 86 insertions(+), 137 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
index 33bb1d32b..b71634bc3 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
@@ -27,6 +27,9 @@
 #include <bsoncxx/builder/basic/document.hpp>
 #include <mongocxx/client.hpp>
 #include <mongocxx/exception/operation_exception.hpp>
+#include <bsoncxx/json.hpp>
+
+#include <iostream>
 
 using namespace mongocxx;
 using namespace fawkes;
@@ -58,6 +61,8 @@ MongoLogLoggerThread::init()
 {
        database_   = 
config->get_string_or_default("/plugins/mongodb/logger/database", "fawkes");
        collection_ = 
config->get_string_or_default("/plugins/mongodb/logger/collection", "msglog");
+       mongocxx::uri uri("mongodb://localhost:27017");
+       mongodb_client = new mongocxx::client(uri);
 }
 
 void
@@ -76,16 +81,45 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
                                      const char *format,
                                      va_list     va)
 {
-       if (log_level <= ll) {
-               MutexLocker            lock(mutex_);
-               bsoncxx::types::b_date 
nowd{std::chrono::high_resolution_clock::now()};
+       MutexLocker            lock(mutex_);
+       bsoncxx::types::b_date nowd{std::chrono::high_resolution_clock::now()};
 
-               char *msg;
-               if (vasprintf(&msg, format, va) == -1) {
-                       // Cannot do anything useful, drop log message
-                       return;
-               }
+       char *msg;
+       if (vasprintf(&msg, format, va) == -1) {
+               // Cannot do anything useful, drop log message
+               return;
+       }
+
+
+       using namespace bsoncxx::builder;
+       basic::document b;
+       switch (ll) {
+       case LL_DEBUG: b.append(basic::kvp("level", "DEBUG")); break;
+       case LL_INFO: b.append(basic::kvp("level", "INFO")); break;
+       case LL_WARN: b.append(basic::kvp("level", "WARN")); break;
+       case LL_ERROR: b.append(basic::kvp("level", "ERROR")); break;
+       default: b.append(basic::kvp("level", "UNKN")); break;
+       }
 
+       b.append(basic::kvp("component", component));
+       b.append(basic::kvp("time", nowd));
+       b.append(basic::kvp("message", msg));
+       
+       free(msg);
+
+       try {
+               
mongodb_client->database(database_)[collection_].insert_one(b.view());
+       } catch (operation_exception &e) {
+       } // ignored
+}
+
+void
+MongoLogLoggerThread::insert_message(LogLevel ll, const char *component, 
Exception &e)
+{
+       MutexLocker            lock(mutex_);
+       bsoncxx::types::b_date nowd{std::chrono::high_resolution_clock::now()};
+
+       for (Exception::iterator i = e.begin(); i != e.end(); ++i) {
                using namespace bsoncxx::builder;
                basic::document b;
                switch (ll) {
@@ -97,10 +131,7 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
                }
                b.append(basic::kvp("component", component));
                b.append(basic::kvp("time", nowd));
-               b.append(basic::kvp("message", msg));
-
-               free(msg);
-
+               b.append(basic::kvp("message", std::string("[EXCEPTION] ") + 
*i));
                try {
                        
mongodb_client->database(database_)[collection_].insert_one(b.view());
                } catch (operation_exception &e) {
@@ -109,34 +140,6 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
 }
 
 void
-MongoLogLoggerThread::insert_message(LogLevel ll, const char *component, 
Exception &e)
-{
-       if (log_level <= ll) {
-               MutexLocker            lock(mutex_);
-               bsoncxx::types::b_date 
nowd{std::chrono::high_resolution_clock::now()};
-
-               for (Exception::iterator i = e.begin(); i != e.end(); ++i) {
-                       using namespace bsoncxx::builder;
-                       basic::document b;
-                       switch (ll) {
-                       case LL_DEBUG: b.append(basic::kvp("level", "DEBUG")); 
break;
-                       case LL_INFO: b.append(basic::kvp("level", "INFO")); 
break;
-                       case LL_WARN: b.append(basic::kvp("level", "WARN")); 
break;
-                       case LL_ERROR: b.append(basic::kvp("level", "ERROR")); 
break;
-                       default: b.append(basic::kvp("level", "UNKN")); break;
-                       }
-                       b.append(basic::kvp("component", component));
-                       b.append(basic::kvp("time", nowd));
-                       b.append(basic::kvp("message", std::string("[EXCEPTION] 
") + *i));
-                       try {
-                               
mongodb_client->database(database_)[collection_].insert_one(b.view());
-                       } catch (operation_exception &e) {
-                       } // ignored
-               }
-       }
-}
-
-void
 MongoLogLoggerThread::vlog_debug(const char *component, const char *format, 
va_list va)
 {
        insert_message(LL_DEBUG, component, format, va);
@@ -227,17 +230,49 @@ MongoLogLoggerThread::tlog_insert_message(LogLevel        
ll,
                                           const char *    format,
                                           va_list         va)
 {
-       if (log_level <= ll) {
-               MutexLocker lock(mutex_);
-               char *      msg;
-               if (vasprintf(&msg, format, va) == -1) {
-                       return;
-               }
+       MutexLocker lock(mutex_);
+       char *      msg;
+       if (vasprintf(&msg, format, va) == -1) {
+               return;
+       }
+
+       bsoncxx::types::b_date nowd{
+               std::chrono::time_point<std::chrono::system_clock, 
std::chrono::milliseconds>{
+               std::chrono::milliseconds{t->tv_sec * 1000 + t->tv_usec / 
1000}}};
+
+       using namespace bsoncxx::builder;
+       basic::document b;
+       switch (ll) {
+       case LL_DEBUG: b.append(basic::kvp("level", "DEBUG")); break;
+       case LL_INFO: b.append(basic::kvp("level", "INFO")); break;
+       case LL_WARN: b.append(basic::kvp("level", "WARN")); break;
+       case LL_ERROR: b.append(basic::kvp("level", "ERROR")); break;
+       default: b.append(basic::kvp("level", "UNKN")); break;
+       }
+       b.append(basic::kvp("component", component));
+       b.append(basic::kvp("time", nowd));
+       b.append(basic::kvp("message", msg));
+       try {
+               
mongodb_client->database(database_)[collection_].insert_one(b.view());
+       } catch (operation_exception &e) {
+       } // ignored
 
-               bsoncxx::types::b_date nowd{
-                 std::chrono::time_point<std::chrono::system_clock, 
std::chrono::milliseconds>{
-                   std::chrono::milliseconds{t->tv_sec * 1000 + t->tv_usec / 
1000}}};
+       free(msg);
 
+       mutex_->unlock();
+}
+
+void
+MongoLogLoggerThread::tlog_insert_message(LogLevel        ll,
+                                          struct timeval *t,
+                                          const char *    component,
+                                          Exception &     e)
+{
+       MutexLocker            lock(mutex_);
+       bsoncxx::types::b_date nowd{
+               std::chrono::time_point<std::chrono::system_clock, 
std::chrono::milliseconds>{
+               std::chrono::milliseconds{t->tv_sec * 1000 + t->tv_usec / 
1000}}};
+       for (Exception::iterator i = e.begin(); i != e.end(); ++i) {
                using namespace bsoncxx::builder;
                basic::document b;
                switch (ll) {
@@ -249,47 +284,11 @@ MongoLogLoggerThread::tlog_insert_message(LogLevel        
ll,
                }
                b.append(basic::kvp("component", component));
                b.append(basic::kvp("time", nowd));
-               b.append(basic::kvp("message", msg));
+               b.append(basic::kvp("message", std::string("[EXCEPTION] ") + 
*i));
                try {
                        
mongodb_client->database(database_)[collection_].insert_one(b.view());
                } catch (operation_exception &e) {
                } // ignored
-
-               free(msg);
-
-               mutex_->unlock();
-       }
-}
-
-void
-MongoLogLoggerThread::tlog_insert_message(LogLevel        ll,
-                                          struct timeval *t,
-                                          const char *    component,
-                                          Exception &     e)
-{
-       if (log_level <= ll) {
-               MutexLocker            lock(mutex_);
-               bsoncxx::types::b_date nowd{
-                 std::chrono::time_point<std::chrono::system_clock, 
std::chrono::milliseconds>{
-                   std::chrono::milliseconds{t->tv_sec * 1000 + t->tv_usec / 
1000}}};
-               for (Exception::iterator i = e.begin(); i != e.end(); ++i) {
-                       using namespace bsoncxx::builder;
-                       basic::document b;
-                       switch (ll) {
-                       case LL_DEBUG: b.append(basic::kvp("level", "DEBUG")); 
break;
-                       case LL_INFO: b.append(basic::kvp("level", "INFO")); 
break;
-                       case LL_WARN: b.append(basic::kvp("level", "WARN")); 
break;
-                       case LL_ERROR: b.append(basic::kvp("level", "ERROR")); 
break;
-                       default: b.append(basic::kvp("level", "UNKN")); break;
-                       }
-                       b.append(basic::kvp("component", component));
-                       b.append(basic::kvp("time", nowd));
-                       b.append(basic::kvp("message", std::string("[EXCEPTION] 
") + *i));
-                       try {
-                               
mongodb_client->database(database_)[collection_].insert_one(b.view());
-                       } catch (operation_exception &e) {
-                       } // ignored
-               }
        }
 }
 
diff --git a/src/plugins/mongodb_log/mongodb_log_plugin.cpp 
b/src/plugins/mongodb_log/mongodb_log_plugin.cpp
index 3df58e6a2..97bf5fba5 100644
--- a/src/plugins/mongodb_log/mongodb_log_plugin.cpp
+++ b/src/plugins/mongodb_log/mongodb_log_plugin.cpp
@@ -42,57 +42,7 @@ public:
    */
        explicit MongoLogPlugin(Configuration *config) : Plugin(config)
        {
-               bool enable_bb = true;
-               try {
-                       enable_bb = 
config->get_bool("/plugins/mongodb-log/enable-blackboard");
-               } catch (Exception &e) {
-               }
-               if (enable_bb) {
-                       thread_list.push_back(new MongoLogBlackboardThread());
-               }
-
-               bool enable_pcls = true;
-               try {
-                       enable_pcls = 
config->get_bool("/plugins/mongodb-log/enable-pointclouds");
-               } catch (Exception &e) {
-               }
-               if (enable_pcls) {
-                       thread_list.push_back(new MongoLogPointCloudThread());
-               }
-
-               bool enable_images = true;
-               try {
-                       enable_images = 
config->get_bool("/plugins/mongodb-log/enable-images");
-               } catch (Exception &e) {
-               }
-               if (enable_images) {
-                       thread_list.push_back(new MongoLogImagesThread());
-               }
-
-               bool enable_logger = true;
-               try {
-                       enable_logger = 
config->get_bool("/plugins/mongodb-log/enable-logger");
-               } catch (Exception &e) {
-               }
-               if (enable_logger) {
-                       thread_list.push_back(new MongoLogLoggerThread());
-               }
-
-               bool enable_tf = true;
-               try {
-                       enable_tf = 
config->get_bool("/plugins/mongodb-log/enable-transforms");
-               } catch (Exception &e) {
-               }
-               if (enable_tf) {
-                       thread_list.push_back(new MongoLogTransformsThread());
-               }
-
-               if (thread_list.empty()) {
-                       throw Exception("MongoLogPlugin: no logging thread 
enabled");
-               }
-
-               std::string database = 
config->get_string("/plugins/mongodb-log/database");
-               config->set_string("/plugins/mongorrd/databases/mongodb-log", 
database);
+               thread_list.push_back(new MongoLogLoggerThread());
        }
 
        ~MongoLogPlugin()

- *commit* 83fe1e9743f9a0bae754cca130d2dfa7f1433981 - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Sat Oct 24 17:52:36 2020 +0200
Subject: mongodb_log: track world fact history in DB from logs

 .../mongodb_log/mongodb_log_logger_thread.cpp      | 92 +++++++++++++++++++---
 .../mongodb_log/mongodb_log_logger_thread.h        |  7 +-
 2 files changed, 86 insertions(+), 13 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
index b71634bc3..11ae6f337 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
@@ -4,6 +4,7 @@
  *
  *  Created: Tue Dec 07 22:59:47 2010
  *  Copyright  2006-2017  Tim Niemueller [www.niemueller.de]
+ *             2020       Daniel Swoboda [swob...@kbsg.rwth-aachen.de]
  ****************************************************************************/
 
 /*  This program is free software; you can redistribute it and/or modify
@@ -24,16 +25,23 @@
 #include <core/threading/mutex.h>
 #include <core/threading/mutex_locker.h>
 
+#include <bsoncxx/builder/basic/array.hpp>
 #include <bsoncxx/builder/basic/document.hpp>
-#include <mongocxx/client.hpp>
-#include <mongocxx/exception/operation_exception.hpp>
+#include <bsoncxx/builder/basic/kvp.hpp>
 #include <bsoncxx/json.hpp>
-
 #include <iostream>
+#include <mongocxx/client.hpp>
+#include <mongocxx/exception/operation_exception.hpp>
+#include <mongocxx/instance.hpp>
+#include <mongocxx/options/find.hpp>
+#include <mongocxx/uri.hpp>
 
 using namespace mongocxx;
 using namespace fawkes;
 
+using bsoncxx::builder::basic::kvp;
+using bsoncxx::builder::basic::make_document;
+
 /** @class MongoLogLoggerThread "mongodb_log_logger_thread.h"
  * Thread that provides a logger writing to MongoDB.
  * This thread provides a logger, which writes log information to a
@@ -90,7 +98,6 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
                return;
        }
 
-
        using namespace bsoncxx::builder;
        basic::document b;
        switch (ll) {
@@ -104,13 +111,78 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
        b.append(basic::kvp("component", component));
        b.append(basic::kvp("time", nowd));
        b.append(basic::kvp("message", msg));
-       
-       free(msg);
+       b.append(basic::kvp("game", gametime_));
 
        try {
                
mongodb_client->database(database_)[collection_].insert_one(b.view());
        } catch (operation_exception &e) {
        } // ignored
+
+       std::string msg_s(msg);
+
+       //track assertion
+       if (msg_s.find("(wm-fact (id \"/domain/") != std::string::npos
+           && msg_s.find("==>") != std::string::npos) {
+               basic::document df;
+               basic::document dfc;
+               df.append(
+                 basic::kvp("id",
+                            msg_s.substr(msg_s.find("(id \"") + 5,
+                                         msg_s.find("\")") - msg_s.find("(id 
\"") - 5)));
+               df.append(basic::kvp(
+                 "is-list",
+                 msg_s.substr(msg_s.find("(is-list ") + 9)
+                   .substr(0, msg_s.substr(msg_s.find("(is-list ") + 
9).find(")")))); 
+               df.append(basic::kvp("source",
+                                    
config->get_string_or_default("fawkes/agent/name", "UNKN"))); 
+               df.append(
+                 basic::kvp("type",
+                            msg_s.substr(msg_s.find("(type ") + 6)
+                              .substr(0,
+                                      msg_s.substr(msg_s.find("(type ") + 
6).find(")")))); 
+               if (msg_s.substr(msg_s.find("(is-list ") + 9)
+                     .substr(0, msg_s.substr(msg_s.find("(is-list ") + 
9).find(")"))
+                   == "TRUE") {
+                       auto array_builder = basic::array{};
+
+                       std::string values_string = 
msg_s.substr(msg_s.find("(values") + 8)
+                                                     .substr(0, 
msg_s.substr(msg_s.find("(values") + 8).find(")"));
+
+                       size_t      pos = 0;
+                       std::string token;
+                       while ((pos = values_string.find(" ")) != 
std::string::npos) {
+                               token = values_string.substr(0, pos);
+                               array_builder.append(token);
+                               values_string.erase(0, pos + 1);
+                       }
+                       df.append(basic::kvp("values", 
array_builder.extract()));
+               } else {
+                       df.append(basic::kvp("value",
+                                            msg_s.substr(msg_s.find("(value ") 
+ 7)
+                                              .substr(0, 
msg_s.substr(msg_s.find("(value ") + 7).find(")"))));
+               }
+               df.append(basic::kvp("update-timestamp", nowd));
+
+               dfc.append(basic::kvp("game", gametime_));
+               dfc.append(basic::kvp("asserted", nowd));
+               dfc.append(basic::kvp("retracted", "FALSE"));
+               dfc.append(basic::kvp("fact", df));
+               dfc.append(basic::kvp("msg", msg_s));
+               dfc.append(
+                 basic::kvp("clips-id", msg_s.substr(msg_s.find("==> ") + 
4).substr(0, msg_s.find("(") - 6)));
+               
mongodb_client->database(database_)["gamestate_recovery_test"].insert_one(dfc.view());
+       }
+
+       //track retraction
+       if (msg_s.find("(wm-fact (id \"/domain/") != std::string::npos
+           && msg_s.find("<==") != std::string::npos) {
+               std::string clips_id = msg_s.substr(msg_s.find("<== ") + 
4).substr(0, msg_s.find("(") - 6);
+
+               
mongodb_client->database(database_)["gamestate_recovery_test"].update_one(
+                 make_document(kvp("clips-id", clips_id)),
+                 make_document(kvp("$set", make_document(kvp("retracted", 
nowd)))));
+       }
+       free(msg);
 }
 
 void
@@ -237,8 +309,8 @@ MongoLogLoggerThread::tlog_insert_message(LogLevel        
ll,
        }
 
        bsoncxx::types::b_date nowd{
-               std::chrono::time_point<std::chrono::system_clock, 
std::chrono::milliseconds>{
-               std::chrono::milliseconds{t->tv_sec * 1000 + t->tv_usec / 
1000}}};
+         std::chrono::time_point<std::chrono::system_clock, 
std::chrono::milliseconds>{
+           std::chrono::milliseconds{t->tv_sec * 1000 + t->tv_usec / 1000}}};
 
        using namespace bsoncxx::builder;
        basic::document b;
@@ -270,8 +342,8 @@ MongoLogLoggerThread::tlog_insert_message(LogLevel        
ll,
 {
        MutexLocker            lock(mutex_);
        bsoncxx::types::b_date nowd{
-               std::chrono::time_point<std::chrono::system_clock, 
std::chrono::milliseconds>{
-               std::chrono::milliseconds{t->tv_sec * 1000 + t->tv_usec / 
1000}}};
+         std::chrono::time_point<std::chrono::system_clock, 
std::chrono::milliseconds>{
+           std::chrono::milliseconds{t->tv_sec * 1000 + t->tv_usec / 1000}}};
        for (Exception::iterator i = e.begin(); i != e.end(); ++i) {
                using namespace bsoncxx::builder;
                basic::document b;
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.h 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.h
index 4082c9eaf..b8445739d 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.h
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.h
@@ -104,9 +104,10 @@ private:
        tlog_insert_message(LogLevel ll, struct timeval *t, const char 
*component, fawkes::Exception &);
 
 private:
-       std::string    database_;
-       std::string    collection_;
-       fawkes::Mutex *mutex_;
+       std::string            database_;
+       std::string            collection_;
+       bsoncxx::types::b_date 
gametime_{std::chrono::high_resolution_clock::now()};
+       fawkes::Mutex *        mutex_;
 };
 
 #endif

- *commit* 7ecfa844e069a9140bffe97228e7cbe43f1fd846 - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Sun Oct 25 15:51:47 2020 +0100
Subject: mongodb_log: fix error in string parsing

 src/plugins/mongodb_log/mongodb_log_logger_thread.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
index 11ae6f337..43157d852 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
@@ -169,14 +169,14 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
                dfc.append(basic::kvp("fact", df));
                dfc.append(basic::kvp("msg", msg_s));
                dfc.append(
-                 basic::kvp("clips-id", msg_s.substr(msg_s.find("==> ") + 
4).substr(0, msg_s.find("(") - 6)));
+                 basic::kvp("clips-id", msg_s.substr(msg_s.find("==> ") + 
4).substr(0, msg_s.find("(") - 5)));
                
mongodb_client->database(database_)["gamestate_recovery_test"].insert_one(dfc.view());
        }
 
        //track retraction
        if (msg_s.find("(wm-fact (id \"/domain/") != std::string::npos
            && msg_s.find("<==") != std::string::npos) {
-               std::string clips_id = msg_s.substr(msg_s.find("<== ") + 
4).substr(0, msg_s.find("(") - 6);
+               std::string clips_id = msg_s.substr(msg_s.find("<== ") + 
4).substr(0, msg_s.find("(") - 5);
 
                
mongodb_client->database(database_)["gamestate_recovery_test"].update_one(
                  make_document(kvp("clips-id", clips_id)),

- *commit* 68cf09a2d066c426f57796bc9ecc496765a66f08 - - - - - - - - - -
Author:  Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
Date:    Sun Aug 16 15:30:45 2020 +0200
Subject: webview: apply microhttpd interface changes

 src/libs/webview/microhttpd_compat.h    | 14 +-------------
 src/libs/webview/request_dispatcher.cpp |  2 +-
 src/libs/webview/request_dispatcher.h   |  2 +-
 3 files changed, 3 insertions(+), 15 deletions(-)

_Diff for modified files_:
diff --git a/src/libs/webview/microhttpd_compat.h 
b/src/libs/webview/microhttpd_compat.h
index 1776ccaf4..d84896a82 100644
--- a/src/libs/webview/microhttpd_compat.h
+++ b/src/libs/webview/microhttpd_compat.h
@@ -2,19 +2,7 @@
  * microhttpd_compat.h
  * Copyright (C) 2020 Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
  *
- */
-
-/*  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  Read the full text in the LICENSE.GPL file in the doc directory.
+ * Distributed under terms of the MIT license.
  */
 
 #ifndef MICROHTTPD_COMPAT_H
diff --git a/src/libs/webview/request_dispatcher.cpp 
b/src/libs/webview/request_dispatcher.cpp
index 1e5baf1d7..2d74732ff 100644
--- a/src/libs/webview/request_dispatcher.cpp
+++ b/src/libs/webview/request_dispatcher.cpp
@@ -170,7 +170,7 @@ WebRequestDispatcher::process_request_cb(void *             
    callback_data,
                                          const char *           method,
                                          const char *           version,
                                          const char *           upload_data,
-                                         size_t *               
upload_data_size,
+                                         long unsigned int *    
upload_data_size,
                                          void **                session_data)
 {
        WebRequestDispatcher *rd = static_cast<WebRequestDispatcher 
*>(callback_data);
diff --git a/src/libs/webview/request_dispatcher.h 
b/src/libs/webview/request_dispatcher.h
index 949d005b7..a5a341541 100644
--- a/src/libs/webview/request_dispatcher.h
+++ b/src/libs/webview/request_dispatcher.h
@@ -59,7 +59,7 @@ public:
                                             const char *           method,
                                             const char *           version,
                                             const char *           upload_data,
-                                            size_t *               
upload_data_size,
+                                            long unsigned int *    
upload_data_size,
                                             void **                
session_data);
 
        static void request_completed_cb(void *                          cls,

- *commit* 771faba90d69a3119216a630ad2166d482694ff6 - - - - - - - - - -
Author:  Till Hofmann <hofm...@kbsg.rwth-aachen.de>
Date:    Sat Oct 10 00:42:47 2020 +0200
Subject: webview: fix type of upload_data_size for microhttpd

 src/libs/webview/request_dispatcher.cpp | 2 +-
 src/libs/webview/request_dispatcher.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

_Diff for modified files_:
diff --git a/src/libs/webview/request_dispatcher.cpp 
b/src/libs/webview/request_dispatcher.cpp
index 2d74732ff..1e5baf1d7 100644
--- a/src/libs/webview/request_dispatcher.cpp
+++ b/src/libs/webview/request_dispatcher.cpp
@@ -170,7 +170,7 @@ WebRequestDispatcher::process_request_cb(void *             
    callback_data,
                                          const char *           method,
                                          const char *           version,
                                          const char *           upload_data,
-                                         long unsigned int *    
upload_data_size,
+                                         size_t *               
upload_data_size,
                                          void **                session_data)
 {
        WebRequestDispatcher *rd = static_cast<WebRequestDispatcher 
*>(callback_data);
diff --git a/src/libs/webview/request_dispatcher.h 
b/src/libs/webview/request_dispatcher.h
index a5a341541..949d005b7 100644
--- a/src/libs/webview/request_dispatcher.h
+++ b/src/libs/webview/request_dispatcher.h
@@ -59,7 +59,7 @@ public:
                                             const char *           method,
                                             const char *           version,
                                             const char *           upload_data,
-                                            long unsigned int *    
upload_data_size,
+                                            size_t *               
upload_data_size,
                                             void **                
session_data);
 
        static void request_completed_cb(void *                          cls,

- *commit* fa5032e05fd049be1c8950b31d12f2aa41a6410d - - - - - - - - - -
Author:  Till Hofmann <hofm...@kbsg.rwth-aachen.de>
Date:    Sat Oct 10 00:47:08 2020 +0200
Subject: webview: fix license header in microhttpd_compat header

 src/libs/webview/microhttpd_compat.h | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

_Diff for modified files_:
diff --git a/src/libs/webview/microhttpd_compat.h 
b/src/libs/webview/microhttpd_compat.h
index d84896a82..1776ccaf4 100644
--- a/src/libs/webview/microhttpd_compat.h
+++ b/src/libs/webview/microhttpd_compat.h
@@ -2,7 +2,19 @@
  * microhttpd_compat.h
  * Copyright (C) 2020 Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
  *
- * Distributed under terms of the MIT license.
+ */
+
+/*  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  Read the full text in the LICENSE.GPL file in the doc directory.
  */
 
 #ifndef MICROHTTPD_COMPAT_H

- *commit* 8ced7c0843b0a0d109f8222963c64d3343f0ee91 - - - - - - - - - -
Author:  Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
Date:    Thu Oct 29 09:04:55 2020 +0100
Subject: robot-memory: properly require c++17

 src/plugins/robot-memory/Makefile         |  2 +-
 src/plugins/robot-memory/aspect/Makefile  | 11 +++++---
 src/plugins/robot-memory/robot_memory.cpp | 43 -------------------------------
 3 files changed, 9 insertions(+), 47 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/robot-memory/Makefile 
b/src/plugins/robot-memory/Makefile
index 02f86e0af..16eeb6bc9 100644
--- a/src/plugins/robot-memory/Makefile
+++ b/src/plugins/robot-memory/Makefile
@@ -61,7 +61,7 @@ all: $(WARN_TARGETS)
 
 .PHONY: warning_cpp17 warning_mongodb warning_tf warning_ubuntu
 warning_cpp17:
-       $(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting RobotMemory 
Plugin$(TNORMAL) (C++11 required)"
+       $(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting RobotMemory 
Plugin$(TNORMAL) (C++17 required)"
 warning_mongodb:
        $(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting RobotMemory 
Plugin$(TNORMAL) (mongodb[-devel] not installed)"
 warning_tf:
diff --git a/src/plugins/robot-memory/aspect/Makefile 
b/src/plugins/robot-memory/aspect/Makefile
index 6298bd672..d56083d71 100644
--- a/src/plugins/robot-memory/aspect/Makefile
+++ b/src/plugins/robot-memory/aspect/Makefile
@@ -25,8 +25,8 @@ OBJS_libfawkesrobotmemory = $(patsubst %.cpp,%.o,$(patsubst 
qa/%,,$(subst $(SRCD
 OBJS_all = $(OBJS_libfawkesrobotmemory)
 LIBS_all = $(LIBDIR)/libfawkesrobotmemory.so
 
-ifeq ($(HAVE_MONGODB),1)
-  CFLAGS  += $(CFLAGS_MONGODB)
+ifeq ($(HAVE_MONGODB)$(HAVE_CPP17),11)
+  CFLAGS += $(CFLAGS_MONGODB) $(CFLAGS_CPP17)
   LDFLAGS += $(LDFLAGS_MONGODB)
 
   LIBS_build = $(LIBS_all)
@@ -34,14 +34,19 @@ else
   ifneq ($(HAVE_MONGODB),1)
     WARN_TARGETS += warning_mongodb
   endif
+  ifneq ($(HAVE_CPP17),1)
+    WARN_TARGETS += warning_cpp17
+  endif
 endif
 
 ifeq ($(OBJSSUBMAKE),1)
 all: $(WARN_TARGETS)
 
-.PHONY: warning_mongodb
+.PHONY: warning_mongodb warning_cpp17
 warning_mongodb:
        $(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting 
RobotMemoryAspect$(TNORMAL) (mongodb[-devel] not installed)"
+warning_cpp17:
+       $(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting 
RobotMemoryAspect$(TNORMAL) (C++17 required)"
 endif
 
 include $(BUILDSYSDIR)/base.mk
diff --git a/src/plugins/robot-memory/robot_memory.cpp 
b/src/plugins/robot-memory/robot_memory.cpp
index 9a45ddeb8..45483a1bc 100644
--- a/src/plugins/robot-memory/robot_memory.cpp
+++ b/src/plugins/robot-memory/robot_memory.cpp
@@ -200,49 +200,6 @@ RobotMemory::query(document::view          query,
 }
 
 /**
- * Aggregation call on the robot memory.
- * @param pipeline Series of commands defining the aggregation
- * @param collection The database and collection to query as string (e.g. 
robmem.worldmodel)
- * @return Result object
- */
-bsoncxx::document::value
-RobotMemory::aggregate(const std::vector<bsoncxx::document::view> &pipeline,
-                       const std::string &                         collection)
-{
-       /*
-  client *mongodb_client = get_mongodb_client(collection);
-       log_deb(std::string("Executing Aggregation on collection " + 
collection));
-
-       //TODO: check if computation on demand is necessary and execute 
Computables
-       // that might be complicated because you need to build a query to check 
against from the fields mentioned in the different parts of the pipeline
-       // A possible solution might be forcing the user to define the $match 
oject seperately and using it as query to check computables
-
-       //lock (mongo_client not thread safe)
-       MutexLocker lock(mutex_);
-
-       //actually execute aggregation as command (in more modern mongo-cxx 
versions there should be an easier way with a proper aggregate function)
-       BSONObj res;
-       //get db and collection name
-       size_t point_pos = collection.find(".");
-       if (point_pos == std::string::npos) {
-               logger_->log_error(name_, "Collection %s needs to start with 
'dbname.'", collection.c_str());
-               return fromjson("{}");
-       }
-       std::string db  = collection.substr(0, point_pos);
-       std::string col = collection.substr(point_pos + 1);
-       try {
-               mongodb_client->runCommand(db, BSON("aggregate" << col << 
"pipeline" << pipeline), res);
-       } catch (DBException &e) {
-               std::string error = std::string("Error for aggregation ") + "\n 
Exception: " + e.toString();
-               log(error, "error");
-               return fromjson("{}");
-       }
-       return res;
-  */
-       throw Exception("Not implemented");
-}
-
-/**
  * Inserts a document into the robot memory
  * @param doc A view of the document to insert
  * @param collection_name The database and collection to use as string (e.g. 
robmem.worldmodel)

- *commit* 46e2cf4666440b65253b6546d2e31e8e29f9efce - - - - - - - - - -
Author:  Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
Date:    Thu Oct 29 09:06:15 2020 +0100
Subject: robot-memory: implement aggregate

 src/plugins/robot-memory/robot_memory.cpp | 30 +++++++++++++-----------------
 src/plugins/robot-memory/robot_memory.h   | 10 ++++------
 2 files changed, 17 insertions(+), 23 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/robot-memory/robot_memory.cpp 
b/src/plugins/robot-memory/robot_memory.cpp
index 45483a1bc..c7db2191c 100644
--- a/src/plugins/robot-memory/robot_memory.cpp
+++ b/src/plugins/robot-memory/robot_memory.cpp
@@ -453,30 +453,26 @@ RobotMemory::mapreduce(const bsoncxx::document::view 
&query,
 /**
  * Performs an aggregation operation on the robot memory 
(https://docs.mongodb.com/v3.2/reference/method/db.collection.aggregate/)
  * @param pipeline A sequence of data aggregation operations or stages. See 
the https://docs.mongodb.com/v3.2/reference/operator/aggregation-pipeline/ for 
details
- * @param collection The database and collection to use as string (e.g. 
robmem.worldmodel)
+ * @param collection_name The database and collection to use as string (e.g. 
robmem.worldmodel)
  * @return Cursor to get the documents from, NULL for invalid pipeline
  */
 cursor
-RobotMemory::aggregate(bsoncxx::document::view pipeline, const std::string 
&collection)
+RobotMemory::aggregate(mongocxx::pipeline &pipeline, const std::string 
&collection_name)
 {
-       throw Exception("Not implemented");
-       /**
-       mongo::DBClientBase *mongodb_client = get_mongodb_client(collection);
-       MutexLocker          lock(mutex_);
-       log_deb(std::string("Executing Aggregation pipeline: " + 
pipeline.toString() + " on collection "
-                           + collection));
-
-       QResCursor cursor;
+       collection collection = get_collection(collection_name);
+       log_deb(std::string("Aggregating in collection " + collection_name));
+       //lock (mongo_client not thread safe)
+       MutexLocker lock(mutex_);
+       //actually execute aggregate
        try {
-               cursor = mongodb_client->aggregate(collection, pipeline);
-       } catch (DBException &e) {
+               return collection.aggregate(pipeline, 
mongocxx::options::aggregate{});
+       } catch (operation_exception &e) {
                std::string error =
-                 std::string("Error for query ") + pipeline.toString() + "\n 
Exception: " + e.toString();
-               log(error, "error");
-               return NULL;
+                 std::string("Error when aggregating " + 
to_json(pipeline.view_array()) + "\n Exception: ")
+                 + e.what();
+               log_deb(error, "error");
+               throw;
        }
-       return cursor;
-  */
 }
 
 /**
diff --git a/src/plugins/robot-memory/robot_memory.h 
b/src/plugins/robot-memory/robot_memory.h
index 279d438d7..170d11d8c 100644
--- a/src/plugins/robot-memory/robot_memory.h
+++ b/src/plugins/robot-memory/robot_memory.h
@@ -57,11 +57,9 @@ public:
        virtual ~RobotMemory();
 
        //robot memory functions
-       mongocxx::cursor         query(bsoncxx::document::view query,
-                                      const std::string &     collection_name 
= "",
-                                      mongocxx::options::find query_options = 
mongocxx::options::find());
-       bsoncxx::document::value aggregate(const 
std::vector<bsoncxx::document::view> &pipeline,
-                                          const std::string &                  
       collection = "");
+       mongocxx::cursor query(bsoncxx::document::view query,
+                              const std::string &     collection_name = "",
+                              mongocxx::options::find query_options   = 
mongocxx::options::find());
        // TODO fix int return codes, should be booleans
        int insert(bsoncxx::document::view, const std::string &collection = "");
        int insert(std::vector<bsoncxx::document::view> v_obj, const 
std::string &collection = "");
@@ -84,7 +82,7 @@ public:
                                           const std::string &            
collection,
                                           const std::string &            
js_map_fun,
                                           const std::string &            
js_reduce_fun);
-       mongocxx::cursor aggregate(bsoncxx::document::view pipeline, const 
std::string &collection = "");
+       mongocxx::cursor aggregate(mongocxx::pipeline &pipeline, const 
std::string &collection_name = "");
        int              drop_collection(const std::string &collection);
        int              clear_memory();
        int              restore_collection(const std::string &dbcollection,

- *commit* 68b0176765608f17f565172051d1ce1ee7c5a5b9 - - - - - - - - - -
Author:  Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
Date:    Thu Oct 29 09:12:16 2020 +0100
Subject: pddl-planner: fix broken update queries

 src/plugins/pddl-planner/Makefile                |  8 ++++----
 src/plugins/pddl-planner/pddl-planner_thread.cpp | 21 ++++++++++++++-------
 2 files changed, 18 insertions(+), 11 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/pddl-planner/Makefile 
b/src/plugins/pddl-planner/Makefile
index 8eea704ac..af564089c 100644
--- a/src/plugins/pddl-planner/Makefile
+++ b/src/plugins/pddl-planner/Makefile
@@ -27,7 +27,7 @@ OBJS_pddl_planner = pddl-planner_plugin.o 
pddl-planner_thread.o
 OBJS_all    = $(OBJS_pddl_planner)
 PLUGINS_all = $(PLUGINDIR)/pddl-planner.$(SOEXT)
 
-ifeq ($(HAVE_CPP11)$(HAVE_MONGODB),11)
+ifeq ($(HAVE_CPP17)$(HAVE_MONGODB),11)
   PRESUBDIRS = interfaces
 
   CFLAGS  += $(CFLAGS_CPP11) $(CFLAGS_MONGODB)
@@ -36,7 +36,7 @@ ifeq ($(HAVE_CPP11)$(HAVE_MONGODB),11)
   PLUGINS_build = $(PLUGINS_all)
 else
   ifneq ($(HAVE_CPP11),1)
-    WARN_TARGETS += warning_cpp11
+    WARN_TARGETS += warning_cpp17
   endif
   ifneq ($(HAVE_TF),1)
     WARN_TARGETS = warning_mongodb
@@ -46,11 +46,11 @@ endif
 ifeq ($(OBJSSUBMAKE),1)
 all: $(WARN_TARGETS)
 
-.PHONY: warning_mongodb warning_cpp11
+.PHONY: warning_mongodb warning_cpp17
 warning_mongodb:
        $(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting pddl-robot-memory 
plugin$(TNORMAL) (mongodb not available)"
 warning_cpp11:
-       $(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Cannot build 
pddl-robot-memory plugin$(TNORMAL) (C++11 not supported)"
+       $(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Cannot build 
pddl-robot-memory plugin$(TNORMAL) (C++17 not supported)"
 endif
 
 include $(BUILDSYSDIR)/base.mk
diff --git a/src/plugins/pddl-planner/pddl-planner_thread.cpp 
b/src/plugins/pddl-planner/pddl-planner_thread.cpp
index a9a13cb13..79ccf3be1 100644
--- a/src/plugins/pddl-planner/pddl-planner_thread.cpp
+++ b/src/plugins/pddl-planner/pddl-planner_thread.cpp
@@ -109,13 +109,16 @@ PddlPlannerThread::loop()
 
        if (!action_list_.empty()) {
                auto plan = BSONFromActionList();
-               robot_memory->update(from_json("{plan:{$exists:true}}").view(), 
plan, cfg_collection_, true);
+               robot_memory->update(builder::basic::make_document(kvp("plan", 
"{$exists:true}")),
+                                    plan,
+                                    cfg_collection_,
+                                    true);
                print_action_list();
                plan_if_->set_success(true);
        } else {
                logger->log_error(name(), "Updating plan failed, action list 
empty!");
-               robot_memory->update(from_json("{plan:{$exists:true}}").view(),
-                                    from_json("{plan:0}").view(),
+               robot_memory->update(builder::basic::make_document(kvp("plan", 
"{$exists:true}")),
+                                    builder::basic::make_document(kvp("plan", 
0)),
                                     cfg_collection_,
                                     true);
                plan_if_->set_success(false);
@@ -148,8 +151,10 @@ PddlPlannerThread::ff_planner()
        size_t cur_pos = 0;
        if (result.find("found legal plan as follows", cur_pos) == 
std::string::npos) {
                logger->log_error(name(), "Planning Failed: %s", 
result.c_str());
-               robot_memory->update(from_json("{plan:{$exists:true}}").view(),
-                                    
from_json("{plan:1,fail:1,steps:[]}").view(),
+               robot_memory->update(builder::basic::make_document(kvp("plan", 
"{$exists:true}")),
+                                    builder::basic::make_document(kvp("plan", 
1),
+                                                                  kvp("fail", 
1),
+                                                                  kvp("steps", 
builder::basic::array())),
                                     cfg_collection_,
                                     true);
                return;
@@ -202,8 +207,10 @@ PddlPlannerThread::dbmp_planner()
        size_t cur_pos = 0;
        if (result.find("Planner failed", cur_pos) != std::string::npos) {
                logger->log_error(name(), "Planning Failed: %s", 
result.c_str());
-               robot_memory->update(from_json("{plan:{$exists:true}}").view(),
-                                    
from_json("{plan:1,fail:1,steps:[]}").view(),
+               robot_memory->update(builder::basic::make_document(kvp("plan", 
"{$exists:true}")),
+                                    builder::basic::make_document(kvp("plan", 
1),
+                                                                  kvp("fail", 
1),
+                                                                  kvp("steps", 
builder::basic::array())),
                                     cfg_collection_,
                                     true);
                return;

- *commit* 029fa9298faa6c12a4a652957ee5ed9b56e178c9 - - - - - - - - - -
Author:  Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
Date:    Thu Oct 29 10:06:33 2020 +0100
Subject: pddl-robot-memory: adapt to mongocxx aggregate

 src/plugins/pddl-robot-memory/Makefile             | 12 +++----
 .../pddl-robot-memory/pddl_robot_memory_thread.cpp | 39 ++++++++++++++++------
 2 files changed, 35 insertions(+), 16 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/pddl-robot-memory/Makefile 
b/src/plugins/pddl-robot-memory/Makefile
index 1042e3dbd..050fc9f5f 100644
--- a/src/plugins/pddl-robot-memory/Makefile
+++ b/src/plugins/pddl-robot-memory/Makefile
@@ -26,18 +26,18 @@ LIBS_pddl_robot_memory = m fawkescore fawkesutils 
fawkesaspects fawkesbaseapp \
 OBJS_pddl_robot_memory = pddl_robot_memory_plugin.o pddl_robot_memory_thread.o
 
 OBJS_all   = $(OBJS_pddl_robot_memory)
-PLUGINS_all = $(PLUGINDIR)/pddl-robot-memory.$(SOEXT)    
+PLUGINS_all = $(PLUGINDIR)/pddl-robot-memory.$(SOEXT)
 
-ifeq ($(HAVE_CPP11)$(HAVE_ROBOT_MEMORY)$(HAVE_CTEMPLATE),111)
+ifeq ($(HAVE_CPP17)$(HAVE_ROBOT_MEMORY)$(HAVE_CTEMPLATE),111)
   PRESUBDIRS = interfaces
 
-  CFLAGS  += $(CFLAGS_CPP11) $(CFLAGS_ROBOT_MEMORY)
+  CFLAGS  += $(CFLAGS_CPP17) $(CFLAGS_ROBOT_MEMORY)
   LDFLAGS += $(LDFLAGS_CTEMPLATE) $(LDFLAGS_ROBOT_MEMORY)
 
   PLUGINS_build = $(PLUGINS_all)
 else
-  ifneq ($(HAVE_CPP11),1)
-    WARN_TARGETS += warning_cpp11
+  ifneq ($(HAVE_CPP17),1)
+    WARN_TARGETS += warning_cpp17
   endif
   ifneq ($(HAVE_ROBOT_MEMORY),1)
     WARN_TARGETS += warning_robot_memory
@@ -54,7 +54,7 @@ all: $(WARN_TARGETS)
 warning_robot_memory:
        $(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting pddl-robot-memory 
plugin$(TNORMAL) (robot memory not available)"
 warning_cpp11:
-       $(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Cannot build 
pddl-robot-memory plugin$(TNORMAL) (C++11 not supported)"
+       $(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Cannot build 
pddl-robot-memory plugin$(TNORMAL) (C++17 not supported)"
 warning_ctemplate:
        $(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Cannot build 
pddl-robot-memory plugin$(TNORMAL) (ctemplate-devel not installed)"
 endif
diff --git a/src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp 
b/src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp
index 119422550..e672ad7c7 100644
--- a/src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp
+++ b/src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp
@@ -172,16 +172,35 @@ PddlRobotMemoryThread::loop()
                }
        }
 
-       basic::document aggregate_query;
-       aggregate_query.append(basic::kvp("$facet", facets.view()));
-       std::vector<document::view> aggregate_pipeline{aggregate_query.view()};
-       auto                        res    = 
robot_memory->aggregate(aggregate_pipeline, collection);
-       auto                        result = 
res.view()["result"]["0"].get_document().view();
-       //BSONObj                     result = 
res.getField("result").Obj()["0"].Obj();
-       for (auto e : result) {
-               for (auto f : e.get_document().view()) {
-                       ctemplate::TemplateDictionary *entry_dict = 
dict.AddSectionDictionary(std::string(e.key()));
-                       fill_dict_from_document(entry_dict, 
f.get_document().view());
+       basic::document    aggregate_query;
+       mongocxx::pipeline aggregate_pipeline{};
+       aggregate_pipeline.facet(facets.view());
+       auto res = robot_memory->aggregate(aggregate_pipeline, collection);
+       for (auto doc : res) {
+               for (document::element ele : doc) {
+                       // check validity && type before trying to iterate
+                       if (ele && ele.type() == type::k_array) {
+                               array::view subarray{ele.get_array().value};
+                               for (array::element msg : subarray) {
+                                       if (msg.type() == 
bsoncxx::type::k_document) {
+                                               ctemplate::TemplateDictionary 
*entry_dict =
+                                                 
dict.AddSectionDictionary(std::string(ele.key()).c_str());
+                                               
fill_dict_from_document(entry_dict, msg.get_document().view());
+                                       } else {
+                                               throw Exception(
+                                                 (std::string("Error while 
retrieving domain facts and objects: expected document "
+                                                              "type but got ")
+                                                  + 
bsoncxx::to_string(msg.type()))
+                                                   .c_str());
+                                       }
+                               }
+                       } else {
+                               throw Exception(
+                                 (std::string(
+                                    "Error while retrieving domain facts and 
objects: expected k_array type but got: ")
+                                  + bsoncxx::to_string(ele.type()))
+                                   .c_str());
+                       }
                }
        }
 

- *commit* 3305eba65e931f3c9bac3ae2c16d87f76821ef2d - - - - - - - - - -
Author:  Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
Date:    Thu Oct 29 10:09:35 2020 +0100
Subject: pddl-robot-memory: do not restrict pddl files to src/agents

 src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp 
b/src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp
index e672ad7c7..6ac6a1a27 100644
--- a/src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp
+++ b/src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp
@@ -70,11 +70,9 @@ PddlRobotMemoryThread::init()
        //read config values
        collection = config->get_string("plugins/pddl-robot-memory/collection");
        input_path = StringConversions::resolve_path(
-         "@BASEDIR@/src/agents/"
-         + 
config->get_string("plugins/pddl-robot-memory/input-problem-description"));
+         "@BASEDIR@/src/" + 
config->get_string("plugins/pddl-robot-memory/input-problem-description"));
        output_path = StringConversions::resolve_path(
-         "@BASEDIR@/src/agents/"
-         + 
config->get_string("plugins/pddl-robot-memory/output-problem-description"));
+         "@BASEDIR@/src/" + 
config->get_string("plugins/pddl-robot-memory/output-problem-description"));
        if (config->exists("plugins/pddl-robot-memory/goal"))
                goal = config->get_string("plugins/pddl-robot-memory/goal");
 

- *commit* 258ca2c4f0fa887104ff3719439051e5e59b95c6 - - - - - - - - - -
Author:  Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
Date:    Thu Oct 29 10:11:53 2020 +0100
Subject: pddl-robot-memory: properly fill dict from document

 src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp 
b/src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp
index 6ac6a1a27..a3a3c15d5 100644
--- a/src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp
+++ b/src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp
@@ -298,10 +298,10 @@ 
PddlRobotMemoryThread::fill_dict_from_document(ctemplate::TemplateDictionary *di
                        // access array elements as if they were a subdocument 
with key-value pairs
                        // using the indices as keys
                        basic::document b;
-                       array::view     array = elem.get_array();
+                       array::view     array = elem.get_array().value;
                        uint            i     = 0;
                        for (auto e : array) {
-                               b.append(basic::kvp(std::to_string(i++), 
e.get_document().view()));
+                               b.append(basic::kvp(std::to_string(i++), 
e.get_value()));
                        }
                        fill_dict_from_document(dict, b.view(), prefix + 
std::string(elem.key()) + "_");
                        // additionally feed the whole array as space-separated 
list

- *commit* 4747873b6a27c3f408c9a9bd335a3791c48ab310 - - - - - - - - - -
Author:  Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
Date:    Thu Oct 29 10:14:21 2020 +0100
Subject: pddl-robot-memory: support int arrays and throw on unsupported type

 src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp 
b/src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp
index a3a3c15d5..47b05986b 100644
--- a/src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp
+++ b/src/plugins/pddl-robot-memory/pddl_robot_memory_thread.cpp
@@ -307,8 +307,13 @@ 
PddlRobotMemoryThread::fill_dict_from_document(ctemplate::TemplateDictionary *di
                        // additionally feed the whole array as space-separated 
list
                        std::string array_string;
                        for (auto e : array) {
-                               // TODO: This only works for string arrays, 
adapt to other types.
-                               array_string += " " + 
e.get_utf8().value.to_string();
+                               // TODO:adapt to other types.
+                               array_string += " ";
+                               switch (e.type()) {
+                               case type::k_int64: array_string += 
std::to_string(e.get_int64()); break;
+                               case type::k_utf8: array_string += 
e.get_utf8().value.to_string(); break;
+                               default: throw Exception("Not implemented");
+                               }
                        }
                        dict->SetValue(prefix + std::string(elem.key()), 
array_string);
                        break;

- *commit* 987ae26a95f79482e414acabd072ce3ec6c367bb - - - - - - - - - -
Author:  Tarik Viehmann <viehm...@kbsg.rwth-aachen.de>
Date:    Thu Oct 29 10:55:23 2020 +0100
Subject: pddl-planner: use basic builder namespace

 src/plugins/pddl-planner/pddl-planner_thread.cpp | 26 +++++++++++++-----------
 1 file changed, 14 insertions(+), 12 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/pddl-planner/pddl-planner_thread.cpp 
b/src/plugins/pddl-planner/pddl-planner_thread.cpp
index 79ccf3be1..a15a9eae3 100644
--- a/src/plugins/pddl-planner/pddl-planner_thread.cpp
+++ b/src/plugins/pddl-planner/pddl-planner_thread.cpp
@@ -36,6 +36,7 @@
 using namespace fawkes;
 using namespace mongocxx;
 using namespace bsoncxx;
+using namespace bsoncxx::builder;
 
 /** @class PddlPlannerThread 'pddl-planner_thread.h' 
  * Starts a pddl planner and writes the resulting plan into the robot memory
@@ -109,7 +110,7 @@ PddlPlannerThread::loop()
 
        if (!action_list_.empty()) {
                auto plan = BSONFromActionList();
-               robot_memory->update(builder::basic::make_document(kvp("plan", 
"{$exists:true}")),
+               
robot_memory->update(builder::basic::make_document(basic::kvp("plan", 
"{$exists:true}")),
                                     plan,
                                     cfg_collection_,
                                     true);
@@ -117,8 +118,8 @@ PddlPlannerThread::loop()
                plan_if_->set_success(true);
        } else {
                logger->log_error(name(), "Updating plan failed, action list 
empty!");
-               robot_memory->update(builder::basic::make_document(kvp("plan", 
"{$exists:true}")),
-                                    builder::basic::make_document(kvp("plan", 
0)),
+               
robot_memory->update(builder::basic::make_document(basic::kvp("plan", 
"{$exists:true}")),
+                                    
builder::basic::make_document(basic::kvp("plan", 0)),
                                     cfg_collection_,
                                     true);
                plan_if_->set_success(false);
@@ -151,10 +152,11 @@ PddlPlannerThread::ff_planner()
        size_t cur_pos = 0;
        if (result.find("found legal plan as follows", cur_pos) == 
std::string::npos) {
                logger->log_error(name(), "Planning Failed: %s", 
result.c_str());
-               robot_memory->update(builder::basic::make_document(kvp("plan", 
"{$exists:true}")),
-                                    builder::basic::make_document(kvp("plan", 
1),
-                                                                  kvp("fail", 
1),
-                                                                  kvp("steps", 
builder::basic::array())),
+               
robot_memory->update(builder::basic::make_document(basic::kvp("plan", 
"{$exists:true}")),
+                                    
builder::basic::make_document(basic::kvp("plan", 1),
+                                                                  
basic::kvp("fail", 1),
+                                                                  
basic::kvp("steps",
+                                                                             
builder::basic::array())),
                                     cfg_collection_,
                                     true);
                return;
@@ -207,10 +209,11 @@ PddlPlannerThread::dbmp_planner()
        size_t cur_pos = 0;
        if (result.find("Planner failed", cur_pos) != std::string::npos) {
                logger->log_error(name(), "Planning Failed: %s", 
result.c_str());
-               robot_memory->update(builder::basic::make_document(kvp("plan", 
"{$exists:true}")),
-                                    builder::basic::make_document(kvp("plan", 
1),
-                                                                  kvp("fail", 
1),
-                                                                  kvp("steps", 
builder::basic::array())),
+               
robot_memory->update(builder::basic::make_document(basic::kvp("plan", 
"{$exists:true}")),
+                                    
builder::basic::make_document(basic::kvp("plan", 1),
+                                                                  
basic::kvp("fail", 1),
+                                                                  
basic::kvp("steps",
+                                                                             
builder::basic::array())),
                                     cfg_collection_,
                                     true);
                return;
@@ -296,7 +299,6 @@ PddlPlannerThread::fd_planner()
 document::value
 PddlPlannerThread::BSONFromActionList()
 {
-       using namespace bsoncxx::builder;
        basic::document plan;
        plan.append(basic::kvp("plan", 1));
        plan.append(basic::kvp("msg_id", 
static_cast<int64_t>(plan_if_->msg_id())));

- *commit* abdd38c44f0f63873292aba54788e60cac2ee09b - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Sun Nov 8 17:14:26 2020 +0100
Subject: mongodb_log: fix port

 .../mongodb_log/mongodb_log_logger_thread.cpp      | 27 +++++++++-------------
 1 file changed, 11 insertions(+), 16 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
index 43157d852..d760e1801 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
@@ -69,7 +69,7 @@ MongoLogLoggerThread::init()
 {
        database_   = 
config->get_string_or_default("/plugins/mongodb/logger/database", "fawkes");
        collection_ = 
config->get_string_or_default("/plugins/mongodb/logger/collection", "msglog");
-       mongocxx::uri uri("mongodb://localhost:27017");
+       mongocxx::uri uri("mongodb://localhost:27021");
        mongodb_client = new mongocxx::client(uri);
 }
 
@@ -125,21 +125,16 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
            && msg_s.find("==>") != std::string::npos) {
                basic::document df;
                basic::document dfc;
-               df.append(
-                 basic::kvp("id",
-                            msg_s.substr(msg_s.find("(id \"") + 5,
-                                         msg_s.find("\")") - msg_s.find("(id 
\"") - 5)));
-               df.append(basic::kvp(
-                 "is-list",
-                 msg_s.substr(msg_s.find("(is-list ") + 9)
-                   .substr(0, msg_s.substr(msg_s.find("(is-list ") + 
9).find(")")))); 
-               df.append(basic::kvp("source",
-                                    
config->get_string_or_default("fawkes/agent/name", "UNKN"))); 
-               df.append(
-                 basic::kvp("type",
-                            msg_s.substr(msg_s.find("(type ") + 6)
-                              .substr(0,
-                                      msg_s.substr(msg_s.find("(type ") + 
6).find(")")))); 
+               df.append(basic::kvp("id",
+                                    msg_s.substr(msg_s.find("(id \"") + 5,
+                                                 msg_s.find("\")") - 
msg_s.find("(id \"") - 5)));
+               df.append(basic::kvp("is-list",
+                                    msg_s.substr(msg_s.find("(is-list ") + 9)
+                                      .substr(0, 
msg_s.substr(msg_s.find("(is-list ") + 9).find(")"))));
+               df.append(basic::kvp("source", 
config->get_string_or_default("fawkes/agent/name", "UNKN")));
+               df.append(basic::kvp("type",
+                                    msg_s.substr(msg_s.find("(type ") + 6)
+                                      .substr(0, 
msg_s.substr(msg_s.find("(type ") + 6).find(")"))));
                if (msg_s.substr(msg_s.find("(is-list ") + 9)
                      .substr(0, msg_s.substr(msg_s.find("(is-list ") + 
9).find(")"))
                    == "TRUE") {

- *commit* a6e3959aae46b6b06435b05f75b0ca16181e2fc0 - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Sun Nov 8 17:26:32 2020 +0100
Subject: mongodb: add date object from iso 8601 string to bson doc

 .../clips_robot_memory_thread.cpp                  | 31 ++++++++++++++++++++++
 .../clips-robot-memory/clips_robot_memory_thread.h |  1 +
 2 files changed, 32 insertions(+)

_Diff for modified files_:
diff --git a/src/plugins/clips-robot-memory/clips_robot_memory_thread.cpp 
b/src/plugins/clips-robot-memory/clips_robot_memory_thread.cpp
index ce04a0b68..5d5a4b603 100644
--- a/src/plugins/clips-robot-memory/clips_robot_memory_thread.cpp
+++ b/src/plugins/clips-robot-memory/clips_robot_memory_thread.cpp
@@ -239,6 +239,10 @@ ClipsRobotMemoryThread::clips_context_init(const 
std::string &          env_name
            sigc::mem_fun(*this, 
&ClipsRobotMemoryThread::clips_robotmemory_mutex_expire_locks_async),
            env_name)));
 
+       clips->add_function("bson-append-time-iso",
+                           sigc::slot<void, void *, std::string, std::string>(
+                             sigc::mem_fun(*this, 
&ClipsRobotMemoryThread::clips_bson_append_iso_time)));
+
        clips->build("(deffacts have-feature-mongodb (have-feature MongoDB))");
 
        //load helper functions written in CLIPS
@@ -451,6 +455,33 @@ ClipsRobotMemoryThread::clips_bson_append_time(void *      
  bson,
 }
 
 void
+ClipsRobotMemoryThread::clips_bson_append_iso_time(void *      bson,
+                                                   std::string field_name,
+                                                   std::string time_string)
+{
+       int         y, M, d, h, m;
+       float       s;
+       std::string dateStr = time_string;
+       sscanf(dateStr.c_str(), "%d-%d-%d %d:%d:%fZ", &y, &M, &d, &h, &m, &s);
+       tm time;
+       time.tm_year          = y - 1900; // Year since 1900
+       time.tm_mon           = M - 1;    // 0-11
+       time.tm_mday          = d;        // 1-31
+       time.tm_hour          = h;        // 0-23
+       time.tm_min           = m;        // 0-59
+       time.tm_sec           = (int)s;   // 0-61 (0-60 in C++11)
+       time_t timeSinceEpoch = timegm(&time);
+
+       auto res         = 
std::chrono::system_clock::from_time_t(timeSinceEpoch);
+       auto tms         = 
std::chrono::milliseconds(std::stoi(time_string.substr(20, 3)));
+       auto chrono_time = res + tms;
+
+       bsoncxx::types::b_date bson_time{chrono_time};
+       auto                   b = 
static_cast<bsoncxx::builder::basic::document *>(bson);
+       b->append(bsoncxx::builder::basic::kvp(field_name, bson_time));
+}
+
+void
 ClipsRobotMemoryThread::clips_robotmemory_insert(std::string collection, void 
*bson)
 {
        auto b = static_cast<bsoncxx::builder::basic::document *>(bson);
diff --git a/src/plugins/clips-robot-memory/clips_robot_memory_thread.h 
b/src/plugins/clips-robot-memory/clips_robot_memory_thread.h
index 31dc385fd..69c3e7ae2 100644
--- a/src/plugins/clips-robot-memory/clips_robot_memory_thread.h
+++ b/src/plugins/clips-robot-memory/clips_robot_memory_thread.h
@@ -78,6 +78,7 @@ private:
        void clips_bson_append_regex(void *bson, std::string field_name, 
CLIPS::Value regex_string);
        void clips_bson_append_array(void *bson, std::string field_name, 
CLIPS::Values values);
        void clips_bson_append_time(void *bson, std::string field_name, 
CLIPS::Values time);
+       void clips_bson_append_iso_time(void *bson, std::string field_name, 
std::string time);
        CLIPS::Value  clips_bson_array_start();
        void          clips_bson_array_finish(void *bson, std::string 
field_name, void *array);
        void          clips_bson_array_append(void *barr, CLIPS::Value value);

- *commit* 87163b94c240d95cd7949cf4e63e4bcb28a8f0f8 - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Sun Nov 8 17:29:07 2020 +0100
Subject: mongodb: add methods to perform aggregate queries in CLIPS

 .../clips_robot_memory_thread.cpp                  | 80 ++++++++++++++++++++++
 .../clips-robot-memory/clips_robot_memory_thread.h | 10 +++
 2 files changed, 90 insertions(+)

_Diff for modified files_:
diff --git a/src/plugins/clips-robot-memory/clips_robot_memory_thread.cpp 
b/src/plugins/clips-robot-memory/clips_robot_memory_thread.cpp
index 5d5a4b603..3eb58b072 100644
--- a/src/plugins/clips-robot-memory/clips_robot_memory_thread.cpp
+++ b/src/plugins/clips-robot-memory/clips_robot_memory_thread.cpp
@@ -239,6 +239,24 @@ ClipsRobotMemoryThread::clips_context_init(const 
std::string &          env_name
            sigc::mem_fun(*this, 
&ClipsRobotMemoryThread::clips_robotmemory_mutex_expire_locks_async),
            env_name)));
 
+       clips->add_function("robmem-pipeline-create",
+                           sigc::slot<CLIPS::Value>(
+                             sigc::mem_fun(*this,
+                                           
&ClipsRobotMemoryThread::clips_robotmemory_pipeline_create)));
+       clips->add_function("robmem-pipeline-destroy",
+                           sigc::slot<void, CLIPS::Value>(sigc::mem_fun(
+                             *this, 
&ClipsRobotMemoryThread::clips_robotmemory_pipeline_destroy)));
+       clips->add_function("robmem-pipeline-add-match",
+                           sigc::slot<CLIPS::Value, void *, void 
*>(sigc::mem_fun(
+                             *this, 
&ClipsRobotMemoryThread::clips_robotmemory_pipeline_add_match)));
+       clips->add_function(
+         "robmem-pipeline-add-projection",
+         sigc::slot<CLIPS::Value, void *, void *>(
+           sigc::mem_fun(*this, 
&ClipsRobotMemoryThread::clips_robotmemory_pipeline_add_projection)));
+       clips->add_function("robmem-aggregate",
+                           sigc::slot<CLIPS::Value, std::string, void *>(
+                             sigc::mem_fun(*this,
+                                           
&ClipsRobotMemoryThread::clips_robotmemory_aggregate)));
        clips->add_function("bson-append-time-iso",
                            sigc::slot<void, void *, std::string, std::string>(
                              sigc::mem_fun(*this, 
&ClipsRobotMemoryThread::clips_bson_append_iso_time)));
@@ -1174,3 +1192,65 @@ 
ClipsRobotMemoryThread::clips_robotmemory_mutex_expire_locks_async(std::string e
 
        return CLIPS::Value("TRUE", CLIPS::TYPE_SYMBOL);
 }
+
+CLIPS::Value
+ClipsRobotMemoryThread::clips_robotmemory_pipeline_create()
+{
+       return CLIPS::Value(new mongocxx::pipeline());
+}
+
+void
+ClipsRobotMemoryThread::clips_robotmemory_pipeline_destroy(void *pipeline)
+{
+       auto b = static_cast<mongocxx::pipeline *>(pipeline);
+       delete b;
+}
+
+CLIPS::Value
+ClipsRobotMemoryThread::clips_robotmemory_pipeline_add_match(void *pipeline, 
void *match)
+{
+       try {
+               auto pipeline_obj = static_cast<mongocxx::pipeline *>(pipeline);
+               auto match_obj    = 
static_cast<bsoncxx::builder::basic::document *>(match);
+
+               pipeline_obj->match(match_obj->view());
+
+               return CLIPS::Value(pipeline_obj);
+       } catch (std::system_error &e) {
+               logger->log_warn("MongoDB", "Pipeline add match failed: %s", 
e.what());
+               return CLIPS::Value("FALSE", CLIPS::TYPE_SYMBOL);
+       }
+}
+
+CLIPS::Value
+ClipsRobotMemoryThread::clips_robotmemory_pipeline_add_projection(void 
*pipeline, void *projection)
+{
+       try {
+               auto pipeline_obj = static_cast<mongocxx::pipeline *>(pipeline);
+               auto proj_obj     = 
static_cast<bsoncxx::builder::basic::document *>(projection);
+
+               pipeline_obj->project(proj_obj->view());
+
+               return CLIPS::Value(pipeline_obj);
+       } catch (std::system_error &e) {
+               logger->log_warn("MongoDB", "Pipline add projection failed: 
%s", e.what());
+               return CLIPS::Value("FALSE", CLIPS::TYPE_SYMBOL);
+       }
+}
+
+CLIPS::Value
+ClipsRobotMemoryThread::clips_robotmemory_aggregate(std::string collection, 
void *pipeline)
+{
+       auto pipeline_obj = static_cast<mongocxx::pipeline *>(pipeline);
+
+       try {
+               auto cursor = robot_memory->aggregate(*pipeline_obj, 
collection);
+
+               return CLIPS::Value(new std::unique_ptr<mongocxx::cursor>(
+                                     new mongocxx::cursor(std::move(cursor))),
+                                   CLIPS::TYPE_EXTERNAL_ADDRESS);
+       } catch (std::system_error &e) {
+               logger->log_warn("MongoDB", "Aggregate failed: %s", e.what());
+               return CLIPS::Value("FALSE", CLIPS::TYPE_SYMBOL);
+       }
+}
\ No newline at end of file
diff --git a/src/plugins/clips-robot-memory/clips_robot_memory_thread.h 
b/src/plugins/clips-robot-memory/clips_robot_memory_thread.h
index 69c3e7ae2..c7a86484f 100644
--- a/src/plugins/clips-robot-memory/clips_robot_memory_thread.h
+++ b/src/plugins/clips-robot-memory/clips_robot_memory_thread.h
@@ -139,6 +139,16 @@ private:
 
        bool mutex_future_ready(const std::string &name);
 
+       CLIPS::Value clips_robotmemory_pipeline_create();
+       void         clips_robotmemory_pipeline_destroy(void *pipeline);
+       CLIPS::Value clips_robotmemory_pipeline_add_match(void *pipeline, void 
*match);
+       CLIPS::Value clips_robotmemory_pipeline_add_projection(void *pipeline, 
void *projection);
+       CLIPS::Value clips_robotmemory_aggregate(std::string collection, void 
*);
+       void         clips_bson_append_array_test(void *       bson,
+                                                 std::string  field_name,
+                                                 CLIPS::Value value1,
+                                                 CLIPS::Value value2);
+
 private:
        std::list<ClipsRmTrigger *>              clips_triggers_;
        fawkes::Mutex                            clips_triggers_mutex_;

- *commit* 06aaecf0a477e5d7389f9a5ade2304fb8c971ce1 - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Sun Nov 8 17:31:09 2020 +0100
Subject: cx: load a stored games tate from a mongodb collection

 .../clips-executive/clips/wm-robmem-sync.clp       | 45 ++++++++++++++++++++++
 1 file changed, 45 insertions(+)

_Diff for modified files_:
diff --git a/src/plugins/clips-executive/clips/wm-robmem-sync.clp 
b/src/plugins/clips-executive/clips/wm-robmem-sync.clp
index 913c4bf45..89b88884c 100644
--- a/src/plugins/clips-executive/clips/wm-robmem-sync.clp
+++ b/src/plugins/clips-executive/clips/wm-robmem-sync.clp
@@ -231,6 +231,51 @@
        (bson-destroy ?query)
 )
 
+(deffunction wm-robmem-load-from-storage (?game ?timepoint)
+       (bind ?match (bson-create))
+       (bind ?match-lte-timestamp (bson-create))
+       (bind ?project (bson-create))
+       (bind ?doc1 (bson-create))
+       (bind ?doc2 (bson-create))
+       (bind ?doc21 (bson-create))
+
+       (bson-append ?doc1 "retracted" "FALSE")
+       (bson-append-time-iso ?doc21 "$gte" ?timepoint)
+       (bson-append ?doc2 "retracted" ?doc21)
+       (bson-append-time-iso ?match "game" ?game)
+       (bson-append-time-iso ?match-lte-timestamp "$lte" ?timepoint)
+       (bson-append ?match "asserted" ?match-lte-timestamp)
+
+       (bind ?limit-arr (bson-array-start))
+       (bson-array-append ?limit-arr ?doc1)  
+       (bson-array-append ?limit-arr ?doc2)  
+       (bson-array-finish ?match "$or" ?limit-arr)
+
+
+       (bson-append ?project "id" "$fact.id")
+       (bson-append ?project "source" "$fact.source")
+       (bson-append ?project "type" "$fact.type")
+       (bson-append ?project "is-list" "$fact.is-list")
+       (bson-append ?project "update-timestamp" "$fact.update-timestamp")
+       (bson-append ?project "value" "$fact.value")
+       (bson-append ?project "values" "$fact.values")
+
+       (bind ?pipeline (robmem-pipeline-create))
+       (robmem-pipeline-add-match ?pipeline ?match)
+       (robmem-pipeline-add-projection ?pipeline ?project)
+       (bind ?cursor (robmem-aggregate "fawkes.gamestate_recovery_test" 
?pipeline))
+
+       (robmem-pipeline-destroy ?pipeline)
+       (bson-destroy ?match)
+       (bson-destroy ?match-lte-timestamp)
+       (bson-destroy ?project)
+       (bson-destroy ?doc1)
+       (bson-destroy ?doc2)
+       (bson-destroy ?doc21)
+
+       (return ?doc)
+)
+
 (defrule wm-robmem-sync-fact-added
        (wm-fact (key cx identity) (value ?identity))
        (wm-robmem-sync-conf (wm-fact-key-prefix $?key-prefix) (enabled TRUE))

- *commit* bb49eb8ab6c8ba355981178cf6de3f48b8a3fbda - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Sun Nov 15 11:39:33 2020 +0100
Subject: cx: fix wrong return value in wm-robmem-load-from-storage

 src/plugins/clips-executive/clips/wm-robmem-sync.clp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

_Diff for modified files_:
diff --git a/src/plugins/clips-executive/clips/wm-robmem-sync.clp 
b/src/plugins/clips-executive/clips/wm-robmem-sync.clp
index 89b88884c..eaf90fdf3 100644
--- a/src/plugins/clips-executive/clips/wm-robmem-sync.clp
+++ b/src/plugins/clips-executive/clips/wm-robmem-sync.clp
@@ -273,7 +273,7 @@
        (bson-destroy ?doc2)
        (bson-destroy ?doc21)
 
-       (return ?doc)
+       (return ?cursor)
 )
 
 (defrule wm-robmem-sync-fact-added

- *commit* 7bcf865ee77b4e98727fa057b133d9dc9686eda1 - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Mon Dec 21 00:25:35 2020 +0100
Subject: mongodb_log: use gametime and clips id to update already saved facts

 src/plugins/mongodb_log/mongodb_log_logger_thread.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
index d760e1801..ae66a5dcd 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
@@ -172,9 +172,9 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
        if (msg_s.find("(wm-fact (id \"/domain/") != std::string::npos
            && msg_s.find("<==") != std::string::npos) {
                std::string clips_id = msg_s.substr(msg_s.find("<== ") + 
4).substr(0, msg_s.find("(") - 5);
-
+               
                
mongodb_client->database(database_)["gamestate_recovery_test"].update_one(
-                 make_document(kvp("clips-id", clips_id)),
+                 make_document(kvp("clips-id", clips_id),kvp("game", 
gametime_)),//add gametime for synchronization purposes :D 
                  make_document(kvp("$set", make_document(kvp("retracted", 
nowd)))));
        }
        free(msg);

- *commit* 4b15adfd3973f87ed076433b2a0de86762c6a0b2 - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Mon Dec 21 00:42:19 2020 +0100
Subject: cx: add missing check of modification wm-sync-domain-object-added

 src/plugins/clips-executive/clips/wm-domain-sync.clp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

_Diff for modified files_:
diff --git a/src/plugins/clips-executive/clips/wm-domain-sync.clp 
b/src/plugins/clips-executive/clips/wm-domain-sync.clp
index 751dc60f5..7e2ecd063 100644
--- a/src/plugins/clips-executive/clips/wm-domain-sync.clp
+++ b/src/plugins/clips-executive/clips/wm-domain-sync.clp
@@ -465,7 +465,9 @@
        (test (<= (fact-index ?wf) ?wf-idx))
        =>
        (bind ?new-wf (modify ?wf (values (append$ ?objs ?name))))
-       (modify ?wm (wm-fact-idx (fact-index ?new-wf)))
+       (if ?new-wf then 
+               (modify ?wm (wm-fact-idx (fact-index ?new-wf)))
+       )
 )
 
 (defrule wm-sync-domain-object-removed

- *commit* 2d8024221efe6c9945994dcd6183db3002d250cd - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Wed Jan 20 19:35:33 2021 +0100
Subject: mongodb_log: set to log only on Icks

 src/plugins/mongodb_log/mongodb_log_logger_thread.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

_Diff for modified files_:
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
index ae66a5dcd..35507fd96 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
@@ -90,6 +90,9 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
                                      va_list     va)
 {
        MutexLocker            lock(mutex_);
+       if(config->get_string("fawkes/agent/name") != "Icks") {
+               return;
+       }
        bsoncxx::types::b_date nowd{std::chrono::high_resolution_clock::now()};
 
        char *msg;
@@ -174,7 +177,7 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
                std::string clips_id = msg_s.substr(msg_s.find("<== ") + 
4).substr(0, msg_s.find("(") - 5);
                
                
mongodb_client->database(database_)["gamestate_recovery_test"].update_one(
-                 make_document(kvp("clips-id", clips_id),kvp("game", 
gametime_)),//add gametime for synchronization purposes :D 
+                 make_document(kvp("clips-id", clips_id),kvp("game", 
gametime_)),
                  make_document(kvp("$set", make_document(kvp("retracted", 
nowd)))));
        }
        free(msg);

- *commit* 23f675ce2ee9a05a88c127d804961d5023cd503e - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Wed Jan 27 13:48:43 2021 +0100
Subject: mongodb_log: add gamestate to logged data

 src/plugins/mongodb_log/mongodb_log_logger_thread.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

_Diff for modified files_:
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
index 35507fd96..a0b0c0dc3 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
@@ -123,6 +123,14 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
 
        std::string msg_s(msg);
 
+       //track gamestate set to running
+       if(msg_s.find("(key refbox state)") != std::string::npos || 
msg_s.find("(key refbox phase)") != std::string::npos) {
+               basic::document df;
+               df.append(basic::kvp("gamestate",  
msg_s.substr(msg_s.find("(value ") + 7, msg_s.substr(msg_s.find("(value ") + 
7).find(")"))));
+               df.append(basic::kvp("set", nowd));
+               df.append(basic::kvp("game", gametime_));
+               
mongodb_client->database(database_)["gamestate_recovery_test"].insert_one(df.view());
+       }
        //track assertion
        if (msg_s.find("(wm-fact (id \"/domain/") != std::string::npos
            && msg_s.find("==>") != std::string::npos) {

- *commit* bfaeff57fcc9a39ceefa5c604432fbde81886f4b - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Wed Jan 27 13:51:29 2021 +0100
Subject: mongodb_log: add rule firing to logged data

 src/plugins/mongodb_log/mongodb_log_logger_thread.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

_Diff for modified files_:
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
index a0b0c0dc3..977a143fa 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
@@ -131,6 +131,18 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
                df.append(basic::kvp("game", gametime_));
                
mongodb_client->database(database_)["gamestate_recovery_test"].insert_one(df.view());
        }
+
+       //track rule firing
+       if (msg_s.find("FIRE") != std::string::npos) {
+               basic::document df;
+               df.append(basic::kvp("rule",
+                                    msg_s.substr(msg_s.find("FIRE") + 10,
+                                                 msg_s.find("f-") - 2 - 
msg_s.find("FIRE") - 10)));
+               df.append(basic::kvp("fired", nowd));
+               df.append(basic::kvp("game", gametime_));
+               
mongodb_client->database(database_)["gamestate_recovery_test"].insert_one(df.view());
+       }
+
        //track assertion
        if (msg_s.find("(wm-fact (id \"/domain/") != std::string::npos
            && msg_s.find("==>") != std::string::npos) {

- *commit* 3f8db455e88720ee3f1f57006ceab5057eceda68 - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Thu Feb 18 23:04:12 2021 +0100
Subject: mongodb_log: fix bug that skipped last entry of values array

 src/plugins/mongodb_log/mongodb_log_logger_thread.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

_Diff for modified files_:
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
index 977a143fa..48af503c4 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
@@ -165,7 +165,6 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
 
                        std::string values_string = 
msg_s.substr(msg_s.find("(values") + 8)
                                                      .substr(0, 
msg_s.substr(msg_s.find("(values") + 8).find(")"));
-
                        size_t      pos = 0;
                        std::string token;
                        while ((pos = values_string.find(" ")) != 
std::string::npos) {
@@ -173,6 +172,7 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
                                array_builder.append(token);
                                values_string.erase(0, pos + 1);
                        }
+                       array_builder.append(values_string);
                        df.append(basic::kvp("values", 
array_builder.extract()));
                } else {
                        df.append(basic::kvp("value",

- *commit* d9cbb7b7bd36968922fc323985a635bd1ad23449 - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Thu Feb 18 23:05:09 2021 +0100
Subject: mongodb_log: add refbox and order facts to logging

 src/plugins/mongodb_log/mongodb_log_logger_thread.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

_Diff for modified files_:
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
index 48af503c4..7b2a3a37f 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
@@ -144,7 +144,9 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
        }
 
        //track assertion
-       if (msg_s.find("(wm-fact (id \"/domain/") != std::string::npos
+       if ((msg_s.find("(wm-fact (id \"/domain/") != std::string::npos
+               || msg_s.find("(wm-fact (id \"/refbox/") != std::string::npos
+               || msg_s.find("(wm-fact (id \"/order/") != std::string::npos)
            && msg_s.find("==>") != std::string::npos) {
                basic::document df;
                basic::document dfc;

- *commit* 60322e730acd3d0ce13b129166356b8b826c2652 - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Thu Feb 18 23:06:10 2021 +0100
Subject: mongodb_log: add different categories for gamephase and gamestate

 src/plugins/mongodb_log/mongodb_log_logger_thread.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

_Diff for modified files_:
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
index 7b2a3a37f..f9aa4a035 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
@@ -126,7 +126,12 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
        //track gamestate set to running
        if(msg_s.find("(key refbox state)") != std::string::npos || 
msg_s.find("(key refbox phase)") != std::string::npos) {
                basic::document df;
-               df.append(basic::kvp("gamestate",  
msg_s.substr(msg_s.find("(value ") + 7, msg_s.substr(msg_s.find("(value ") + 
7).find(")"))));
+               std::string value = msg_s.substr(msg_s.find("(value ") + 7, 
msg_s.substr(msg_s.find("(value ") + 7).find(")"));
+               if (value == "PRE_GAME" || value == "PRODUCTION" || value == 
"SETUP" || value ==  "POST_GAME") {
+                       df.append(basic::kvp("gamephase",  value));
+               } else {
+                       df.append(basic::kvp("gamestate",  value));
+               }
                df.append(basic::kvp("set", nowd));
                df.append(basic::kvp("game", gametime_));
                
mongodb_client->database(database_)["gamestate_recovery_test"].insert_one(df.view());

- *commit* 5f64c65341c655ad8cca7f67396e99cf2b6e4457 - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Wed Mar 24 16:03:28 2021 +0100
Subject: mongodb_log: add refbox/comm to tracked facts

 src/plugins/mongodb_log/mongodb_log_logger_thread.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

_Diff for modified files_:
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
index f9aa4a035..d8a3147e2 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
@@ -152,7 +152,8 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
        if ((msg_s.find("(wm-fact (id \"/domain/") != std::string::npos
                || msg_s.find("(wm-fact (id \"/refbox/") != std::string::npos
                || msg_s.find("(wm-fact (id \"/order/") != std::string::npos)
-           && msg_s.find("==>") != std::string::npos) {
+           && msg_s.find("==>") != std::string::npos
+               && msg_s.find("(wm-fact (id \"/refbox/comm") == 
std::string::npos) {
                basic::document df;
                basic::document dfc;
                df.append(basic::kvp("id",

- *commit* 3402bda6276c9b59e93a313e54838b69807ebb49 - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Wed Mar 24 16:04:15 2021 +0100
Subject: mongodb_log: fix broken retraction tracking

 src/plugins/mongodb_log/mongodb_log_logger_thread.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
index d8a3147e2..0efff6351 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
@@ -200,8 +200,11 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
        }
 
        //track retraction
-       if (msg_s.find("(wm-fact (id \"/domain/") != std::string::npos
-           && msg_s.find("<==") != std::string::npos) {
+       if ((msg_s.find("(wm-fact (id \"/domain/") != std::string::npos
+               || msg_s.find("(wm-fact (id \"/refbox/") != std::string::npos
+               || msg_s.find("(wm-fact (id \"/order/") != std::string::npos)
+           && msg_s.find("<==") != std::string::npos
+               && msg_s.find("(wm-fact (id \"/refbox/comm") == 
std::string::npos) {
                std::string clips_id = msg_s.substr(msg_s.find("<== ") + 
4).substr(0, msg_s.find("(") - 5);
                
                
mongodb_client->database(database_)["gamestate_recovery_test"].update_one(

- *commit* 65dff357971ac6817a3fa5670c677ead7656c372 - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Sat Mar 27 20:11:14 2021 +0100
Subject: mongodb_log: switch to regex based comparison

 src/plugins/mongodb_log/mongodb_log_logger_thread.cpp | 15 +++++----------
 src/plugins/mongodb_log/mongodb_log_logger_thread.h   |  3 +++
 2 files changed, 8 insertions(+), 10 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
index 0efff6351..7e26006b8 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
@@ -71,6 +71,9 @@ MongoLogLoggerThread::init()
        collection_ = 
config->get_string_or_default("/plugins/mongodb/logger/collection", "msglog");
        mongocxx::uri uri("mongodb://localhost:27021");
        mongodb_client = new mongocxx::client(uri);
+
+    assert_regex = std::regex("==> f-[0-9]*\\s*\\(wm-fact \\(id 
\\\"\\/((refbox)|(order)|(domain))\\/(?!comm)");
+    retract_regex = std::regex("<== f-[0-9]*\\s*\\(wm-fact \\(id 
\\\"\\/((refbox)|(order)|(domain))\\/(?!comm)");
 }
 
 void
@@ -149,11 +152,7 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
        }
 
        //track assertion
-       if ((msg_s.find("(wm-fact (id \"/domain/") != std::string::npos
-               || msg_s.find("(wm-fact (id \"/refbox/") != std::string::npos
-               || msg_s.find("(wm-fact (id \"/order/") != std::string::npos)
-           && msg_s.find("==>") != std::string::npos
-               && msg_s.find("(wm-fact (id \"/refbox/comm") == 
std::string::npos) {
+    if (std::regex_search(msg_s, assert_regex)) {
                basic::document df;
                basic::document dfc;
                df.append(basic::kvp("id",
@@ -200,11 +199,7 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
        }
 
        //track retraction
-       if ((msg_s.find("(wm-fact (id \"/domain/") != std::string::npos
-               || msg_s.find("(wm-fact (id \"/refbox/") != std::string::npos
-               || msg_s.find("(wm-fact (id \"/order/") != std::string::npos)
-           && msg_s.find("<==") != std::string::npos
-               && msg_s.find("(wm-fact (id \"/refbox/comm") == 
std::string::npos) {
+    if (std::regex_search(msg_s, retract_regex)) {
                std::string clips_id = msg_s.substr(msg_s.find("<== ") + 
4).substr(0, msg_s.find("(") - 5);
                
                
mongodb_client->database(database_)["gamestate_recovery_test"].update_one(
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.h 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.h
index b8445739d..62a1f1693 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.h
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.h
@@ -31,6 +31,7 @@
 #include <plugins/mongodb/aspect/mongodb.h>
 
 #include <string>
+#include <regex>
 
 namespace fawkes {
 class Mutex;
@@ -108,6 +109,8 @@ private:
        std::string            collection_;
        bsoncxx::types::b_date 
gametime_{std::chrono::high_resolution_clock::now()};
        fawkes::Mutex *        mutex_;
+       std::regex                         assert_regex;
+       std::regex                         retract_regex;
 };
 
 #endif

- *commit* 7a047c089235c9db507140b5e510494fbd5b2640 - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Sat Mar 27 20:20:39 2021 +0100
Subject: mongodb_log: use variable for collection name

 src/plugins/mongodb_log/mongodb_log_logger_thread.cpp | 8 ++++----
 src/plugins/mongodb_log/mongodb_log_logger_thread.h   | 1 +
 2 files changed, 5 insertions(+), 4 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
index 7e26006b8..1c28160ad 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
@@ -137,7 +137,7 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
                }
                df.append(basic::kvp("set", nowd));
                df.append(basic::kvp("game", gametime_));
-               
mongodb_client->database(database_)["gamestate_recovery_test"].insert_one(df.view());
+               
mongodb_client->database(database_)[collection_name].insert_one(df.view());
        }
 
        //track rule firing
@@ -148,7 +148,7 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
                                                  msg_s.find("f-") - 2 - 
msg_s.find("FIRE") - 10)));
                df.append(basic::kvp("fired", nowd));
                df.append(basic::kvp("game", gametime_));
-               
mongodb_client->database(database_)["gamestate_recovery_test"].insert_one(df.view());
+               
mongodb_client->database(database_)[collection_name].insert_one(df.view());
        }
 
        //track assertion
@@ -195,14 +195,14 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
                dfc.append(basic::kvp("msg", msg_s));
                dfc.append(
                  basic::kvp("clips-id", msg_s.substr(msg_s.find("==> ") + 
4).substr(0, msg_s.find("(") - 5)));
-               
mongodb_client->database(database_)["gamestate_recovery_test"].insert_one(dfc.view());
+               
mongodb_client->database(database_)[collection_name].insert_one(dfc.view());
        }
 
        //track retraction
     if (std::regex_search(msg_s, retract_regex)) {
                std::string clips_id = msg_s.substr(msg_s.find("<== ") + 
4).substr(0, msg_s.find("(") - 5);
                
-               
mongodb_client->database(database_)["gamestate_recovery_test"].update_one(
+               mongodb_client->database(database_)[collection_name].update_one(
                  make_document(kvp("clips-id", clips_id),kvp("game", 
gametime_)),
                  make_document(kvp("$set", make_document(kvp("retracted", 
nowd)))));
        }
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.h 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.h
index 62a1f1693..4bca3a2da 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.h
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.h
@@ -111,6 +111,7 @@ private:
        fawkes::Mutex *        mutex_;
        std::regex                         assert_regex;
        std::regex                         retract_regex;
+       std::string                        collection_name = 
"gamestate_recovery";
 };
 
 #endif

- *commit* 67dcb6983b724750993609027ad9b9c49f243563 - - - - - - - - - -
Author:  Daniel Swoboda <swob...@kbsg.rwth-aachen.de>
Date:    Sat Mar 27 20:34:45 2021 +0100
Subject: mongodb_log: fix formatting

 .../mongodb_log/mongodb_log_logger_thread.cpp      | 30 ++++++++++++----------
 .../mongodb_log/mongodb_log_logger_thread.h        |  8 +++---
 2 files changed, 21 insertions(+), 17 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
index 1c28160ad..44b849acb 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.cpp
@@ -72,8 +72,10 @@ MongoLogLoggerThread::init()
        mongocxx::uri uri("mongodb://localhost:27021");
        mongodb_client = new mongocxx::client(uri);
 
-    assert_regex = std::regex("==> f-[0-9]*\\s*\\(wm-fact \\(id 
\\\"\\/((refbox)|(order)|(domain))\\/(?!comm)");
-    retract_regex = std::regex("<== f-[0-9]*\\s*\\(wm-fact \\(id 
\\\"\\/((refbox)|(order)|(domain))\\/(?!comm)");
+       assert_regex =
+         std::regex("==> f-[0-9]*\\s*\\(wm-fact \\(id 
\\\"\\/((refbox)|(order)|(domain))\\/(?!comm)");
+       retract_regex =
+         std::regex("<== f-[0-9]*\\s*\\(wm-fact \\(id 
\\\"\\/((refbox)|(order)|(domain))\\/(?!comm)");
 }
 
 void
@@ -92,8 +94,8 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
                                      const char *format,
                                      va_list     va)
 {
-       MutexLocker            lock(mutex_);
-       if(config->get_string("fawkes/agent/name") != "Icks") {
+       MutexLocker lock(mutex_);
+       if (config->get_string("fawkes/agent/name") != "Icks") {
                return;
        }
        bsoncxx::types::b_date nowd{std::chrono::high_resolution_clock::now()};
@@ -127,13 +129,15 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
        std::string msg_s(msg);
 
        //track gamestate set to running
-       if(msg_s.find("(key refbox state)") != std::string::npos || 
msg_s.find("(key refbox phase)") != std::string::npos) {
+       if (msg_s.find("(key refbox state)") != std::string::npos
+           || msg_s.find("(key refbox phase)") != std::string::npos) {
                basic::document df;
-               std::string value = msg_s.substr(msg_s.find("(value ") + 7, 
msg_s.substr(msg_s.find("(value ") + 7).find(")"));
-               if (value == "PRE_GAME" || value == "PRODUCTION" || value == 
"SETUP" || value ==  "POST_GAME") {
-                       df.append(basic::kvp("gamephase",  value));
+               std::string     value =
+                 msg_s.substr(msg_s.find("(value ") + 7, 
msg_s.substr(msg_s.find("(value ") + 7).find(")"));
+               if (value == "PRE_GAME" || value == "PRODUCTION" || value == 
"SETUP" || value == "POST_GAME") {
+                       df.append(basic::kvp("gamephase", value));
                } else {
-                       df.append(basic::kvp("gamestate",  value));
+                       df.append(basic::kvp("gamestate", value));
                }
                df.append(basic::kvp("set", nowd));
                df.append(basic::kvp("game", gametime_));
@@ -152,7 +156,7 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
        }
 
        //track assertion
-    if (std::regex_search(msg_s, assert_regex)) {
+       if (std::regex_search(msg_s, assert_regex)) {
                basic::document df;
                basic::document dfc;
                df.append(basic::kvp("id",
@@ -199,11 +203,11 @@ MongoLogLoggerThread::insert_message(LogLevel    ll,
        }
 
        //track retraction
-    if (std::regex_search(msg_s, retract_regex)) {
+       if (std::regex_search(msg_s, retract_regex)) {
                std::string clips_id = msg_s.substr(msg_s.find("<== ") + 
4).substr(0, msg_s.find("(") - 5);
-               
+
                mongodb_client->database(database_)[collection_name].update_one(
-                 make_document(kvp("clips-id", clips_id),kvp("game", 
gametime_)),
+                 make_document(kvp("clips-id", clips_id), kvp("game", 
gametime_)),
                  make_document(kvp("$set", make_document(kvp("retracted", 
nowd)))));
        }
        free(msg);
diff --git a/src/plugins/mongodb_log/mongodb_log_logger_thread.h 
b/src/plugins/mongodb_log/mongodb_log_logger_thread.h
index 4bca3a2da..9147e0464 100644
--- a/src/plugins/mongodb_log/mongodb_log_logger_thread.h
+++ b/src/plugins/mongodb_log/mongodb_log_logger_thread.h
@@ -30,8 +30,8 @@
 #include <core/threading/thread.h>
 #include <plugins/mongodb/aspect/mongodb.h>
 
-#include <string>
 #include <regex>
+#include <string>
 
 namespace fawkes {
 class Mutex;
@@ -109,9 +109,9 @@ private:
        std::string            collection_;
        bsoncxx::types::b_date 
gametime_{std::chrono::high_resolution_clock::now()};
        fawkes::Mutex *        mutex_;
-       std::regex                         assert_regex;
-       std::regex                         retract_regex;
-       std::string                        collection_name = 
"gamestate_recovery";
+       std::regex             assert_regex;
+       std::regex             retract_regex;
+       std::string            collection_name = "gamestate_recovery";
 };
 
 #endif



_______________________________________________
fawkes-commits mailing list
fawkes-commits@lists.kbsg.rwth-aachen.de
https://lists.kbsg.rwth-aachen.de/listinfo/fawkes-commits

Reply via email to