Robot Inter-Process Communication via Shared Memory Feedback
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing communication protocols in robots face challenges in ensuring that subscribers receive all messages sent by publishers, particularly when the publisher operates at a faster rate than the subscriber, leading to potential message loss and increased latency.
Innovation Solution
Implementing a method where a publisher sends messages to a shared memory with sequentially-related slots, delaying messages if a slot is currently referenced by a subscriber, and using event triggers to ensure that messages are read before sending the next one, thereby guaranteeing reliable communication by preventing message overwrite.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If the publisher sends messages at a high rate to shared memory slots, then communication speed is improved, but messages may be overwritten before subscribers read them, leading to message loss
Solution Approach 1:
The system implements a feedback mechanism where subscribers monitor shared memory slots for new messages and provide feedback by clearing the 'new message' indicator after reading. The publisher receives this feedback and adjusts its behavior accordingly, only writing to slots that have been cleared, thus ensuring messages are not overwritten before being read.
Solution Approach 2:
The patent introduces an intermediary mechanism in the form of a 'new message' indicator flag in each shared memory slot. This intermediary element mediates between the publisher and subscriber, allowing the publisher to signal message availability without directly controlling subscriber access, and enabling the subscriber to acknowledge reading without blocking the publisher.
2Reliability
If the publisher waits for subscriber acknowledgment before sending each message, then message reliability is improved, but communication latency increases
Solution Approach 1:
The system performs preliminary actions by pre-allocating multiple shared memory slots and pre-setting the 'new message' indicator flags. The publisher can immediately write to any slot that has been cleared by a subscriber, without waiting for active acknowledgment. This preliminary preparation of the communication infrastructure eliminates waiting time while maintaining reliability.
Solution Approach 2:
The patent enables continuous useful action by allowing the publisher to write messages to multiple different slots in rapid succession as long as those slots have been cleared by subscribers. This continuous writing capability maintains high communication throughput while the subscriber continuously reads and clears slots, ensuring no messages are lost without requiring sequential acknowledgment for each message.
Data Source
AI summary
A method includes creating a publisher configured to send messages over a channel having a shared memory. The method includes creating at least one subscriber configured to receive the messages over the channel by sequentially referencing memory slots of the plurality of memory slots. The method includes determining that the next sequential memory slot is currently referenced by a subscriber. The method includes delaying sending the message by the publisher based on determining that the next sequential memory slot is currently referenced by the subscriber. The method includes receiving an event trigger indicative of message reading by the subscriber. The method includes, responsive to receiving the event trigger, determining that the next sequential memory slot is not currently referenced. The method includes sending the message to the next sequential memory slot based on determining that the next sequential memory slot is not currently referenced.


