diff --git a/crosbot_explore/src/nodes/astar.cpp b/crosbot_explore/src/nodes/astar.cpp index 3595ee74827d569d37ea429a73360541b9c38ddc..c2aa670b6be8c2c436ad944af1908644a637fe3c 100644 --- a/crosbot_explore/src/nodes/astar.cpp +++ b/crosbot_explore/src/nodes/astar.cpp @@ -66,14 +66,16 @@ public: voronoi = latestVoronoi; if (voronoi == NULL || voronoi->timestamp < Time(latestMap->header.stamp)) { Pose robot(INFINITY,INFINITY,INFINITY); + std::string mapFrame = latestMap->header.frame_id; + ros::Time timestamp = latestMap->header.stamp; if (baseFrame != "") { try { tf::StampedTransform transform; - tfListener.waitForTransform(voronoi->frame, baseFrame, - voronoi->timestamp.toROS(), ros::Duration(DEFAULT_MAXWAIT4TRANSFORM)); - tfListener.lookupTransform(voronoi->frame, - baseFrame, voronoi->timestamp.toROS(), transform); + tfListener.waitForTransform(mapFrame, baseFrame, + timestamp, ros::Duration(DEFAULT_MAXWAIT4TRANSFORM)); + tfListener.lookupTransform(mapFrame, + baseFrame, timestamp, transform); robot = transform; } catch (tf::TransformException& ex) { ERROR("astar: Error getting current robot transform. (%s)\n", ex.what());