Changes have been pushed for the repository "fawkes.git".
(Fawkes Robotics Software Framework)

Clone:  g...@git.fawkesrobotics.org:fawkes.git
Gitweb: http://git.fawkesrobotics.org/fawkes.git
Trac:   http://trac.fawkesrobotics.org

The branch, thofmann/clips-executive-pddl has been updated
        to  f1bd7e446b8aa9f5dd0d8013159eff59bb34e6ae (commit)
      from  d9670b4da4bd474b2e71bac71473a7e46b08ac55 (commit)

http://git.fawkesrobotics.org/fawkes.git/thofmann/clips-executive-pddl

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 f1bd7e446b8aa9f5dd0d8013159eff59bb34e6ae
Author:     Till Hofmann <hofm...@kbsg.rwth-aachen.de>
AuthorDate: Fri Feb 2 12:37:46 2018 +0100
Commit:     Till Hofmann <hofm...@kbsg.rwth-aachen.de>
CommitDate: Fri Feb 2 12:37:46 2018 +0100

    clips-executive: always use the min non-existing id for new actions
    
    Do not use the index of the action in the plan as action id, as this
    results in actions with the same IDs if you call the planner multiple
    times. Instead, check what the current max id is, and use the max id + 1
    as new action ID.

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

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


- *Summary* -----------------------------------------------------------
 src/plugins/clips-executive/clips/pddl.clp |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)


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

- *commit* f1bd7e446b8aa9f5dd0d8013159eff59bb34e6ae - - - - - - - - - -
Author:  Till Hofmann <hofm...@kbsg.rwth-aachen.de>
Date:    Fri Feb 2 12:37:46 2018 +0100
Subject: clips-executive: always use the min non-existing id for new actions

 src/plugins/clips-executive/clips/pddl.clp |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/clips-executive/clips/pddl.clp 
b/src/plugins/clips-executive/clips/pddl.clp
index 0fc32e5..955e0b8 100644
--- a/src/plugins/clips-executive/clips/pddl.clp
+++ b/src/plugins/clips-executive/clips/pddl.clp
@@ -82,6 +82,13 @@
   (modify ?p (status PLANNED))
 )
 
+(deffunction pddl-get-next-action-id ()
+  "Get the ID of the next action, i.e., the max ID of all current actions + 1"
+  (bind ?i 1)
+  (do-for-all-facts ((?a plan-action)) (> ?a:id ?i) (bind ?i (+ 1 ?a:id)))
+  (return ?i)
+)
+
 (defrule pddl-expand-goal
   "Fetch the resulting plan from robot memory and expand the goal."
   ?g <- (goal (id ?goal-id) (mode SELECTED))
@@ -109,7 +116,7 @@
     (assert
       (plan (id ?plan-id) (goal-id ?goal-id))
       (plan-action
-        (id ?action-index)
+        (id (pddl-get-next-action-id))
         (plan-id ?plan-id)
         (action-name (sym-cat (bson-get ?action "name")))
         (param-values ?param-values)




-- 
Fawkes Robotics Framework                 http://www.fawkesrobotics.org
_______________________________________________
fawkes-commits mailing list
fawkes-commits@lists.kbsg.rwth-aachen.de
https://lists.kbsg.rwth-aachen.de/listinfo/fawkes-commits

Reply via email to