Comments (13)
Hey,
is there already a fix available for this issue?
Can I somehow help fixing this issue?
from rclcpp.
@firesurfer I am not sure if the problem still exists or has been fixed already. If it would have been reported for the alpha1 I would have assumed it has been addressed by these (ros2/rmw_opensplice#60 ros2/rmw_connext#66). It would be great if you could create a simple example which demonstrates the problem.
from rclcpp.
I don't think that it is this specific problem. It seems more like that a huge number of created publishers/subscribers + services + parameterclients create a huge cpu load even if they are idle.
I'm trying to reproduce this phenomena in a simple example but can't get it to work at the moment.
By profiling my application with callgrind it seems that it spends most of the time in the rclcpp::executor::Executor::wait_for_work method called from the executor.
My application creates about 40 topics with about 30 publishers and 10 subscribers, about 40 parameter clients which access a single parameter service and 40 custom services. All of them are idle at the moment after creating them. Only the parameter clients are used once for accessing the central parameter service that runs in another process.
from rclcpp.
I found the problem. It depends on the interface the dds implementation chooses. In my case I had my application run on my laptop that is connected via wireless lan, but tried to create an example for demonstration on my desktop, which is connected via lan.
Nonetheless I find it a bit strange that using a wirelesslan connection results into a high cpu load.
from rclcpp.
We have just fixed another case where rclcpp
would start busy looping (see ros2/rmw_opensplice#112). It would be great if you could try the latest versions from all repos and comment back if it helps for this case.
from rclcpp.
I pulled the latest version from the master branch. This issue is still existing, but I can't really test it because of the exception I mentioned in #193
from rclcpp.
By replacing the exception with a return I was able to test. The average cpu load in idle is much less than before. Around 20% on an older i7 cpu, same amount of publishers and so on as before.
But it doesn't seem to depend on whether I use a wireless or a wired connection anymore. In both cases I got the same cpu load.
from rclcpp.
While that sounds better 20% is still far away from idle. Can you either share an example which has that problem or debug locally to figure out where the CPU is being used in your case (at best using the debugger and identifying where it probably busy loops)?
from rclcpp.
I will try tomorrow tomorrow to recreate the scenario my application creates in an example. I hope this will help tracking down this issue and #192
from rclcpp.
Hi my example is in https://github.com/firesurfer/ros2_components_demo (the same example I already used for some other issues - please pull the newest version, I separated the ros2_components_demo and the ros2_components repo)
On my system opensplice dds automatically chooses wlan0.
The demo_client takes about 90% cpu time (meassured by htop)
the demo_server takes about 50 % cpu time
and the demo_parameter_server takes abot 2-3% cpu time
on a system running a Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz
from rclcpp.
@firesurfer Looking at the changes in your repo I assume this has been fixed in the meantime. Can this be closed?
from rclcpp.
Yes this is fixed and can be closed.
from rclcpp.
Thanks for confirming.
from rclcpp.
Related Issues (20)
- TimersManager doesn't follow ROS time HOT 2
- rclcpp_action: Provide enum class return ClientGoalHandle::get_status
- Callback works on Galactic but fails on Rolling - handle_message is not implemented for GenericSubscription HOT 1
- Clang warning: ordered comparison of function pointers (Rolling) HOT 1
- `-fanalyzer` warning: possible null dereference when using TypeAdapters HOT 4
- leak due to std::shared_ptr circular reference between Context and GuardCondition HOT 3
- :farmer: `rclcpp.test_executors` failing in Rolling and Jazzy CycloneDDS HOT 2
- rclcpp::Time(int64_t nanoseconds, ...) should check for negative time
- Regression : Executor::spin_some_impl is active waiting HOT 5
- Parameter service behavior is inconsistent with the documentation of rcl_interfaces HOT 9
- Lifecycle destructor calls shutdown while in shuttingdown intermediate state HOT 45
- Backport PR2063 to Humble for Windows HOT 2
- Executor callbacks are no longer in a predictable order HOT 25
- '/clock' Topic cannot change each loop step time from simulation time HOT 10
- Program exits with code -11 when using async_send_request to set parameters in ROS 2 C++ client HOT 1
- Timer callbacks can be delayed when using simulation time HOT 4
- Possible regression in rcl preshutdown callbacks - context invalid? HOT 11
- Shutdown transition on base lifecycle node dtor may lead to segaults on subclass-registered shutdown callback HOT 6
- `on_shutdown` callback not called when `shutdown` transition is triggered on dtor HOT 2
- ABI/API Compliance Checker in github workflow HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rclcpp.