[Fawkes Git] branch/sschoenitz/global_msec: created (0.5.0-3083-g50c4bb9)

Sebastian Schoenitz sebastian.schoenitz at ima-zlw-ifu.rwth-aachen.de
Thu Apr 14 14:37:45 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/global_msec has been created
        at  50c4bb919d11c45ea9aef45046a1b827e883af0d (commit)

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

- *Log* ---------------------------------------------------------------
commit 50c4bb919d11c45ea9aef45046a1b827e883af0d
Author:     Sebastian Schoenitz <sebastian.schoenitz at ima-zlw-ifu.rwth-aachen.de>
AuthorDate: Thu Apr 14 10:57:06 2016 +0200
Commit:     Sebastian Schoenitz <sebastian.schoenitz at ima-zlw-ifu.rwth-aachen.de>
CommitDate: Thu Apr 14 10:57:06 2016 +0200

    jumstate.lua: Measuring the time within states
    
    Changed do_init() to measure the time entering a state.
    Writing own do_exit() in order to measure the time leaving a state and
    cumulate the time spend in this state.

http://git.fawkesrobotics.org/fawkes.git/commit/50c4bb9
http://trac.fawkesrobotics.org/changeset/50c4bb9

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


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


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

- *commit* 50c4bb919d11c45ea9aef45046a1b827e883af0d - - - - - - - - - -
Author:  Sebastian Schoenitz <sebastian.schoenitz at ima-zlw-ifu.rwth-aachen.de>
Date:    Thu Apr 14 10:57:06 2016 +0200
Subject: jumstate.lua: Measuring the time within states

 src/lua/fawkes/fsm/jumpstate.lua |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

_Diff for modified files_:
diff --git a/src/lua/fawkes/fsm/jumpstate.lua b/src/lua/fawkes/fsm/jumpstate.lua
index b75471e..787e3b1 100644
--- a/src/lua/fawkes/fsm/jumpstate.lua
+++ b/src/lua/fawkes/fsm/jumpstate.lua
@@ -52,8 +52,8 @@ JumpState = { comment           = "",
 	      init              = State.init,
 	      exit              = State.exit,
 	      loop              = State.loop,
-	      reset             = State.reset,
-	      do_exit           = State.do_exit}
+	      reset             = State.reset}--,
+	      --do_exit           = State.do_exit}
 
 --- Create new jump state.
 -- @param o table with initializations for the object.
@@ -84,6 +84,7 @@ end
 -- executed for every state for derived states. 
 -- @param ... Any parameters, passed to the init() function.
 function JumpState:do_init(...)
+   self.starttime = fawkes.Time:new():in_msec()
    local rv = { self:try_transitions(true) }
    if next(rv) then return unpack(rv) end
    self:init(...)
@@ -94,6 +95,19 @@ function JumpState:do_init(...)
 end
 
 
+--- Execute exit routines.
+--
+-- at param ... Any parameters, passed to exit() function
+function JumpState:do_exit(...)
+   self:exit(...)
+   if self.cumulative_time == nil then
+      self.cumulative_time = 0
+   end
+   self.endtime=fawkes.Time:new():in_msec()
+   self.cumulative_time = self.cumulative_time+self.endtime-self.starttime
+   
+end
+
 --- Execute jump state loop.
 -- This will execute the loop and afterwards check if any jump condition
 -- of the registered transitions holds. Iff one holds the checks are immediately




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


More information about the fawkes-commits mailing list