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

how to know which cores are my nodes using ?

This is decided by your operating system, and usually the cpu cores change from one second to the next. So this is not really a useful question.

If you are trying to compare the behavior of SingleThreadedExecutor to MultiThreadedExecutor, and determine the number of threads that exist for a particular linux process, then (on linux) you can use the /bin/ps command. If the Process Id (PID) of your ros node is 29969, then:

$ /bin/ps -p 29969 -L -f
UID      PID    PPID LWP    C NLWP STIME TTY          TIME CMD
mike     29969  2820 29969  0    3 07:24 pts/0    00:00:00 /usr/bin/python /opt/ros/melodi
mike     29969  2820 29990  0    3 07:24 pts/0    00:00:00 /usr/bin/python /opt/ros/melodi
mike     29969  2820 29991  0    3 07:24 pts/0    00:00:00 /usr/bin/python /opt/ros/melodi

Process 29969 is running 3 threads (the main thread, plus 2 more.)