Fix:: Reduce CPU usage by enabling intra-process communication and b…#2089
Open
faizan-185 wants to merge 1 commit into
Open
Fix:: Reduce CPU usage by enabling intra-process communication and b…#2089faizan-185 wants to merge 1 commit into
faizan-185 wants to merge 1 commit into
Conversation
…y switching to sensor Qos
vooon
reviewed
Dec 19, 2025
| try { | ||
| auto qos = QoS( | ||
| 1000).best_effort().durability_volatile(); | ||
| auto qos = rclcpp::SensorDataQoS(); |
Member
There was a problem hiding this comment.
What for? It's queue size is 5, which may be small.
|
|
||
| rclcpp::NodeOptions options; | ||
| // options.use_intra_process_comms(true); | ||
| options.use_intra_process_comms(true); |
Member
There was a problem hiding this comment.
Have you tested it? Does it work if the router and uas in the different processes (i mean if that scenario continue to work)?
vooon
reviewed
Dec 19, 2025
| { | ||
| // return std::max<size_t>(16, std::min<size_t>(std::thread::hardware_concurrency(), 4)); | ||
| return std::clamp<size_t>(std::thread::hardware_concurrency(), 4, 16); | ||
| return std::clamp<size_t>(std::thread::hardware_concurrency(), 2, 8); |
Member
There was a problem hiding this comment.
I'd like to introduce UAS_MAXPROC env var, but it must be >= 2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reduced CPU usage by enabling intra-process communication and by switching to sensor Qos.
Without intra-process comms, messages traverse the RMW and DDS layers even when publisher and subscriber are in the same process. Also there is a chance of aggressive default QoS on internal bus.