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

is ros client c++ code thread safe?

asked 2011-03-14 09:23:27 -0500

SeanPayne gravatar image

updated 2014-01-28 17:09:21 -0500

ngrennan gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-03-14 10:03:29 -0500

tfoote gravatar image

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

edit flag offensive delete link more

Question Tools


Asked: 2011-03-14 09:23:27 -0500

Seen: 3,578 times

Last updated: Mar 14 '11