Gazebo | Ignition | Community
Ask Your Question

How to use simulation time between ROS2 and Ignition gazebo

asked 2021-02-19 18:51:52 -0500

ksk gravatar image

updated 2021-02-23 19:45:36 -0500

chapulina gravatar image


I learned that there is a system plugin called gazebo_ros_init on ROS2 (when using gazebo)

gazebo_ros_init plugin publishes the current time of the Gazebo simulation to the /clock topic,
and the ros2 node should have the use_sim_time parameter set on it.

but I don't know how to do the same thing when using ros2 and Ignition Gazebo.

Is there a plugin like gazebo_ros_init on Ignition gazebo or ROS2?

when I run the simulator these is a /clock topic. $ ign gazebo ooo.sdf

so I tried Integrate ROS2 with Ignition

$ ros2 run ros_ign_bridge parameter_bridge /clock@rosgraph_msgs/msg/Clock@ignition.msgs.Clock

and I set use_sim_time parameter for true on ros2 node

$ ros2 param set /node_name use_sim_time true

However I can't seem to do it well.

If you have any Information of Integrate the time between ros2 and ignition gazebo, please let me know.

Thank you.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-02-23 19:47:50 -0500

chapulina gravatar image

Is there a plugin like gazebo_ros_init on Ignition gazebo or ROS2?

No, there isn't a plugin. Using the bridge like you did is the correct thing.

However I can't seem to do it well.

What's happening that isn't working for you? Can you echo the /clock topic on the ROS 2 side?

Another thing you can try is launching the bridge on a launch file:

bridge = Node( package='ros_ign_bridge', executable='parameter_bridge', arguments=['/clock@rosgraph_msgs/msg/Clock@ignition.msgs.Clock'], output='screen' )

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2021-02-19 18:43:08 -0500

Seen: 842 times

Last updated: Feb 23 '21