00001 """autogenerated by genmsg_py from smi540meas.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import std_msgs.msg
00006
00007 class smi540meas(roslib.message.Message):
00008 _md5sum = "414859c89d8deede5f0f1451d239386a"
00009 _type = "smi540/smi540meas"
00010 _has_header = True
00011 _full_text = """Header header
00012 float64 fAcclX
00013 float64 fAcclY
00014 float64 fRateZ
00015
00016
00017 ================================================================================
00018 MSG: std_msgs/Header
00019 # Standard metadata for higher-level stamped data types.
00020 # This is generally used to communicate timestamped data
00021 # in a particular coordinate frame.
00022 #
00023 # sequence ID: consecutively increasing ID
00024 uint32 seq
00025 #Two-integer timestamp that is expressed as:
00026 # * stamp.secs: seconds (stamp_secs) since epoch
00027 # * stamp.nsecs: nanoseconds since stamp_secs
00028 # time-handling sugar is provided by the client library
00029 time stamp
00030 #Frame this data is associated with
00031 # 0: no frame
00032 # 1: global frame
00033 string frame_id
00034
00035 """
00036 __slots__ = ['header','fAcclX','fAcclY','fRateZ']
00037 _slot_types = ['Header','float64','float64','float64']
00038
00039 def __init__(self, *args, **kwds):
00040 """
00041 Constructor. Any message fields that are implicitly/explicitly
00042 set to None will be assigned a default value. The recommend
00043 use is keyword arguments as this is more robust to future message
00044 changes. You cannot mix in-order arguments and keyword arguments.
00045
00046 The available fields are:
00047 header,fAcclX,fAcclY,fRateZ
00048
00049 @param args: complete set of field values, in .msg order
00050 @param kwds: use keyword arguments corresponding to message field names
00051 to set specific fields.
00052 """
00053 if args or kwds:
00054 super(smi540meas, self).__init__(*args, **kwds)
00055
00056 if self.header is None:
00057 self.header = std_msgs.msg._Header.Header()
00058 if self.fAcclX is None:
00059 self.fAcclX = 0.
00060 if self.fAcclY is None:
00061 self.fAcclY = 0.
00062 if self.fRateZ is None:
00063 self.fRateZ = 0.
00064 else:
00065 self.header = std_msgs.msg._Header.Header()
00066 self.fAcclX = 0.
00067 self.fAcclY = 0.
00068 self.fRateZ = 0.
00069
00070 def _get_types(self):
00071 """
00072 internal API method
00073 """
00074 return self._slot_types
00075
00076 def serialize(self, buff):
00077 """
00078 serialize message into buffer
00079 @param buff: buffer
00080 @type buff: StringIO
00081 """
00082 try:
00083 _x = self
00084 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00085 _x = self.header.frame_id
00086 length = len(_x)
00087 buff.write(struct.pack('<I%ss'%length, length, _x))
00088 _x = self
00089 buff.write(_struct_3d.pack(_x.fAcclX, _x.fAcclY, _x.fRateZ))
00090 except struct.error, se: self._check_types(se)
00091 except TypeError, te: self._check_types(te)
00092
00093 def deserialize(self, str):
00094 """
00095 unpack serialized message in str into this message instance
00096 @param str: byte array of serialized message
00097 @type str: str
00098 """
00099 try:
00100 if self.header is None:
00101 self.header = std_msgs.msg._Header.Header()
00102 end = 0
00103 _x = self
00104 start = end
00105 end += 12
00106 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00107 start = end
00108 end += 4
00109 (length,) = _struct_I.unpack(str[start:end])
00110 start = end
00111 end += length
00112 self.header.frame_id = str[start:end]
00113 _x = self
00114 start = end
00115 end += 24
00116 (_x.fAcclX, _x.fAcclY, _x.fRateZ,) = _struct_3d.unpack(str[start:end])
00117 return self
00118 except struct.error, e:
00119 raise roslib.message.DeserializationError(e)
00120
00121
00122 def serialize_numpy(self, buff, numpy):
00123 """
00124 serialize message with numpy array types into buffer
00125 @param buff: buffer
00126 @type buff: StringIO
00127 @param numpy: numpy python module
00128 @type numpy module
00129 """
00130 try:
00131 _x = self
00132 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00133 _x = self.header.frame_id
00134 length = len(_x)
00135 buff.write(struct.pack('<I%ss'%length, length, _x))
00136 _x = self
00137 buff.write(_struct_3d.pack(_x.fAcclX, _x.fAcclY, _x.fRateZ))
00138 except struct.error, se: self._check_types(se)
00139 except TypeError, te: self._check_types(te)
00140
00141 def deserialize_numpy(self, str, numpy):
00142 """
00143 unpack serialized message in str into this message instance using numpy for array types
00144 @param str: byte array of serialized message
00145 @type str: str
00146 @param numpy: numpy python module
00147 @type numpy: module
00148 """
00149 try:
00150 if self.header is None:
00151 self.header = std_msgs.msg._Header.Header()
00152 end = 0
00153 _x = self
00154 start = end
00155 end += 12
00156 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00157 start = end
00158 end += 4
00159 (length,) = _struct_I.unpack(str[start:end])
00160 start = end
00161 end += length
00162 self.header.frame_id = str[start:end]
00163 _x = self
00164 start = end
00165 end += 24
00166 (_x.fAcclX, _x.fAcclY, _x.fRateZ,) = _struct_3d.unpack(str[start:end])
00167 return self
00168 except struct.error, e:
00169 raise roslib.message.DeserializationError(e)
00170
00171 _struct_I = roslib.message.struct_I
00172 _struct_3I = struct.Struct("<3I")
00173 _struct_3d = struct.Struct("<3d")