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

why to define ros::spin() in another thread?

asked 2014-09-23 14:11:07 -0500

SHPOWER gravatar image

Hey all,

There is an example in actionlib tutorial: In this example the ros::spin() command is used in another thread. Why should I create a ros::spin() command in a new thread? Why shouldn't I use this command in the end of the main like I see in the most of examples? What's the difference between these two cases?

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-09-23 18:14:43 -0500

tfoote gravatar image

This is to show how you can integrate the client into a larger system. In contrast to the first example client which takes over your only thread.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2014-09-23 14:11:07 -0500

Seen: 242 times

Last updated: Sep 23 '14