0
$\begingroup$

Rosanswers logo

Browsing the ros::now() code I've seen that it returns the local time, if I'm not mistaken it can cause some issues between computers that are on different time zones.

For instance, a robot might be on UTC, but a developer computer might be on a different time zone, wouldn't ros message timestamps be messed up and cause strange behaviour.

Shouldn't ros::timestamps be in UTC?


Originally posted by Victor Lopez on ROS Answers with karma: 651 on 2011-11-15

Post score: 1


Original comments

Comment by joq on 2011-11-18:
Yes, that can cause trouble for many components of Linux or Unix, not just for ROS.

Comment by Victor Lopez on 2011-11-17:
Hehehe, the situation is that the robot system time is UTC in order to store the logs from different robots in differents places with the same time zone. But a developer computer might be in his local time zone, and I was wondering if that could case problems.

Comment by Mac on 2011-11-17:
Your lab must be very large...

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

ros::Time::now() returns UTC. If you do a ros::Time::now().toSec(), it's going to give you the number of seconds since the Epoc (aka UTC).


Originally posted by DimitriProsser with karma: 11163 on 2011-11-16

This answer was ACCEPTED on the original site

Post score: 4


Original comments

Comment by Victor Lopez on 2011-11-17:
You are right, I missunderstood the code.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.