How to adjust work thread when load a nodelet from roscpp API?

asked 2018-03-12 16:08:31 -0600

robotpan gravatar image

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!

edit retag flag offensive close merge delete

Comments

I am in search of the same answer :) Hope someone will pay attention to your question with a helpful tip.

petermp gravatar image petermp  ( 2018-04-03 04:10:15 -0600 )edit

I found the answer in the file rclcpp/rclcpp/include/rclcpp/executors/multi_threaded_executor.hpp, which defines the class for multi threaded executor.

petermp gravatar image petermp  ( 2018-04-03 04:32:26 -0600 )edit

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, not rclpp. Those are two different things.

gvdhoorn gravatar image gvdhoorn  ( 2018-04-03 04:37:22 -0600 )edit

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.

robotpan gravatar image robotpan  ( 2018-04-03 21:02:14 -0600 )edit