Revision: 7101
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7101&view=rev
Author:   gerkey
Date:     2008-10-16 08:57:01 +0000 (Thu, 16 Oct 2008)

Log Message:
-----------
Commented out bogus warning about empty queue after waiting.

Fixed apparent bug in amcl's data queuing.

Modified Paths:
--------------
    code/player/trunk/libplayercore/device.cc
    code/player/trunk/server/drivers/localization/amcl/amcl.cc

Modified: code/player/trunk/libplayercore/device.cc
===================================================================
--- code/player/trunk/libplayercore/device.cc   2008-10-16 07:48:50 UTC (rev 
7100)
+++ code/player/trunk/libplayercore/device.cc   2008-10-16 08:57:01 UTC (rev 
7101)
@@ -288,12 +288,11 @@
   Message* msg = NULL;
   if(threaded)
   {
-    // HACK: this loop should not be neccesary!
     // pthread_cond_wait does not garuntee no false wake up, so maybe it is.
     // test driver is still subscribed to prevent deadlocks on server shutdown
     while(driver->subscriptions > 0 && !(msg = resp_queue->Pop()))
     {
-      PLAYER_WARN("empty queue after waiting!");
+      //PLAYER_WARN("empty queue after waiting!");
       resp_queue->Wait(); // this is a cancelation point
     }
   }

Modified: code/player/trunk/server/drivers/localization/amcl/amcl.cc
===================================================================
--- code/player/trunk/server/drivers/localization/amcl/amcl.cc  2008-10-16 
07:48:50 UTC (rev 7100)
+++ code/player/trunk/server/drivers/localization/amcl/amcl.cc  2008-10-16 
08:57:01 UTC (rev 7101)
@@ -877,6 +877,9 @@
           {
             data = this->Pop();
             assert(data);
+            // Catch the pose and timestamp of the discarded action data
+            pose = ((AMCLOdomData*) data)->pose;
+            ts = data->time;
             delete data;
           }
           // avoid a busy loop while waiting for a sensor reading to
@@ -1324,7 +1327,11 @@
   pf_vector_t pose;
 
   this->Lock();
+  pthread_mutex_lock(&this->best_hyp_lock);
+  pose = this->best_hyp;
+  pthread_mutex_unlock(&this->best_hyp_lock);
 
+  /*
   max_weight = -1;
   for (i = 0; i < this->hyp_count; i++)
   {
@@ -1336,11 +1343,14 @@
       pose = hyp->pf_pose_mean;
     }
   }
+  */
 
   this->Unlock();
 
+  /*
   if (max_weight < 0.0)
     return;
+    */
 
   // Shift the robot figure
   rtk_fig_origin(this->robot_fig, pose.v[0], pose.v[1], pose.v[2]);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Playerstage-commit mailing list
Playerstage-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to