{"action":"closed","issue":{"url":"https://api.github.com/repos/ros/geometry/issues/120","repository_url":"https://api.github.com/repos/ros/geometry","labels_url":"https://api.github.com/repos/ros/geometry/issues/120/labels{/name}","comments_url":"https://api.github.com/repos/ros/geometry/issues/120/comments","events_url":"https://api.github.com/repos/ros/geometry/issues/120/events","html_url":"https://github.com/ros/geometry/issues/120","id":140236342,"number":120,"title":"tf2::lookupTransform with time 0 throws Extrapolation","user":{"login":"cyril42e","id":7440361,"avatar_url":"https://avatars.githubusercontent.com/u/7440361?v=3","gravatar_id":"","url":"https://api.github.com/users/cyril42e","html_url":"https://github.com/cyril42e","followers_url":"https://api.github.com/users/cyril42e/followers","following_url":"https://api.github.com/users/cyril42e/following{/other_user}","gists_url":"https://api.github.com/users/cyril42e/gists{/gist_id}","starred_url":"https://api.github.com/users/cyril42e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyril42e/subscriptions","organizations_url":"https://api.github.com/users/cyril42e/orgs","repos_url":"https://api.github.com/users/cyril42e/repos","events_url":"https://api.github.com/users/cyril42e/events{/privacy}","received_events_url":"https://api.github.com/users/cyril42e/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-11T16:59:19Z","updated_at":"2016-03-11T19:26:45Z","closed_at":"2016-03-11T19:26:45Z","body":"Here is my code, I first try to lookup the transform at some date, and if there is an extrapolation exception (usually because I'm trying to get in the future) I just ask for the latest tranform :\r\n\r\n\t\ttf2_ros::Buffer m_tf_buffer;\r\n\t\ttf2_ros::TransformListener m_tf_listener(m_tf_buffer);\r\n\r\n\t\tstd::cout << \"BEGIN\" << std::endl;\r\n\t\tgeometry_msgs::TransformStamped tf_pose;\r\n\t\ttry\r\n\t\t{\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\t\tstd::cerr << \"getTranform at \" << in_stamp.toSec() << std::endl;\r\n\t\t\t\t\t\ttf_pose = m_tf_buffer.lookupTransform(frame_id1, frame_id2, ros::Time(date));\r\n\t\t\t\t}\r\n\t\t\t\tcatch (const tf2::ExtrapolationException& e)\r\n\t\t\t\t{\r\n\t\t\t\t\t\tstd::cerr << e.what() << std::endl;\r\n\t\t\t\t\t\tstd::cerr << \"getTranform at *0* << std::endl;\r\n\t\t\t\t\t\ttf_pose = m_tf_buffer.lookupTransform(frame_id1, frame_id2, ros::Time(0.0));\r\n\t\t\t\t}\r\n\t\t}\r\n\t\tcatch (const tf2::ExtrapolationException& e)\r\n\t\t{\r\n\t\t\t\tstd::cerr << \"ERROR should not throw tf2::ExtrapolationException here ! : \" << e.what() << std::endl;\r\n\t\t\t\ttf_pose = m_tf_buffer.lookupTransform(frame_id1, frame_id2, ros::Time(0.0));\r\n\t\t\t\texit(1);\r\n\t\t}\r\n\r\nThe problem is that when I ask for the latest transform, I sometimes get an extrapolation exception because the \"asked\" date is too old (even though I did not ask any date, only the latest).\r\n\r\nThe output of the previous code is :\r\n\r\n>BEGIN\r\n>getTranform at 13.37\r\n>Lookup would require extrapolation into the future.  Requested time 13.370000000 but the latest data is at time 13.320000000, when looking up transform from frame [vehicle] to frame [world]\r\ngetTranform at *0*\r\n>ERROR should not throw tf2::ExtrapolationException here ! : Lookup would require extrapolation into the past.  Requested time 13.320000000 but the earliest data is at time 13.334000000, when looking up transform from frame [vehicle] to frame [world]\r\nterminate called after throwing an instance of 'tf2::ExtrapolationException'\r\n>  what():  Lookup would require extrapolation into the past.  Requested time 13.320000000 but the earliest data is at time 13.334000000, when looking up transform from frame [vehicle] to frame [world]\r\n\r\nWe can notice that the first exception states that the latest data is at time 13.32, but then the second exception states that the earliest data is at time 13.334, which is contradictory..."}}