Robotics StackExchange | Archived questions

Assigning ROS nodes located in a launch file to a certain CPU core

is it possible to run all ROS operations (Running a ros launch file from a python script which contains running gazebo simulation for a certain robot in addition to it's controllers) and sticking it on a single core ? the drive for such question is to parallelize the simulation of multiple robots separately on different cores for development of distrusted reinforcement learning algorithms i'm running ros kinetic on ubuntu 16.04

Asked by karFAR on 2019-03-22 16:27:43 UTC

Comments

This is a duplicate of #q202712 and #q311449 (which @ahendrix also answered).

Asked by gvdhoorn on 2019-03-25 04:21:20 UTC

Answers

ROS doesn't provide any native tools for pinning tasks to CPUs, but it doesn't fight the existing tools either.

There is a general-purpose linux tool called taskset which can pin tasks to CPUs, and I've used it with ROS quite successfully in the past. You could probably use it in your startup script to limit each launch file to a single core.

Asked by ahendrix on 2019-03-22 17:10:14 UTC

Comments