ros / geometry

Packages for common geometric calculations including the ROS transform library, "tf". Also includes ROS bindings for "bullet" physics engine and "kdl" kinematics/dynamics package.
172 stars 274 forks source link

tf Python `waitForTransform` API documentation #229

Open mitchallain opened 3 years ago

mitchallain commented 3 years ago

In the tf Python documentation, the Transformer.waitForTransform method lists that passing a value of rospy.Time() to the time parameter will "indicate present time".

time – time of the transformation, use rospy.Time() to indicate present time.

https://github.com/ros/geometry/blob/52ed78c8cf2891ae975fd5456fa91e9b4aad5c1a/tf/tf_python.rst http://docs.ros.org/en/melodic/api/tf/html/python/tf_python.html

However, I believe the underlying BufferCore.walkToTopParent type will lookup the latest common time.

  //If getting the latest get the latest common time
  if (time == ros::Time())
  {
    int retval = getLatestCommonTime(target_id, source_id, time, error_string);
    if (retval != tf2_msgs::TF2Error::NO_ERROR)
    {
      return retval;
    }
  }

https://github.com/ros/geometry2/blob/c73b5939723db078c9bbe18523230ad54f859682/tf2/src/buffer_core.cpp#L330-L338

I understand that this tf Python API is older and somewhat deprecated in favor of tf2. But can we update this waitForTransform method documentation? Something like:

time – time of the transformation, use rospy.Time() to indicate latest common time.

If someone can confirm my understanding is correct, then I would be happy to open the PR for the documentation.