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