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

Revision history [back]

How are you accessing these stamps? Internally they are stored using two 32 bit integers, one holding the seconds and the other holding nanoseconds. This is described here.

However you can use the toSec() method to convert the value to a 64 bit float value in seconds which will be easier to work with. You might want to use durations from the start of your experiment instead of absolute time stamps, because the time stamps are relative to new years 1980. If that's measured in nanoseconds then you'll get the huge numbers your seeing.

To summarise. Use a ros::Duration to get the time of each data point from the start of the experiment. Then use .toSec() to convert those durations to seconds for external processing.

Hope this helps.