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

is ros client c++ code thread safe?

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

SeanPayne gravatar image

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

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
4

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

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

Stats

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

Seen: 3,684 times

Last updated: Mar 14 '11