Ask Your Question
0

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

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

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 -0600

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 101 times

Last updated: Sep 23 '14