[Fawkes Git] branch/sschoenitz/timeout: created (0.5.0-3081-gc5d5075)

Sebastian Schoenitz sebastian.schoenitz at ima-zlw-ifu.rwth-aachen.de
Tue Apr 12 21:01:00 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/timeout has been created
        at  c5d50752f402d871f34eeca552e1e127084053c1 (commit)

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

- *Log* ---------------------------------------------------------------
commit c5d50752f402d871f34eeca552e1e127084053c1
Author:     Sebastian Schoenitz <sebastian.schoenitz at ima-zlw-ifu.rwth-aachen.de>
AuthorDate: Tue Apr 12 20:46:37 2016 +0200
Commit:     Sebastian Schoenitz <sebastian.schoenitz at ima-zlw-ifu.rwth-aachen.de>
CommitDate: Tue Apr 12 20:46:37 2016 +0200

    jumpstate: changed time-resolution to msec
    
    Switched from os.time to fawkes' time. Implemented new difftime, because
    os.difftime wasn't any longer sufficient.

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

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


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


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

- *commit* c5d50752f402d871f34eeca552e1e127084053c1 - - - - - - - - - -
Author:  Sebastian Schoenitz <sebastian.schoenitz at ima-zlw-ifu.rwth-aachen.de>
Date:    Tue Apr 12 20:46:37 2016 +0200
Subject: jumpstate: changed time-resolution to msec

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

_Diff for modified files_:
diff --git a/src/lua/fawkes/fsm/jumpstate.lua b/src/lua/fawkes/fsm/jumpstate.lua
index 801882a..455b6e4 100644
--- a/src/lua/fawkes/fsm/jumpstate.lua
+++ b/src/lua/fawkes/fsm/jumpstate.lua
@@ -303,15 +303,23 @@ function JumpState:jumpcond_true()
    return true
 end
 
+--- Mimics the os.difftime for the time in milli- respectively microsecconds
+-- @param time in milliseconds
+-- @return time difference
+function difftime(starttime)
+	local	time=fawkes.Time:new() 
+	return (time:in_msec() - starttime)
+end
+
 --- Fires on timeout.
 -- @return true if the time ran out
 function JumpState:jumpcond_timeout()
-   return os.difftime(os.time(), self.timeout_start) >= self.timeout_time
+ return difftime(self.timeout_start) >= self.timeout_time
 end
 
 --- Initializes timeout value.
 function JumpState:init_timeout()
-   self.timeout_start = os.time()
+   self.timeout_start = fawkes.Time:new():in_msec()
 end
 
 




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


More information about the fawkes-commits mailing list