$search
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 = "e693632ffde6716d739db4c8a58e31de" 00009 _type = "bma180/bma180meas" 00010 _has_header = True #flag to mark the presence of a Header object 00011 _full_text = """Header header 00012 string strIdSubDev 00013 int16[] iChipSelect 00014 float64[] fAccelX 00015 float64[] fAccelY 00016 float64[] fAccelZ 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','fAccelX','fAccelY','fAccelZ'] 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,fAccelX,fAccelY,fAccelZ 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 #message fields cannot be None, assign default values for those that are 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 = [] 00064 if self.fAccelX is None: 00065 self.fAccelX = [] 00066 if self.fAccelY is None: 00067 self.fAccelY = [] 00068 if self.fAccelZ is None: 00069 self.fAccelZ = [] 00070 else: 00071 self.header = std_msgs.msg._Header.Header() 00072 self.strIdSubDev = '' 00073 self.iChipSelect = [] 00074 self.fAccelX = [] 00075 self.fAccelY = [] 00076 self.fAccelZ = [] 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 length = len(self.iChipSelect) 00100 buff.write(_struct_I.pack(length)) 00101 pattern = '<%sh'%length 00102 buff.write(struct.pack(pattern, *self.iChipSelect)) 00103 length = len(self.fAccelX) 00104 buff.write(_struct_I.pack(length)) 00105 pattern = '<%sd'%length 00106 buff.write(struct.pack(pattern, *self.fAccelX)) 00107 length = len(self.fAccelY) 00108 buff.write(_struct_I.pack(length)) 00109 pattern = '<%sd'%length 00110 buff.write(struct.pack(pattern, *self.fAccelY)) 00111 length = len(self.fAccelZ) 00112 buff.write(_struct_I.pack(length)) 00113 pattern = '<%sd'%length 00114 buff.write(struct.pack(pattern, *self.fAccelZ)) 00115 except struct.error as se: self._check_types(se) 00116 except TypeError as te: self._check_types(te) 00117 00118 def deserialize(self, str): 00119 """ 00120 unpack serialized message in str into this message instance 00121 @param str: byte array of serialized message 00122 @type str: str 00123 """ 00124 try: 00125 if self.header is None: 00126 self.header = std_msgs.msg._Header.Header() 00127 end = 0 00128 _x = self 00129 start = end 00130 end += 12 00131 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00132 start = end 00133 end += 4 00134 (length,) = _struct_I.unpack(str[start:end]) 00135 start = end 00136 end += length 00137 self.header.frame_id = str[start:end] 00138 start = end 00139 end += 4 00140 (length,) = _struct_I.unpack(str[start:end]) 00141 start = end 00142 end += length 00143 self.strIdSubDev = str[start:end] 00144 start = end 00145 end += 4 00146 (length,) = _struct_I.unpack(str[start:end]) 00147 pattern = '<%sh'%length 00148 start = end 00149 end += struct.calcsize(pattern) 00150 self.iChipSelect = struct.unpack(pattern, str[start:end]) 00151 start = end 00152 end += 4 00153 (length,) = _struct_I.unpack(str[start:end]) 00154 pattern = '<%sd'%length 00155 start = end 00156 end += struct.calcsize(pattern) 00157 self.fAccelX = struct.unpack(pattern, str[start:end]) 00158 start = end 00159 end += 4 00160 (length,) = _struct_I.unpack(str[start:end]) 00161 pattern = '<%sd'%length 00162 start = end 00163 end += struct.calcsize(pattern) 00164 self.fAccelY = struct.unpack(pattern, str[start:end]) 00165 start = end 00166 end += 4 00167 (length,) = _struct_I.unpack(str[start:end]) 00168 pattern = '<%sd'%length 00169 start = end 00170 end += struct.calcsize(pattern) 00171 self.fAccelZ = struct.unpack(pattern, str[start:end]) 00172 return self 00173 except struct.error as e: 00174 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00175 00176 00177 def serialize_numpy(self, buff, numpy): 00178 """ 00179 serialize message with numpy array types into buffer 00180 @param buff: buffer 00181 @type buff: StringIO 00182 @param numpy: numpy python module 00183 @type numpy module 00184 """ 00185 try: 00186 _x = self 00187 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00188 _x = self.header.frame_id 00189 length = len(_x) 00190 buff.write(struct.pack('<I%ss'%length, length, _x)) 00191 _x = self.strIdSubDev 00192 length = len(_x) 00193 buff.write(struct.pack('<I%ss'%length, length, _x)) 00194 length = len(self.iChipSelect) 00195 buff.write(_struct_I.pack(length)) 00196 pattern = '<%sh'%length 00197 buff.write(self.iChipSelect.tostring()) 00198 length = len(self.fAccelX) 00199 buff.write(_struct_I.pack(length)) 00200 pattern = '<%sd'%length 00201 buff.write(self.fAccelX.tostring()) 00202 length = len(self.fAccelY) 00203 buff.write(_struct_I.pack(length)) 00204 pattern = '<%sd'%length 00205 buff.write(self.fAccelY.tostring()) 00206 length = len(self.fAccelZ) 00207 buff.write(_struct_I.pack(length)) 00208 pattern = '<%sd'%length 00209 buff.write(self.fAccelZ.tostring()) 00210 except struct.error as se: self._check_types(se) 00211 except TypeError as te: self._check_types(te) 00212 00213 def deserialize_numpy(self, str, numpy): 00214 """ 00215 unpack serialized message in str into this message instance using numpy for array types 00216 @param str: byte array of serialized message 00217 @type str: str 00218 @param numpy: numpy python module 00219 @type numpy: module 00220 """ 00221 try: 00222 if self.header is None: 00223 self.header = std_msgs.msg._Header.Header() 00224 end = 0 00225 _x = self 00226 start = end 00227 end += 12 00228 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00229 start = end 00230 end += 4 00231 (length,) = _struct_I.unpack(str[start:end]) 00232 start = end 00233 end += length 00234 self.header.frame_id = str[start:end] 00235 start = end 00236 end += 4 00237 (length,) = _struct_I.unpack(str[start:end]) 00238 start = end 00239 end += length 00240 self.strIdSubDev = str[start:end] 00241 start = end 00242 end += 4 00243 (length,) = _struct_I.unpack(str[start:end]) 00244 pattern = '<%sh'%length 00245 start = end 00246 end += struct.calcsize(pattern) 00247 self.iChipSelect = numpy.frombuffer(str[start:end], dtype=numpy.int16, count=length) 00248 start = end 00249 end += 4 00250 (length,) = _struct_I.unpack(str[start:end]) 00251 pattern = '<%sd'%length 00252 start = end 00253 end += struct.calcsize(pattern) 00254 self.fAccelX = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00255 start = end 00256 end += 4 00257 (length,) = _struct_I.unpack(str[start:end]) 00258 pattern = '<%sd'%length 00259 start = end 00260 end += struct.calcsize(pattern) 00261 self.fAccelY = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00262 start = end 00263 end += 4 00264 (length,) = _struct_I.unpack(str[start:end]) 00265 pattern = '<%sd'%length 00266 start = end 00267 end += struct.calcsize(pattern) 00268 self.fAccelZ = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00269 return self 00270 except struct.error as e: 00271 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00272 00273 _struct_I = roslib.message.struct_I 00274 _struct_3I = struct.Struct("<3I")