Ask Your Question
0

how to work with ros time

asked 2013-02-07 17:36:22 -0600

mte2010 gravatar image

Hi,

I have saved some gps data using the gps fix message type. In this message, the gps data has a field called %time.

Except, this %time data is kind of weird. The format the %time values are in is of the following:

1355859745049430000

1355859746522960000

1355859747052170000

...

How do I convert this time data to something that I can work with, for example, 1, 2, 3, 4, 5 seconds, etc.

Thanks for the help.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-02-07 18:17:48 -0600

I don't see any ROS functions for doing this, but here's an algorithm in PHP that you could use: http://www.andrews.edu/~tzs/timeconv/timealgorithm.html

edit flag offensive delete link more

Comments

Hmm, this is talking about gps time. I looked into my data a bit more, and I found that: -this time data is actually rostime and not gps time, so basically I capture this gps data using play [rosbag_file_name] and then I just listen to my gps topic. So this time data is the same time data as rosbag

mte2010 gravatar imagemte2010 ( 2013-02-10 08:51:08 -0600 )edit

So, how would I convert this rosbag time to something in seconds that makes sense? Once again, this rosbag time looks like this: 1355885782739630000, 1355885782763280000, and my loop rate is at 50 hz or 0.02 seconds

mte2010 gravatar imagemte2010 ( 2013-02-10 08:54:18 -0600 )edit

The time field of the GPSFix message is supposed to be GPS time... how is that field getting filled? The ROS time should be in GPSFix.header.stamp

Jeffrey Kane Johnson gravatar imageJeffrey Kane Johnson ( 2013-02-10 09:00:25 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-02-07 17:36:22 -0600

Seen: 582 times

Last updated: Feb 07 '13

Related questions