0
$\begingroup$

Rosanswers logo

Can I initialize and run the ros C++ client code in it's own thread?

I'm thinking of creating a thread, and in the thread initializing ROS, then having my main loop run there.

I can't see why not, but I thought I'd ask before venturing there. If there is any general guidance on using threads and ros, that would be appreciated.


Originally posted by SeanPayne on ROS Answers with karma: 118 on 2011-03-14

Post score: 3

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

roscpp is threadsafe. There is a summary of the threading model in the roscpp overview on the Callbacks and Spinning page.


Originally posted by tfoote with karma: 58457 on 2011-03-14

This answer was ACCEPTED on the original site

Post score: 4

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.