ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

/clock rate is lower than set in ROS2 Gazebo

asked 2021-11-14 20:05:53 -0500

muronglindong gravatar image

updated 2021-12-06 03:41:47 -0500

I changed publish_rate and /clock rate was changed successfully, but the rate is lower than set. For example, when I changed it to 1000Hz, which can be achieved in ROS Noetic, the result shows:

average rate: 683.508
    min: 0.001s max: 0.003s std dev: 0.00051s window: 686
average rate: 663.025
    min: 0.000s max: 0.004s std dev: 0.00051s window: 1329
average rate: 657.239
    min: 0.000s max: 0.004s std dev: 0.00051s window: 1976
average rate: 649.790
    min: 0.000s max: 0.004s std dev: 0.00052s window: 2604
average rate: 649.542
    min: 0.000s max: 0.007s std dev: 0.00053s window: 3253
average rate: 642.903
    min: 0.000s max: 0.007s std dev: 0.00053s window: 3863

And changing to 500hz gets a result about 400Hz, changing to 100Hz gets a result about 95Hz.

This problem may lead to another problem that other publisher's rate is lower too. For example, I created a publisher with 100Hz, but it published at a lower rate. And /clock rate is lower, the publisher's rate is lower too.

So how to solve this problem? All programs written in C++. Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-11-17 14:22:41 -0500

osilva gravatar image

updated 2021-11-17 14:23:21 -0500

Hi @muronglindong

Based on the title of your question your issue is specific with Gazebo 11 simulation with ROS 2. There is a discussion in Discourse: https://community.gazebosim.org/t/gaz...

One of the suggestions by @chapulina

The RTF measures the physics update rate, but that may not be the same update rate as the sensors. You can use the new Lockstep of physics and sensors 8 feature to ensure that sensors and physics run in sync, which will essentially slow down physics.

This point to two great tutorials: http://gazebosim.org/tutorials?tut=lo... and http://gazebosim.org/tutorials?tut=pe...

This is just a gist of the discussion, so I suggest to read over it and perhaps you will get more feedback in the https://answers.gazebosim.org/questions/

edit flag offensive delete link more

Comments

Thank you, I learned the tutorials, but it doesn't seem work. I'm still trying to find some ways...

muronglindong gravatar image muronglindong  ( 2021-12-06 03:40:08 -0500 )edit

Question Tools

5 followers

Stats

Asked: 2021-11-14 20:05:53 -0500

Seen: 245 times

Last updated: Dec 06 '21