Skip to content

Control loop missed its desired rate of 20.0000 Hz. Current loop rate is 50.0000 Hz. #5712

@gennartan

Description

@gennartan

I have a strange log fom the controller server that I am seeing when starting a navigation task. This is not a new issue, but I ignored this warning up to now.
I am not sure if it is an error in rclcpp [2], in the controller_server [1] integration or a configuration issue with my setup.

Bug report

Required Info:

  • Operating System:
    • Ubuntu 24.04
  • Computer:
    • Lenovo thinkpad (simulation with gazebo) / Jetson Orin (actual robot)
  • ROS2 Version:
    • Jazzy
  • Version or commit hash:
    • 1.3.9
  • DDS implementation:
    • CycloneDDS

Steps to reproduce issue

When I start a navigation task, I see inconsistents warnings from the controller server.

Expected behavior

Warnings from the controller server should be consistent (no warning from higher rate than the expected rate)

Actual behavior

[controller_server-12] [WARN] [1763737299.426491803] [controller_server]: Control loop missed its desired rate of 20.0000 Hz. Current loop rate is 50.0000 Hz.
[controller_server-12] [WARN] [1763737299.640464429] [controller_server]: Control loop missed its desired rate of 20.0000 Hz. Current loop rate is 25.0000 Hz.
[controller_server-12] [WARN] [1763737299.978117290] [controller_server]: Control loop missed its desired rate of 20.0000 Hz. Current loop rate is 50.0000 Hz.
[controller_server-12] [WARN] [1763737300.113303873] [controller_server]: Control loop missed its desired rate of 20.0000 Hz. Current loop rate is 33.3333 Hz.
[controller_server-12] [WARN] [1763737300.284088452] [controller_server]: Control loop missed its desired rate of 20.0000 Hz. Current loop rate is 50.0000 Hz.
[controller_server-12] [WARN] [1763737300.615473816] [controller_server]: Control loop missed its desired rate of 20.0000 Hz. Current loop rate is 33.3333 Hz.
[controller_server-12] [WARN] [1763737300.778039515] [controller_server]: Control loop missed its desired rate of 20.0000 Hz. Current loop rate is 50.0000 Hz.
[controller_server-12] [WARN] [1763737301.289526740] [controller_server]: Control loop missed its desired rate of 20.0000 Hz. Current loop rate is 50.0000 Hz.

Additional information

I tried to understand the cause of the bug, but I haven't found it yet. From what I understand, the warning is shown because the loop_rate returns False. It returns False when the configured rate cannot be reached, but the rate is reached since the logs' content.

[1]

if (!loop_rate.sleep()) {

[2] https://github.com/ros2/rclcpp/blob/f79f57feb2bbc04ec8c2c4f3d21f72df1cfa659d/rclcpp/src/rclcpp/rate.cpp#L43

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions