00001 """autogenerated by genpy from burst_calc/ranges.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import std_msgs.msg
00008
00009 class ranges(genpy.Message):
00010 _md5sum = "4760225b9a5eb17caa1ce5a89eca2bc9"
00011 _type = "burst_calc/ranges"
00012 _has_header = True
00013 _full_text = """# Ranges message
00014 Header header
00015 float64[60] baselines
00016 float64[60] thresholds
00017 float64[60] min_volts
00018 float64[60] max_volts
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','baselines','thresholds','min_volts','max_volts']
00039 _slot_types = ['std_msgs/Header','float64[60]','float64[60]','float64[60]','float64[60]']
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,baselines,thresholds,min_volts,max_volts
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(ranges, self).__init__(*args, **kwds)
00057
00058 if self.header is None:
00059 self.header = std_msgs.msg.Header()
00060 if self.baselines is None:
00061 self.baselines = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00062 if self.thresholds is None:
00063 self.thresholds = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00064 if self.min_volts is None:
00065 self.min_volts = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00066 if self.max_volts is None:
00067 self.max_volts = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00068 else:
00069 self.header = std_msgs.msg.Header()
00070 self.baselines = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00071 self.thresholds = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00072 self.min_volts = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00073 self.max_volts = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00074
00075 def _get_types(self):
00076 """
00077 internal API method
00078 """
00079 return self._slot_types
00080
00081 def serialize(self, buff):
00082 """
00083 serialize message into buffer
00084 :param buff: buffer, ``StringIO``
00085 """
00086 try:
00087 _x = self
00088 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00089 _x = self.header.frame_id
00090 length = len(_x)
00091 if python3 or type(_x) == unicode:
00092 _x = _x.encode('utf-8')
00093 length = len(_x)
00094 buff.write(struct.pack('<I%ss'%length, length, _x))
00095 buff.write(_struct_60d.pack(*self.baselines))
00096 buff.write(_struct_60d.pack(*self.thresholds))
00097 buff.write(_struct_60d.pack(*self.min_volts))
00098 buff.write(_struct_60d.pack(*self.max_volts))
00099 except struct.error as se: self._check_types(se)
00100 except TypeError as te: self._check_types(te)
00101
00102 def deserialize(self, str):
00103 """
00104 unpack serialized message in str into this message instance
00105 :param str: byte array of serialized message, ``str``
00106 """
00107 try:
00108 if self.header is None:
00109 self.header = std_msgs.msg.Header()
00110 end = 0
00111 _x = self
00112 start = end
00113 end += 12
00114 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00115 start = end
00116 end += 4
00117 (length,) = _struct_I.unpack(str[start:end])
00118 start = end
00119 end += length
00120 if python3:
00121 self.header.frame_id = str[start:end].decode('utf-8')
00122 else:
00123 self.header.frame_id = str[start:end]
00124 start = end
00125 end += 480
00126 self.baselines = _struct_60d.unpack(str[start:end])
00127 start = end
00128 end += 480
00129 self.thresholds = _struct_60d.unpack(str[start:end])
00130 start = end
00131 end += 480
00132 self.min_volts = _struct_60d.unpack(str[start:end])
00133 start = end
00134 end += 480
00135 self.max_volts = _struct_60d.unpack(str[start:end])
00136 return self
00137 except struct.error as e:
00138 raise genpy.DeserializationError(e)
00139
00140
00141 def serialize_numpy(self, buff, numpy):
00142 """
00143 serialize message with numpy array types into buffer
00144 :param buff: buffer, ``StringIO``
00145 :param numpy: numpy python 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 if python3 or type(_x) == unicode:
00153 _x = _x.encode('utf-8')
00154 length = len(_x)
00155 buff.write(struct.pack('<I%ss'%length, length, _x))
00156 buff.write(self.baselines.tostring())
00157 buff.write(self.thresholds.tostring())
00158 buff.write(self.min_volts.tostring())
00159 buff.write(self.max_volts.tostring())
00160 except struct.error as se: self._check_types(se)
00161 except TypeError as te: self._check_types(te)
00162
00163 def deserialize_numpy(self, str, numpy):
00164 """
00165 unpack serialized message in str into this message instance using numpy for array types
00166 :param str: byte array of serialized message, ``str``
00167 :param numpy: numpy python module
00168 """
00169 try:
00170 if self.header is None:
00171 self.header = std_msgs.msg.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 if python3:
00183 self.header.frame_id = str[start:end].decode('utf-8')
00184 else:
00185 self.header.frame_id = str[start:end]
00186 start = end
00187 end += 480
00188 self.baselines = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=60)
00189 start = end
00190 end += 480
00191 self.thresholds = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=60)
00192 start = end
00193 end += 480
00194 self.min_volts = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=60)
00195 start = end
00196 end += 480
00197 self.max_volts = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=60)
00198 return self
00199 except struct.error as e:
00200 raise genpy.DeserializationError(e)
00201
00202 _struct_I = genpy.struct_I
00203 _struct_60d = struct.Struct("<60d")
00204 _struct_3I = struct.Struct("<3I")