gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.21k stars 484 forks source link

log record period specified by "record_period" option is not guaranteed on gazebo9 #3256

Open HKenta opened 2 years ago

HKenta commented 2 years ago

Hello,

I'm using gazebo9, and I used the --record_period option to get a log at regular intervals, but the specified log period was not guaranteed when the argument is less than 0.025. For example, if the argument is 0.02, the log period will be 0.02 or 0.04 seconds, and for values less than 0.02, it will be a random value in the range 0.02 to 0.024 seconds.

According to the source code, the default value for the --record_period argument is -1, that means it should record the state of every single step if you don't use --record_period , but it seems don't work.

On the other hand, when the model is complex and the real-time factor is as small as 0.04, log periods guarantee even small log period as small as 0.001. These facts seems to indicate that the log recording process might don't catch up when the real-time factor is large.

However, I tried to set real_time_update_rate and real_time_factor in world file to make sure the real-time factor small enough, it didn't work well.

Is this expected behavior? Or is there any way to make it guarantee small log periods?

Thank you.