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

how does ros schedule nodes

asked 2019-03-25 17:56:08 -0500

zaddan gravatar image

how does ros schedule nodes? is this simply using the linux scheduler?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-03-25 18:29:26 -0500

ahendrix gravatar image

updated 2019-03-25 22:20:18 -0500

Yes, ROS 1 uses the linux scheduler. By default, roscpp has a background thread to handle socket activity, and processes callbacks serially on the main thread when you can ros::spin() or ros::spinOnce(). You can change how many threads are used by using an async spinner or multithreaded spinner.

You are free to use the linux tools for scheduling to change how linux schedules your processes or threads. (I am not sure about ROS 2 but I think it is the same).

edit flag offensive delete link more

Comments

thanks for the answer. So does ros actually use linux scheduler or it simply stays out of scheduling (and let linux take care the scheduling of nodes, since nodes are processes anyway and hence the unit of scheduling that linux deals with)

zaddan gravatar image zaddan  ( 2019-03-25 21:01:13 -0500 )edit
1

ROS stays out of scheduling completely.

ahendrix gravatar image ahendrix  ( 2019-03-25 22:20:11 -0500 )edit

thanks for the clarification.

zaddan gravatar image zaddan  ( 2019-03-25 22:48:09 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-03-25 17:56:08 -0500

Seen: 966 times

Last updated: Mar 25 '19