ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

is rospy.Publisher.publish() thread safe?

asked 2017-03-17 02:40:38 -0500

dyan gravatar image

Want to publish() in main and also in child thread on one rospy.Publisher(),is this safe?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-03-17 03:23:24 -0500

Yes, rospy.Publisher() is thread safe.

Before publishing a message it acquires a lock for thread safety and releases it after the message is sent.

You can see the source code here:

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



Asked: 2017-03-17 02:40:38 -0500

Seen: 1,266 times

Last updated: Mar 17 '17