Why is ros image timestamp value so small?(Python)

asked 2018-10-23 07:45:54 -0500

baelfire20 gravatar image

Hello there, I'm trying to compute the delay of my program by printing the difference between time.time() and img.header.secs. As stated in the documentation both python's time and ros's timestamp are measured in seconds since epoch. However my timestamps are around 10 * e5 while time.time() is much much larger. Does anyone have any idea why the timestamp value is so small? I should mention that I'm running this program in docker. I send the images from docker to host through an intermediary node, which simply retransmits data, I run the image through a neural network and I return the output(which in my case, for testing, is the timestamp of the image). Is it because I'm using an intermediary node? I didn't find any other way of comunicating from docker to host.

edit retag flag offensive close merge delete

Comments

Are you running any simulator?

gvdhoorn gravatar imagegvdhoorn ( 2018-10-23 07:50:55 -0500 )edit

No, I launched a usb_cam node to get data from my camera

baelfire20 gravatar imagebaelfire20 ( 2018-10-23 10:04:06 -0500 )edit

Is it possible that the clock in your docker container isn't synchronized with your host clock? It doesn't seem like this can happen often, but I see a few bug reports on google where it can happen if docker is running on OSX.

ahendrix gravatar imageahendrix ( 2018-10-24 02:30:26 -0500 )edit

I was thinking about that, but the timestamped data comes from docker and when I measure the delay I’m calling time.time() in a script that is in docker as well. Maybe python takes the time from host even if it is in docker?

baelfire20 gravatar imagebaelfire20 ( 2018-10-24 02:53:32 -0500 )edit