Failed to transform current pose to map frame: Lookup would require extrapolation 0.076000000s into

1. The reason for the error

The reason for the error is that tf will store the monitored content in a cache, and then read the relevant content, and this process may have a delay of several milliseconds, that is, the tf listener cannot monitor "now" transformation,

Two, the difference between rospy.Time() and rospy.Time.now()

rospy.Time.now():

rospy.Time.now() is a function call to get a timestamp object for the current system time.
Every time rospy.Time.now() is called, it returns a timestamp object for the current time.
This method can be used to get the current time in a ROS node and use it in the timestamp field of a message.
rospy. Time():

rospy.Time() is a constructor used to create a timestamp object.
When you use the rospy.Time() constructor, it creates a timestamp object representing 0 seconds, which is the default timestamp object.
This method is usually used to create a timestamp object in code, and set the value of the timestamp as needed.
the difference:

rospy.Time.now() is used to get the current time, each call will return a different timestamp object.
rospy.Time() is used to create a default timestamp object representing a timestamp of 0 seconds.

Three, solve

To change this error, you need to change the timestamp, you cannot use rospy.Time.now(), or the default timestamp given by the sensor, you need to use rospy.Time() to replace the original timestamp
insert image description here

Guess you like

Origin blog.csdn.net/weixin_72050316/article/details/131920411