Want to publish() in main and also in child thread on one rospy.Publisher(),is this safe?
Originally posted by dyan on ROS Answers with karma: 7 on 2017-03-17
Post score: 0
Want to publish() in main and also in child thread on one rospy.Publisher(),is this safe?
Originally posted by dyan on ROS Answers with karma: 7 on 2017-03-17
Post score: 0
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/rospy.topics-pysrc.html#Publisher.publish
Originally posted by Martin Peris with karma: 5625 on 2017-03-17
This answer was ACCEPTED on the original site
Post score: 2