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

what's the diff. between rospy.Time(0) and rospy.Time.now()?

asked 2016-09-06 04:21:32 -0600

sonictl gravatar image

rospy.Time(0) 这是什么含义? 跟rospy.Time.now() 有啥区别? Hi, I'm learning tf and time at this link

and I'm confused about the different between rospy.Time(0) and rospy.Time.now()

Could you explain it for me?

Thank you very much!!

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
12

answered 2016-09-06 05:29:25 -0600

gvdhoorn gravatar image

updated 2016-09-06 08:52:39 -0600

I'm confused about the different between rospy.Time(0) and rospy.Time.now()

rospy.Time.now() just returns the current 'wall clock time' (or the simulated clock, depending on whether you have a Clock server running).

rospy.Time(0) constructs a Time instance that has special significance in TF contexts: it will cause lookupTransform(..) and friends to return the latest available data for a specific transform, instead of the data at a specific point in time.

edit flag offensive delete link more
0

answered 2016-09-06 05:06:26 -0600

DinnerHowe gravatar image

updated 2019-01-15 15:42:43 -0600

130s gravatar image

the tutorial you referenced to clearly explains to you answer

for rospy.Time.now():

When a broadcaster sends out a transform, it takes some time before that transform gets into the buffer (usually a couple of milliseconds). So, when you request a frame transform at time "now", you should wait a few milliseconds for that information to arrive

Just to teach you about the tf buffer and the time delays that are associated with it. For real tf use cases, it is often perfectly fine to use Time(0)

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2016-09-06 04:21:32 -0600

Seen: 9,540 times

Last updated: Jan 15 '19