template<
typename MessageType>
class staubli_robot_driver::RealTimeSocketSubscriber< MessageType >
Real-time socket subscriber class template.
Subscribes to messages of type MessageType over a socket. Handles message reception and status tracking in a thread-safe manner.
- Template Parameters
-
| MessageType | Type of message to subscribe to |
Read the latest message and check for lost packages and staleness.
This method retrieves the most recent message received over the socket, along with its status information. It checks for lost packages based on sequence numbers and computes the time since the message was received (time of deserialization in async thread).
This method is thread-safe and can be called from real-time contexts. If no message AT ALL has been received yet, it returns false. If no message was received since last call, but one had arrived at some point before, the method returns true, but with the status.new_message field set to false.
In any case, the staleness of the message should be checked using the status.time_since_received field.
- Parameters
-
| msg | Reference to store the received message |
| status | Reference to store the message status information |
- Returns
- true if a message was received (at some point) and that the returned message is valid, false otherwise. Check
status in any case...