ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Without being able to get access to the underlying threads, I think it will be difficult (impossible) to do for individual threads, but for entire processes this should be doable using taskset and a launch-prefix. Something like launch-prefix="taskset -c 1" added to a node element in a launch file should work (I haven't tested it though). That binds the node to cpu 2.

Note that according to taskset, your user needs to have CAP_SYS_NICE.

Note also that the taskset approach is not ROS specific. The launch-prefix is (see roslaunch/XML/node - Attributes).

Final note: the fact that you've bound task X to cpu Y does not mean that other tasks cannot be run in cpu Y, obviously.

Without being able to get access to the underlying threads, I think it will be difficult (impossible) to do for individual threads, but for entire processes this should be doable using taskset and a launch-prefix.

Something like launch-prefix="taskset -c 1" added to a node element in a launch file should work (I haven't tested it though). That binds the node to cpu 2.

Note that according to taskset, your user needs to have CAP_SYS_NICE.

Note also that the taskset approach is not ROS specific. The launch-prefix is (see roslaunch/XML/node - Attributes).

Final note: the fact that you've bound task X to cpu Y does not mean that other tasks cannot be run in cpu Y, obviously.

Without being able to get access to the underlying threads, I think it will be difficult (impossible) to do for individual threads, but for entire processes this should be doable using taskset and a launch-prefix (taskset is from the util-linux package on Debian/Ubuntu).

Something like launch-prefix="taskset -c 1" added to a node element in a launch file should work (I haven't tested it though). That binds the node to cpu 2.

Note that according to taskset, your user needs to have CAP_SYS_NICE.

Note also that the taskset approach is not ROS specific. The launch-prefix is (see roslaunch/XML/node - Attributes).

Final note: the fact that you've bound task X to cpu Y does not mean that other tasks cannot be run in cpu Y, obviously.

Without being able to get access to the underlying threads, I think it will be difficult (impossible) to do for individual threads, but for entire processes this should be doable using taskset and a launch-prefix (taskset is from the util-linux package on Debian/Ubuntu).

Something like launch-prefix="taskset -c 1" added to a node element in a launch file should work (I haven't tested it though). That binds the node to cpu 2.

Note that according to tasksetman/1/taskset, your user needs to have CAP_SYS_NICE.

Note also that the taskset approach is not ROS specific. The launch-prefix is (see roslaunch/XML/node - Attributes).

Final note: the fact that you've bound task X to cpu Y does not mean that other tasks cannot be run in cpu Y, obviously.

Without being able to get access to the underlying threads, I think it will be difficult (impossible) to do for individual threads, but for entire processes this should be doable using taskset and a launch-prefix (taskset is from the util-linux package on Debian/Ubuntu).

Something like launch-prefix="taskset -c 1" added to a node element in a launch file should work (I haven't tested it though). That binds the node to cpu 2.

Note that according to man/1/taskset, your user needs to have CAP_SYS_NICE.

Note also that the taskset approach is not ROS specific. The launch-prefix is ROS specific (see roslaunch/XML/node - Attributes).

Final note: the fact that you've bound task X to cpu Y does not mean that other tasks cannot be run in on cpu Y, obviously.