ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This can happen if you have all links in your transform tree but they are not overlapping. This can happen if you have poor connectivity to part of your graph and part of the tree is significantly out of date.

The following test is an example: a->b is from t = 1,2,3 b->c is from 10,11,12 and it throws an extrapolation because there is no common time for which it can operate.

#include <tf/tf.h>
#include <gtest/gtest.h>


TEST(TimeCache, Repeatability)
{
  tf::Transformer tr;
  tf::StampedTransform t;
  t.setIdentity();
  t.child_frame_id_ = 'b';
  t.frame_id_ = 'a';

  t.stamp_ = ros::Time().fromNSec(1);
  tr.setTransform(t);

  t.stamp_ = ros::Time().fromNSec(2);
  tr.setTransform(t);

  t.stamp_ = ros::Time().fromNSec(3);
  tr.setTransform(t);

  t.child_frame_id_ = 'c';
  t.frame_id_ = 'b';

  t.stamp_ = ros::Time().fromNSec(10);
  tr.setTransform(t);

  t.stamp_ = ros::Time().fromNSec(11);
  tr.setTransform(t);

  t.stamp_ = ros::Time().fromNSec(12);
  tr.setTransform(t);


  std::string target = "a";
  std::string dest = "c";

  tr.lookupTransform(target, dest, ros::Time(), t);

}



int main(int argc, char **argv){
  testing::InitGoogleTest(&argc, argv);
  return RUN_ALL_TESTS();
}