Skip to content

Commit

Permalink
manually forward porting #68 to indigo
Browse files Browse the repository at this point in the history
  • Loading branch information
tfoote committed Sep 18, 2014
1 parent 5a2b08b commit 619a132
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions tf2_ros/include/tf2_ros/transform_listener.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class TransformListener
ros::Subscriber message_subscriber_tf_static_;
tf2::BufferCore& buffer_;
bool using_dedicated_thread_;
ros::Time last_update_;

void dedicatedListenerThread()
{
Expand Down
9 changes: 9 additions & 0 deletions tf2_ros/src/transform_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ void TransformListener::static_subscription_callback(const ros::MessageEvent<tf2

void TransformListener::subscription_callback_impl(const ros::MessageEvent<tf2_msgs::TFMessage const>& msg_evt, bool is_static)
{
ros::Time now = ros::Time::now();
if(now < last_update_){
ROS_WARN("Detected jump back in time. Clearing TF buffer.");
buffer_.clear();
}
last_update_ = now;



const tf2_msgs::TFMessage& msg_in = *(msg_evt.getConstMessage());
std::string authority = msg_evt.getPublisherName(); // lookup the authority
for (unsigned int i = 0; i < msg_in.transforms.size(); i++)
Expand Down

0 comments on commit 619a132

Please sign in to comment.