Skip to content

Fix high CPU usage in sys_time plugin - #2212

Open
loigaak wants to merge 1 commit into
mavlink:ros2from
loigaak:fix/issue-2031
Open

Fix high CPU usage in sys_time plugin#2212
loigaak wants to merge 1 commit into
mavlink:ros2from
loigaak:fix/issue-2031

Conversation

@loigaak

@loigaak loigaak commented Jun 2, 2026

Copy link
Copy Markdown

Fixes #2031. Replaced rclcpp::WallRate with std::chrono durations in SystemTimePlugin parameter callbacks to correctly and efficiently schedule timers, reducing unnecessary CPU overhead.

* This file is part of the mavros package and subject to the license terms
* in the top-level LICENSE file of the mavros repository.
* https://github.com/mavlink/mavros/tree/master/LICENSE.md
*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened? Looks like broken diff.

}
} else {
rclcpp::WallRate rate(rate_d);
auto period = std::chrono::duration<double>(1.0 / rate_d);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference?

@@ -1,354 +1,354 @@
#NOTE: 22.09.2014 17:33:53

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Souldn't be changed.

@Ryanf55

Ryanf55 commented Jun 8, 2026

Copy link
Copy Markdown

This doesn't seem right to me, sorry.

@vooon vooon mentioned this pull request Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CPU usage 4x higher in ROS 2 than ROS 1

3 participants