[Fawkes Git] branch/fzwilling/robot-memory: 2 revs updated. (0.5.0-3438-g07f7e5c)

Frederik Zwilling zwilling at kbsg.rwth-aachen.de
Fri Nov 11 17:39:25 CET 2016


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

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

The branch, fzwilling/robot-memory has been updated
        to  07f7e5cf910ae74eddc6ff63be9ce99d19c56a09 (commit)
       via  ccb31729db73b7f7b75ab477466e35760d92c02b (commit)
      from  899cf264ac4bfcc5125896d26ef30150de1822e9 (commit)

http://git.fawkesrobotics.org/fawkes.git/fzwilling/robot-memory

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 ccb31729db73b7f7b75ab477466e35760d92c02b
Author:     Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
AuthorDate: Fri Nov 11 16:23:33 2016 +0100
Commit:     Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
CommitDate: Fri Nov 11 17:39:18 2016 +0100

    clips-robot-memory: fixed getting symbol multifields from documents

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 07f7e5cf910ae74eddc6ff63be9ce99d19c56a09
Author:     Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
AuthorDate: Fri Nov 11 17:25:30 2016 +0100
Commit:     Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
CommitDate: Fri Nov 11 17:39:21 2016 +0100

    clips-robot-memory: better distinction of string and symbol values

http://git.fawkesrobotics.org/fawkes.git/commit/07f7e5c
http://trac.fawkesrobotics.org/changeset/07f7e5c

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


- *Summary* -----------------------------------------------------------
 .../clips_robot_memory_thread.cpp                  |    5 +++--
 src/plugins/clips-robot-memory/robot-memory.clp    |   15 ++++++++++-----
 2 files changed, 13 insertions(+), 7 deletions(-)


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

- *commit* ccb31729db73b7f7b75ab477466e35760d92c02b - - - - - - - - - -
Author:  Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
Date:    Fri Nov 11 16:23:33 2016 +0100
Subject: clips-robot-memory: fixed getting symbol multifields from documents

 src/plugins/clips-robot-memory/robot-memory.clp |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/clips-robot-memory/robot-memory.clp b/src/plugins/clips-robot-memory/robot-memory.clp
index 2cb9f9f..7a0ff95 100644
--- a/src/plugins/clips-robot-memory/robot-memory.clp
+++ b/src/plugins/clips-robot-memory/robot-memory.clp
@@ -64,8 +64,13 @@
     (progn$ (?slot ?keys)
       (if (deftemplate-slot-existp ?relation (sym-cat ?slot)) then
         (if (deftemplate-slot-multip ?relation (sym-cat ?slot))
-          then
-          (bind ?values (str-cat ?values "(" ?slot " " (implode$ (bson-get-array ?doc ?slot)) ")"))
+	  then
+	  (bind ?arr-str (bson-get-array ?doc ?slot))
+	  (bind ?arr (create$))
+	  (progn$ (?i ?arr-str)
+	    (bind ?arr (create$ ?arr (sym-cat ?i)))
+	  )
+          (bind ?values (str-cat ?values "(" ?slot " " (implode$ ?arr) ")"))
           else
           (bind ?values (str-cat ?values "(" ?slot " " (bson-get ?doc ?slot) ")"))
         )
@@ -76,7 +81,7 @@
       (bind ?values (str-cat ?values "(" ?relation " " (implode$ (bson-get-array ?doc "values")) ")"))
     )
   )
-
+  ;(printout t "Asserting:" (str-cat "(" ?relation " " ?values ")") crlf)
   (assert-string (str-cat "(" ?relation " " ?values ")"))
 )
 

- *commit* 07f7e5cf910ae74eddc6ff63be9ce99d19c56a09 - - - - - - - - - -
Author:  Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
Date:    Fri Nov 11 17:25:30 2016 +0100
Subject: clips-robot-memory: better distinction of string and symbol values

 .../clips_robot_memory_thread.cpp                  |    5 +++--
 src/plugins/clips-robot-memory/robot-memory.clp    |    4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

_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 ec8043f..3b9e4f9 100644
--- a/src/plugins/clips-robot-memory/clips_robot_memory_thread.cpp
+++ b/src/plugins/clips-robot-memory/clips_robot_memory_thread.cpp
@@ -169,11 +169,12 @@ ClipsRobotMemoryThread::clips_bson_append(void *bson, std::string field_name, CL
       break;
 
     case CLIPS::TYPE_SYMBOL:
-    case CLIPS::TYPE_STRING:
     case CLIPS::TYPE_INSTANCE_NAME:
       b->append(field_name, value.as_string());
       break;
-
+    case CLIPS::TYPE_STRING:
+      b->append(field_name, std::string("\"") + value.as_string() + std::string("\""));
+      break;
     case CLIPS::TYPE_EXTERNAL_ADDRESS:
       {
   mongo::BSONObjBuilder *subb = static_cast<mongo::BSONObjBuilder *>(value.as_address());
diff --git a/src/plugins/clips-robot-memory/robot-memory.clp b/src/plugins/clips-robot-memory/robot-memory.clp
index 7a0ff95..291f92a 100644
--- a/src/plugins/clips-robot-memory/robot-memory.clp
+++ b/src/plugins/clips-robot-memory/robot-memory.clp
@@ -19,7 +19,7 @@
 (deffunction rm-structured-fact-to-bson (?fact)
   (bind ?doc (bson-create))
   (bind ?templ (fact-relation ?fact))
-  (bson-append ?doc "relation" (str-cat ?templ))
+  (bson-append ?doc "relation" (sym-cat ?templ))
   ;append kv-pair for each field
   (progn$ (?slot (fact-slot-names ?fact))
     (if (deftemplate-slot-multip ?templ ?slot)
@@ -40,7 +40,7 @@
 (deffunction rm-ordered-fact-to-bson (?fact)
   (bind ?doc (bson-create))
   (bind ?templ (fact-relation ?fact))
-  (bson-append ?doc "relation" (str-cat ?templ))
+  (bson-append ?doc "relation" (sym-cat ?templ))
   ;append values as array
   (bson-append-array ?doc "values" (fact-slot-value ?fact implied))
   (return ?doc)




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


More information about the fawkes-commits mailing list