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

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: wiki.ros.org/actionlib_tutorials/Tutorials/SimpleActionClient(Threaded). 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
0

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. http://wiki.ros.org/actionlib_tutoria...

edit flag offensive delete link more

Question Tools

1 follower

Stats

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

Seen: 236 times

Last updated: Sep 23 '14