changing rmw of the auto-generated ros2 node leads to increased CPU consumption

2 views (last 30 days)
Hello, I run a node on Ubuntu 20.04 (ros2 humble) with a standard rmw (fastrtps), look in htop and see 10-15% CPU load by my node, stop the node, change the rmw on cyclondds, start it and see the CPU load 35-40%...I tried to rebuild the node with the selected cyclondds in the Matlab ros settings - it didn’t help
Can someone explain how to fix it?
  2 Comments
Walter Roberson
Walter Roberson on 17 Jan 2025
What happens if you stop the node, do not change the rmw, and then start the node again? It would be interesting to see whether it is the act of changing the rmw that causes the problem or the act of starting the node again.
Likewise it would be interesting to see what happens if you change the rmw to the same value it already is (to test whether the act of writing to the rmw triggers the problem.) And it woud be interesting if you were to change rmw back to its original value after running the second time, to test whether the problem is related to the range of the new value you changed it to.
Josh Chen
Josh Chen on 27 Jan 2025
Hi Dmitriy,
For Simulink code generation perspective, we generate exactly same code no matter wich rmw_implementation been selected.
I wonder if this behavior is caused by difference between fastrtps and cyclonedds by nature? Looks like people are seeing different CPU usage comparing these two in the past.
-Josh

Sign in to comment.

Answers (0)

Tags

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!