The present application discloses a message transmitting method and device for a robot operating system. A specific embodiment of the method comprises: searching by looping through a memory segment in a shared memory, by a transmitting node, a memory block having a memory block indicator comprising a writing mark of “writeable” and a reading mark of “0”; amending, by the transmitting node, the writing mark of the memory block indicator of the memory block searched out to indicate that the memory block is being written, and then writing data into the memory block searched out; and resetting, by the transmitting node, the writing mark of the memory block indicator of the memory block searched out to indicate that the memory block is writable after the data is written, releasing the memory block searched out and notifying a receiving node that the memory block searched out is readable. The embodiment can realize that transmitting nodes and receiving nodes may subsequently read or write data in a shared memory without interference.
展开▼