Skip to content

Consider different executor #1

@zflat

Description

@zflat

Hi @v-kiniv

The multithreaded executor is not actually using more than one thread. In order to achieve that you need multiple callback groups, see the example at
https://github.com/ros2/examples/blob/95c3b145e4f75c24e1617d97acc3d349ad67e78f/rclcpp/executors/multithreaded_executor/multithreaded_executor.cpp#L78-L81

However, to minimize CPU usage, I suggest testing out the "static" single threaded executor. See ros2/rclcpp#1034 and ros2/rclcpp#873

After switching rclcpp::executors::MultiThreadedExecutor executor; to rclcpp::executors::StaticSingleThreadedExecutor executor; I suggest testing to see if CPU usage decreases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions