How to adjust work thread when load a nodelet from roscpp API?
Hi,
I know how to adjust work thread of nodelet manager when launching from launch file (by using "num_worker_threads" parameter). However, I was wondering is anyway I can do this with nodelet roscpp API ?
Plus, it will also be really helpful if anyone can explain what's the major difference between loading a nodelet by nodelet manger and roscpp api (nodelet::Loader).
Thanks!
I am in search of the same answer :) Hope someone will pay attention to your question with a helpful tip.
I found the answer in the file rclcpp/rclcpp/include/rclcpp/executors/multi_threaded_executor.hpp, which defines the class for multi threaded executor.
I don't believe this is an answer to the question posted by @robotpan, as you're linking to ROS2 code. His questions is about nodelets, which is a ROS1 concept. There are no nodelets in ROS2.
Note also the reference to
roscpp
, notrclpp
. Those are two different things.Thank you guys for the comments, but just as @gvdhoorn said, I was looking for solutions within ROS1 and right now I believe there's no such method exists...so I eventually had to let it roscpp use the default work threads number in my project.