[Fawkes Git] branch/sschoenitz/timer: created (0.5.0-3081-gccf0acb)

Sebastian Schoenitz sebastian.schoenitz at ima-zlw-ifu.rwth-aachen.de
Mon Apr 11 22:01:30 CEST 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, sschoenitz/timer has been created
        at  ccf0acb4e68cada3ee8842bfef86f90ee738c6cd (commit)

http://git.fawkesrobotics.org/fawkes.git/sschoenitz/timer

- *Log* ---------------------------------------------------------------
commit ccf0acb4e68cada3ee8842bfef86f90ee738c6cd
Author:     Sebastian Schoenitz <sebastian.schoenitz at ima-zlw-ifu.rwth-aachen.de>
AuthorDate: Mon Apr 11 20:49:53 2016 +0200
Commit:     Sebastian Schoenitz <sebastian.schoenitz at ima-zlw-ifu.rwth-aachen.de>
CommitDate: Mon Apr 11 22:01:20 2016 +0200

    Changes in clips_agent_thread, skillenv and subskill_jumstate in order to get the start and end-times of the skills

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

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


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


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

- *commit* ccf0acb4e68cada3ee8842bfef86f90ee738c6cd - - - - - - - - - -
Author:  Sebastian Schoenitz <sebastian.schoenitz at ima-zlw-ifu.rwth-aachen.de>
Date:    Mon Apr 11 20:49:53 2016 +0200
Subject: Changes in clips_agent_thread, skillenv and subskill_jumstate in order to get the start and end-times of the skills

 src/lua/skiller/skillenv.lua                   |    7 ++++++-
 src/lua/skiller/subskill_jumpstate.lua         |   15 +++++++++++++--
 src/plugins/clips-agent/clips_agent_thread.cpp |    9 +++++++--
 3 files changed, 26 insertions(+), 5 deletions(-)

_Diff for modified files_:
diff --git a/src/lua/skiller/skillenv.lua b/src/lua/skiller/skillenv.lua
index 362fc39..db08998 100644
--- a/src/lua/skiller/skillenv.lua
+++ b/src/lua/skiller/skillenv.lua
@@ -155,7 +155,6 @@ local skill_env_template = {
 -- @param skillspace skill space to initialize
 function init(skillspace)
    skill_space = skillspace
-
    skill_env_template.interfaces = interfaces
 
    if interfaces and interfaces.writing then
@@ -232,6 +231,7 @@ function reset_skills(t)
 	    for _, s in ipairs(m.depends_skills) do
 	       local sm = get_skill_module(s)
 	       print_debug("Resetting sub-skill " .. s .. " of skill " .. v)
+               print_debug("[SKILL] Resetting Subskill: ".. s .." | Timestamp: "..os.time().. " ")
 	       sm.reset()
 	    end
 	 end
@@ -554,6 +554,9 @@ end
 -- @param skill_name name of the skill that is about to start
 function skill_loop_begin(skill_name)
    --print("Skill " .. skill_name .. " starts execution")
+   
+   --print_debug("[SKILL] Started skill: ".. skill_name .." | Timestamp: "..os.time())
+   
    table.insert(active_skills, skill_name)
 end
 
@@ -572,12 +575,14 @@ function skill_loop_end(skill_name, status)
    if status == skillstati.S_FINAL then
       --print_debug("Skill function " .. skill_name .. " is final")
       table.insert(skill_status.final, skill_name)
+      print_debug("[SKILL] Stopped skill: ".. skill_name .." | Timestamp: "..os.time().. " | final")
    elseif status == skillstati.S_RUNNING then
       --print_debug("Skill function " .. skill_name .. " is *running*")
       table.insert(skill_status.running, skill_name)
    elseif status == skillstati.S_FAILED then
       --print_debug("Skill function " .. skill_name .. " has failed")
       table.insert(skill_status.failed, skill_name)
+      print_debug("[SKILL] Stopped skill: ".. skill_name .." | Timestamp: "..os.time().. " | failed")
    else
       print("Skill " .. skill_name .. " returned an invalid skill status (" .. status .. ")")
    end
diff --git a/src/lua/skiller/subskill_jumpstate.lua b/src/lua/skiller/subskill_jumpstate.lua
index c468e7f..01b8fb6 100644
--- a/src/lua/skiller/subskill_jumpstate.lua
+++ b/src/lua/skiller/subskill_jumpstate.lua
@@ -293,7 +293,12 @@ function SubSkillJumpState:do_init()
 	 table.insert(t, self:skillstring(skill))
       end
       print_debug("%s: executing %s", self.name, table.concat(t, "; "))
-   --elseif self.skill then
+     --SKILL_TIMER
+     --print_debug("[SKILL] Started Subskill: %s | Timestamp: %s ", self.name, os.time())
+     print_debug("[SKILL] Started Subskill: %s | Timestamp: %s", t[1], os.time())
+     --
+
+      --elseif self.skill then
    --   print_debug("%s: executing %s", self.name, self:skillstring(self.skill))
    end
 
@@ -314,7 +319,13 @@ function SubSkillJumpState:do_exit()
       s.status = skillstati.S_RUNNING
       s[1].reset()
    end
-   self:exit()
+     
+     self:exit()
+   --SKILL_TIMER
+   print_debug("[SKILL] Stopped Subskill: dummy | Timestamp: "..os.time())
+    --print_debug("[SKILL] Stopped Subskill: %s | Timestamp: %s", t, os.time())
+   --  print_debug("[SKILL] Started Subskill: %s | Timestamp: %s", self:skillstring(skill), os.time())
+   --
 end
 
 function SubSkillJumpState:skillstring(skill)
diff --git a/src/plugins/clips-agent/clips_agent_thread.cpp b/src/plugins/clips-agent/clips_agent_thread.cpp
index 85f58b5..a2e83a9 100644
--- a/src/plugins/clips-agent/clips_agent_thread.cpp
+++ b/src/plugins/clips-agent/clips_agent_thread.cpp
@@ -25,7 +25,7 @@
 #include <utils/misc/string_split.h>
 #include <interfaces/SwitchInterface.h>
 #include <core/threading/mutex_locker.h>
-
+#include <time.h>
 using namespace fawkes;
 
 /** @class ClipsAgentThread "clips_agent_thread.h"
@@ -277,7 +277,12 @@ ClipsAgentThread::clips_skill_call_ext(std::string skill_name, std::string skill
 
   } else {
     logger->log_info(name(), "Calling skill %s", skill_string.c_str());
-
+	//TIMER_SKILLS start
+	time_t t;
+	t= time(NULL);
+	logger->log_debug(name(), "[SKILL] Started skill: %s | Timestamp: %ld ", skill_name.c_str(),t);
+		
+	//TIMER_SKILL stop
     SkillerInterface::ExecSkillMessage *msg =
       new SkillerInterface::ExecSkillMessage(skill_string.c_str());
       




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


More information about the fawkes-commits mailing list