ros2 control update_rate

asked 2022-07-25 03:59:26 -0600

MaxDio gravatar image

Hello I have a question regarding the ros2_control framework.

I would like to build my own controller which has to run at a specific frequency. I thought I can alter the udapte_rate parameter in the controller_manager config file. To test the rate I increase a counter every update call and publish it every 1000 ms. I set the counter to 1000 (Hz) so I would assume the counter message to increase approximately the same. However, the counter increases significantly faster. Any ideas how I can enforce a specific rate in my controller?

Regards Max

edit retag flag offensive close merge delete


Are you building from source or using a debian? And which version of ROS2?

AndyZe gravatar image AndyZe  ( 2022-07-25 11:44:27 -0600 )edit

Here's the main ros2_control loop which (I believe) should operate as you've described. Maybe you can put some debug code there?

This bit of code has changed a lot recently, which is why I asked what version you are using.

AndyZe gravatar image AndyZe  ( 2022-07-25 11:46:29 -0600 )edit

Hi I use foxy using debian. OK the rate limiter was not included in my code that should hopefully fix it...

MaxDio gravatar image MaxDio  ( 2022-07-26 02:07:29 -0600 )edit