Gazebo | Ignition | Community
Ask Your Question

Gazebo Simulation Time Seems To Be Tied to Framerate? [Gazebo 7.0]

asked 2018-05-20 11:47:23 -0500

marc1990 gravatar image


I have a gazebo plugin where I simulate an ackerman motion model for a xacro robot. That is, I calculated forces and velocities based on steering inputs. Furthermore, I send steering and velocity values to a ros node to calculate a motion model.

This all works fine. However, when calculating the detaTime interval in the ros node I have to divide by a factor of 30. i.e. dt = (current time - last time)/ 30

Im thinking this is the gazebo framerate as it is around 30 fps. But even when only spawning the gazebo server (without the GUI) I still have to use this factor.

Where does this factor come from? Has anybody has similar issues?

edit retag flag offensive close merge delete


I'm new to Gazebo. As per my limited knowledge, Gazebo has it's own internal time clock, which is scaled according to the framerate and performance of the computer. That is where the scale factor in the bottom of the window comes from. It shows the time relative to real time, at which the sim is running.

varunvp gravatar imagevarunvp ( 2018-05-21 01:14:59 -0500 )edit

Are you using ros::time and not the normal time library? Simulation time is definitely not tied to framerate; it's tied to real time factor.

Raskkii gravatar imageRaskkii ( 2018-05-21 02:31:48 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-05-21 10:17:55 -0500

chapulina gravatar image

There seems to be a confusion between framerate (how many visual frames are rendered per second) and real-time-factor (how many seconds of simulation time are elapsed for each second of "real" (wall) time).

The framerate of Gazebo's graphical interface should have no impact on the simulation time you get at your ROS nodes.

For your ROS nodes to use simulation time, you can set the use_sim_time parameter on your ROS launch file (which defaults to true). Then use ROS time to calculate your deltaTime.

edit flag offensive delete link more


I do that already. Its just the factor of thirty has to come from somewhere. Maybe its Rviz or maybe im publishing to the wrong frame?

marc1990 gravatar imagemarc1990 ( 2018-05-21 17:20:31 -0500 )edit

It's hard to tell what you mean with the division by 30, why are you dividing by 30?

chapulina gravatar imagechapulina ( 2018-05-21 17:22:33 -0500 )edit

If I dont divide by thirty my motion estimations are off by a factor of 30. i.e. my delta times seems to be off by a factor of thirty

marc1990 gravatar imagemarc1990 ( 2018-05-21 17:27:28 -0500 )edit

Seems is issue is more related to ROS frequency that gazebo

marc1990 gravatar imagemarc1990 ( 2018-05-25 14:02:26 -0500 )edit

Question Tools

1 follower


Asked: 2018-05-20 11:47:23 -0500

Seen: 1,069 times

Last updated: May 21 '18