Robotics StackExchange | Archived questions

How do I run different ros nodes on different cpu cores simulatenously?

for speeding up the project using different nodes, nodes may use the same core and it is causing a slowing down issue, I want to be reassured that this is not the root cause for slowing down if they run on different cores.

Asked by aiskurt on 2022-07-12 14:12:54 UTC

Comments

Answers

Use htop to view your per-core load.

Asked by BlakeAnderson on 2022-07-14 08:44:18 UTC

Comments

ROS is not special in terms of cpu usage. It does not control which core does what job, your OS will manage that via a scheduler. If the scheduler was the problem, you would notice it on all other applications. See stackoverflow.

However, you can allow ROS to use multiple threads. This is done via specifying the executor for your nodes, see documentation on executors, and in turn their callback groups. There was a recent writeup on how it works, I recommend reading it if you are interested in it.

Asked by Per Edwardsson on 2022-07-15 03:22:19 UTC

Comments