gazebosim / ros_gz

Integration between ROS (1 and 2) and Gazebo simulation
https://gazebosim.org
Apache License 2.0
249 stars 138 forks source link

[ros2] Enable ROS (or system) time header stamps in ROS Bridge #157

Open vatanaksoytezer opened 3 years ago

vatanaksoytezer commented 3 years ago

Environment

Description

Steps to reproduce

I currently use https://github.com/vatanaksoytezer/ros_ign/pull/1 to work around this issue. I didn't bothered to open up a PR since this wouldn't get merged and breaks the sim time. But I would love to contribute if you point me out some ways through a parameter to add this functionality. I think I could also create and publish clock messages from ros2 to ignition, but that seems unintuitive and I am not even sure that would work.

DLu commented 3 years ago

Thoughts @caguero ?

chapulina commented 3 years ago

Being able to only pull data with sim or real time is problematic due to time disagreements between ros nodes and ignition for some packages such as moveit2.

I may be mistaken, but shouldn't MoveIt be using sim time in this situation for consistency?

Having an option to use the bridge with ros (or system) time.

Using system time with simulation seems unreliable to me. Simulation rarely runs exactly at real time, and depending on how fast or slow the simulation is running, you may end up with various strange behaviours.

But I would love to contribute if you point me out some ways through a parameter to add this functionality.

But if this is really the feature that you need, maybe an environment variable like ROS_IGN_TIME=system could be used to switch the time source?