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

Different time zones between ros nodes

asked 2011-11-15 19:15:56 -0500

Victor Lopez gravatar image

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?

edit retag flag offensive close merge delete

Comments

Your lab must be very large...
Mac gravatar image Mac  ( 2011-11-17 16:31:04 -0500 )edit
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.
Victor Lopez gravatar image Victor Lopez  ( 2011-11-17 17:45:38 -0500 )edit
Yes, that can cause trouble for many components of Linux or Unix, not just for ROS.
joq gravatar image joq  ( 2011-11-18 03:10:18 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
4

answered 2011-11-16 00:39:30 -0500

DimitriProsser gravatar image

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).

edit flag offensive delete link more

Comments

You are right, I missunderstood the code.
Victor Lopez gravatar image Victor Lopez  ( 2011-11-17 17:52:40 -0500 )edit

Question Tools

Stats

Asked: 2011-11-15 19:15:56 -0500

Seen: 2,373 times

Last updated: Nov 16 '11