module documentation

Internal use: Support for ROS messages, including network serialization routines

Function args_kwds_to_message Given a data class, take in the args and kwds of a function call and return the appropriate data_class instance.
Function deserialize_messages Read all messages off the buffer
Function serialize_message Serialize the message to the buffer @param b: buffer to write to. WARNING: buffer will be reset after call @type b: StringIO @param msg: message to write @type msg: Message @param seq: current sequence number (for headers) @type seq: int: current sequence number (for headers) @raise ROSSerializationException: if unable to serialize message...
def args_kwds_to_message(data_class, args, kwds):

Given a data class, take in the args and kwds of a function call and return the appropriate data_class instance.

If kwds are specified, a new data_class instance will be created with keyword-style init.

If there is only a single arg and it is of the correct type, it will be returned. AnyMsg is considered to match all data_class types.

Otherwise, args will be used as args for a new message instance.

@param data_class: Message class that will be used to instantiate new instances, if necessary. @type data_class: Message class @param args: function args @type args: sequence @param kwds: function kwds @type kwds: dict @raise TypeError: if args and kwds are both specified

def deserialize_messages(b, msg_queue, data_class, queue_size=None, max_msgs=None, start=0):

Read all messages off the buffer

@param b: buffer to read data from @type b: StringIO @param msg_queue: queue to append deserialized data to @type msg_queue: list @param data_class: message deserialization class @type data_class: Message class @param queue_size: message queue size. all but the last queue_size messages are discarded if this parameter is specified. @type queue_size: int @param start: starting position to read in b @type start: int @param max_msgs int: maximum number of messages to deserialize or None @type max_msgs: int @raise genpy.DeserializationError: if an error/exception occurs during deserialization

def serialize_message(b, seq, msg):

Serialize the message to the buffer @param b: buffer to write to. WARNING: buffer will be reset after call @type b: StringIO @param msg: message to write @type msg: Message @param seq: current sequence number (for headers) @type seq: int: current sequence number (for headers) @raise ROSSerializationException: if unable to serialize message. This is usually due to a type error with one of the fields.