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

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
2

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: http://docs.ros.org/api/rospy/html/ro...

edit flag offensive delete link more

Question Tools

2 followers

Stats

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

Seen: 1,359 times

Last updated: Mar 17 '17