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, common/colli has been updated
        to  26446a759d995f487b1115cee8a9a7f38a4c5b87 (commit)
       via  985d63d3febd94adde5bf30cc4833ba9dabbec84 (commit)
      from  e6b7b9b7c07149437d255784e28eb2f5d28d71c6 (commit)

http://git.fawkesrobotics.org/fawkes.git/common/colli

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 985d63d3febd94adde5bf30cc4833ba9dabbec84
Author:     Bahram Maleki-Fard <maleki-f...@kbsg.rwth-aachen.de>
AuthorDate: Fri Oct 10 11:51:21 2014 +0200
Commit:     Bahram Maleki-Fard <maleki-f...@kbsg.rwth-aachen.de>
CommitDate: Fri Oct 10 11:51:21 2014 +0200

    skill relgoto: adapt to new NavigatorInterface DriveMode names

http://git.fawkesrobotics.org/fawkes.git/commit/985d63d
http://trac.fawkesrobotics.org/changeset/985d63d

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 26446a759d995f487b1115cee8a9a7f38a4c5b87
Author:     Bahram Maleki-Fard <maleki-f...@kbsg.rwth-aachen.de>
AuthorDate: Fri Oct 10 11:55:01 2014 +0200
Commit:     Bahram Maleki-Fard <maleki-f...@kbsg.rwth-aachen.de>
CommitDate: Fri Oct 10 11:55:01 2014 +0200

    colli: check if transform to laser is still up to date (fix #341)
    
    The previous fix attempt checked if occupancy-grid could be updated.
    That is not enough, because the TF cache can be long (it was 10sec
    in testing).
    We now check in colli_thread if the transform has been updated
    recently, otherwise the robot stops.

http://git.fawkesrobotics.org/fawkes.git/commit/26446a7
http://trac.fawkesrobotics.org/changeset/26446a7

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


- *Summary* -----------------------------------------------------------
 src/lua/skills/generic/relgoto.lua |    2 +-
 src/plugins/colli/colli_thread.cpp |   17 ++++++++++++++---
 src/plugins/colli/colli_thread.h   |    2 +-
 3 files changed, 16 insertions(+), 5 deletions(-)


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

- *commit* 985d63d3febd94adde5bf30cc4833ba9dabbec84 - - - - - - - - - -
Author:  Bahram Maleki-Fard <maleki-f...@kbsg.rwth-aachen.de>
Date:    Fri Oct 10 11:51:21 2014 +0200
Subject: skill relgoto: adapt to new NavigatorInterface DriveMode names

 src/lua/skills/generic/relgoto.lua |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

_Diff for modified files_:
diff --git a/src/lua/skills/generic/relgoto.lua 
b/src/lua/skills/generic/relgoto.lua
index 39d9133..68b15e8 100644
--- a/src/lua/skills/generic/relgoto.lua
+++ b/src/lua/skills/generic/relgoto.lua
@@ -137,7 +137,7 @@ end
 
 function RELGOTO:init()
    if self.fsm.vars.backwards then
-      
navigator:msgq_enqueue_copy(navigator.SetDriveModeMessage:new(navigator.SlowAllowBackward))
+      
navigator:msgq_enqueue_copy(navigator.SetDriveModeMessage:new(navigator.AllowBackward))
    end
 
    if self.fsm.vars.params.x ~= nil then

- *commit* 26446a759d995f487b1115cee8a9a7f38a4c5b87 - - - - - - - - - -
Author:  Bahram Maleki-Fard <maleki-f...@kbsg.rwth-aachen.de>
Date:    Fri Oct 10 11:55:01 2014 +0200
Subject: colli: check if transform to laser is still up to date (fix #341)

 src/plugins/colli/colli_thread.cpp |   17 ++++++++++++++---
 src/plugins/colli/colli_thread.h   |    2 +-
 2 files changed, 15 insertions(+), 4 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/colli/colli_thread.cpp 
b/src/plugins/colli/colli_thread.cpp
index 819c082..bbb7476 100644
--- a/src/plugins/colli/colli_thread.cpp
+++ b/src/plugins/colli/colli_thread.cpp
@@ -40,6 +40,7 @@
 #include <interfaces/Laser360Interface.h>
 #include <interfaces/NavigatorInterface.h>
 #include <utils/math/common.h>
+#include <tf/time_cache.h>
 
 #include <string>
 
@@ -309,7 +310,7 @@ ColliThread::loop()
 
   // check if we need to abort for some reason
   bool abort = false;
-  if( !interfaces_valid() ) {
+  if( !interface_data_valid() ) {
     escape_count_ = 0;
     abort = true;
 
@@ -740,7 +741,7 @@ ColliThread::interfaces_read()
 
 /// Check if the interface data is valid, i.e. not outdated
 bool
-ColliThread::interfaces_valid()
+ColliThread::interface_data_valid()
 {
   Time now(clock);
 
@@ -748,6 +749,7 @@ ColliThread::interfaces_valid()
    * a) laser or motor interface have no writer
    * b) there is no new laser data for a while, or
    * c) there is no motor data for a while and colli is currently moving
+   * d) transforms have not been updated in a while
    */
   if( !if_laser_->has_writer() || !if_motor_->has_writer() ) {
     logger->log_warn(name(), "Laser or Motor dead, no writing instance for 
interfaces!!!");
@@ -764,8 +766,17 @@ ColliThread::interfaces_valid()
     return false;
 
   } else {
+    // check if transforms are up to date
+    float diff = (now - tf_listener->get_frame( 
tf_listener->lookup_frame_number(cfg_frame_laser_) 
)->get_latest_timestamp()).in_sec();
+    if( diff > 2.f* cfg_iface_read_timeout_) {
+      logger->log_warn(name(), "Transform to laser_frame '%s' is too old (%f > 
%f)",
+                              cfg_frame_laser_.c_str(), diff, 
2.f*cfg_iface_read_timeout_);
+      return false;
 
-    return true;
+    } else {
+      // everything OK
+      return true;
+    }
   }
 }
 
diff --git a/src/plugins/colli/colli_thread.h b/src/plugins/colli/colli_thread.h
index 47716f0..394564a 100644
--- a/src/plugins/colli/colli_thread.h
+++ b/src/plugins/colli/colli_thread.h
@@ -195,7 +195,7 @@ class ColliThread
   void interfaces_read();
 
   /// Check if the interface data is valid, i.e. not outdated
-  bool interfaces_valid();
+  bool interface_data_valid();
 
   /// Check, in what state the colli is, and what to do
   void update_colli_state();




-- 
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