Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time drift between 'MORSE time' and 'ROS time' #783

Open
warp1337 opened this issue Feb 16, 2018 · 2 comments
Open

Time drift between 'MORSE time' and 'ROS time' #783

warp1337 opened this issue Feb 16, 2018 · 2 comments

Comments

@warp1337
Copy link

warp1337 commented Feb 16, 2018

When running MORSE for some time, like 1 hour (or so) I noticed
that the time stamp of ROS images (e.g. video camera) differs from
what the actual ROS time says.

Add a fakerobot and e.g. this snippet:

videocamera_top = VideoCamera()
videocamera_top.properties(cam_width=640,
                           cam_height=480,
                           capturing=True,
                           Vertical_Flip=True,
                           cam_near=0.01)
videocamera_top.frequency(CAM_FREQUENCY)
videocamera_top.add_interface("ros", topic="/pepper_robot/camera/front/",
                              topic_suffix='image_raw',
                              frame_id='CameraTop_optical_frame',
                              parent_frame_id='Head',
                              pub_tf=False)
fakerobot_topcam.append(videocamera_top)

This is a little hard to reproduce since I have vision pipeline
that copies headers from one message to another and then
computes diverse TF transforms. However, the basis time stamp
is the one of the source image generated by MORSE --- the
one that drifts over time.

I also believe I have found the problem:

https://github.com/morse-simulator/morse/blob/master/src/morse/middleware/ros/abstract_ros.py#L112

If you replace that line with rospy.Time.now() everything seems to be fine again.
I am currently running a longer test, but it might be a good idea to reproduce this.

Cheers,
Flo

  • MORSE version: morse UNKNOWN-dirty (apt version in Ubuntu 16.04)
  • Blender version: /usr/bin/blender... Found v.2.76.0
  • Python version: Python 3.5.2
@warp1337
Copy link
Author

Okay confirmed. Using rospy.Time.now() fixes the problem. At least for me. @severin-lemaignan @pierriko

@adegroote
Copy link
Contributor

Who generate /clock ? Do you use /use_sim_time ?
I check the code, and there is maybe some issue, but clock and sensors use the same source of infromation (parent.gettime()), so the information should be consistent (if you use simulated time generated by Morse).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants