00001 """autogenerated by genmsg_py from EmbeddedExternal.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import std_msgs.msg
00006
00007 class EmbeddedExternal(roslib.message.Message):
00008 _md5sum = "a09b324865f98bbf605e59ed0cefbc1d"
00009 _type = "test_roscpp_serialization/EmbeddedExternal"
00010 _has_header = False
00011 _full_text = """std_msgs/UInt8 a
00012 ================================================================================
00013 MSG: std_msgs/UInt8
00014 uint8 data
00015
00016 """
00017 __slots__ = ['a']
00018 _slot_types = ['std_msgs/UInt8']
00019
00020 def __init__(self, *args, **kwds):
00021 """
00022 Constructor. Any message fields that are implicitly/explicitly
00023 set to None will be assigned a default value. The recommend
00024 use is keyword arguments as this is more robust to future message
00025 changes. You cannot mix in-order arguments and keyword arguments.
00026
00027 The available fields are:
00028 a
00029
00030 @param args: complete set of field values, in .msg order
00031 @param kwds: use keyword arguments corresponding to message field names
00032 to set specific fields.
00033 """
00034 if args or kwds:
00035 super(EmbeddedExternal, self).__init__(*args, **kwds)
00036
00037 if self.a is None:
00038 self.a = std_msgs.msg.UInt8()
00039 else:
00040 self.a = std_msgs.msg.UInt8()
00041
00042 def _get_types(self):
00043 """
00044 internal API method
00045 """
00046 return self._slot_types
00047
00048 def serialize(self, buff):
00049 """
00050 serialize message into buffer
00051 @param buff: buffer
00052 @type buff: StringIO
00053 """
00054 try:
00055 buff.write(_struct_B.pack(self.a.data))
00056 except struct.error, se: self._check_types(se)
00057 except TypeError, te: self._check_types(te)
00058
00059 def deserialize(self, str):
00060 """
00061 unpack serialized message in str into this message instance
00062 @param str: byte array of serialized message
00063 @type str: str
00064 """
00065 try:
00066 if self.a is None:
00067 self.a = std_msgs.msg.UInt8()
00068 end = 0
00069 start = end
00070 end += 1
00071 (self.a.data,) = _struct_B.unpack(str[start:end])
00072 return self
00073 except struct.error, e:
00074 raise roslib.message.DeserializationError(e)
00075
00076
00077 def serialize_numpy(self, buff, numpy):
00078 """
00079 serialize message with numpy array types into buffer
00080 @param buff: buffer
00081 @type buff: StringIO
00082 @param numpy: numpy python module
00083 @type numpy module
00084 """
00085 try:
00086 buff.write(_struct_B.pack(self.a.data))
00087 except struct.error, se: self._check_types(se)
00088 except TypeError, te: self._check_types(te)
00089
00090 def deserialize_numpy(self, str, numpy):
00091 """
00092 unpack serialized message in str into this message instance using numpy for array types
00093 @param str: byte array of serialized message
00094 @type str: str
00095 @param numpy: numpy python module
00096 @type numpy: module
00097 """
00098 try:
00099 if self.a is None:
00100 self.a = std_msgs.msg.UInt8()
00101 end = 0
00102 start = end
00103 end += 1
00104 (self.a.data,) = _struct_B.unpack(str[start:end])
00105 return self
00106 except struct.error, e:
00107 raise roslib.message.DeserializationError(e)
00108
00109 _struct_I = roslib.message.struct_I
00110 _struct_B = struct.Struct("<B")