-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix:: Reduce CPU usage by enabling intra-process communication and b… #2089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: ros2
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,7 @@ UASExecutor::UASExecutor(const rclcpp::ExecutorOptions & options) | |
| size_t UASExecutor::select_number_of_threads() | ||
| { | ||
| // 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to introduce UAS_MAXPROC env var, but it must be >= 2. |
||
| } | ||
|
|
||
| void UASExecutor::set_ids(uint8_t sysid, uint8_t compid) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,7 @@ int main(int argc, char * argv[]) | |
| rclcpp::executors::MultiThreadedExecutor exec(rclcpp::ExecutorOptions(), 2); | ||
|
|
||
| rclcpp::NodeOptions options; | ||
| // options.use_intra_process_comms(true); | ||
| options.use_intra_process_comms(true); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you tested it? Does it work if the router and uas in the different processes (i mean if that scenario continue to work)? |
||
|
|
||
| std::string fcu_url, gcs_url, uas_url; | ||
| std::string base_link_frame_id, odom_frame_id, map_frame_id; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What for? It's queue size is 5, which may be small.