00001 """autogenerated by genmsg_py from DenseLaserSnapshot.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import roslib.rostime
00006 import std_msgs.msg
00007
00008 class DenseLaserSnapshot(roslib.message.Message):
00009 _md5sum = "deb2810d3530db3484f886a81243195d"
00010 _type = "calibration_msgs/DenseLaserSnapshot"
00011 _has_header = True
00012 _full_text = """# Provides all the state & sensor information for
00013 # a single sweep of laser attached to some mechanism.
00014 # Most likely, this will be used with PR2's tilting laser mechanism
00015 Header header
00016
00017 # Store the laser intrinsics. This is very similar to the
00018 # intrinsics commonly stored in
00019 float32 angle_min # start angle of the scan [rad]
00020 float32 angle_max # end angle of the scan [rad]
00021 float32 angle_increment # angular distance between measurements [rad]
00022 float32 time_increment # time between measurements [seconds]
00023 float32 range_min # minimum range value [m]
00024 float32 range_max # maximum range value [m]
00025
00026 # Define the size of the binary data
00027 uint32 readings_per_scan # (Width)
00028 uint32 num_scans # (Height)
00029
00030 # 2D Arrays storing laser data.
00031 # We can think of each type data as being a single channel image.
00032 # Each row of the image has data from a single scan, and scans are
00033 # concatenated to form the entire 'image'.
00034 float32[] ranges # (Image data)
00035 float32[] intensities # (Image data)
00036
00037 # Store the start time of each scan
00038 time[] scan_start
00039
00040 ================================================================================
00041 MSG: std_msgs/Header
00042 # Standard metadata for higher-level stamped data types.
00043 # This is generally used to communicate timestamped data
00044 # in a particular coordinate frame.
00045 #
00046 # sequence ID: consecutively increasing ID
00047 uint32 seq
00048 #Two-integer timestamp that is expressed as:
00049 # * stamp.secs: seconds (stamp_secs) since epoch
00050 # * stamp.nsecs: nanoseconds since stamp_secs
00051 # time-handling sugar is provided by the client library
00052 time stamp
00053 #Frame this data is associated with
00054 # 0: no frame
00055 # 1: global frame
00056 string frame_id
00057
00058 """
00059 __slots__ = ['header','angle_min','angle_max','angle_increment','time_increment','range_min','range_max','readings_per_scan','num_scans','ranges','intensities','scan_start']
00060 _slot_types = ['Header','float32','float32','float32','float32','float32','float32','uint32','uint32','float32[]','float32[]','time[]']
00061
00062 def __init__(self, *args, **kwds):
00063 """
00064 Constructor. Any message fields that are implicitly/explicitly
00065 set to None will be assigned a default value. The recommend
00066 use is keyword arguments as this is more robust to future message
00067 changes. You cannot mix in-order arguments and keyword arguments.
00068
00069 The available fields are:
00070 header,angle_min,angle_max,angle_increment,time_increment,range_min,range_max,readings_per_scan,num_scans,ranges,intensities,scan_start
00071
00072 @param args: complete set of field values, in .msg order
00073 @param kwds: use keyword arguments corresponding to message field names
00074 to set specific fields.
00075 """
00076 if args or kwds:
00077 super(DenseLaserSnapshot, self).__init__(*args, **kwds)
00078
00079 if self.header is None:
00080 self.header = std_msgs.msg._Header.Header()
00081 if self.angle_min is None:
00082 self.angle_min = 0.
00083 if self.angle_max is None:
00084 self.angle_max = 0.
00085 if self.angle_increment is None:
00086 self.angle_increment = 0.
00087 if self.time_increment is None:
00088 self.time_increment = 0.
00089 if self.range_min is None:
00090 self.range_min = 0.
00091 if self.range_max is None:
00092 self.range_max = 0.
00093 if self.readings_per_scan is None:
00094 self.readings_per_scan = 0
00095 if self.num_scans is None:
00096 self.num_scans = 0
00097 if self.ranges is None:
00098 self.ranges = []
00099 if self.intensities is None:
00100 self.intensities = []
00101 if self.scan_start is None:
00102 self.scan_start = []
00103 else:
00104 self.header = std_msgs.msg._Header.Header()
00105 self.angle_min = 0.
00106 self.angle_max = 0.
00107 self.angle_increment = 0.
00108 self.time_increment = 0.
00109 self.range_min = 0.
00110 self.range_max = 0.
00111 self.readings_per_scan = 0
00112 self.num_scans = 0
00113 self.ranges = []
00114 self.intensities = []
00115 self.scan_start = []
00116
00117 def _get_types(self):
00118 """
00119 internal API method
00120 """
00121 return self._slot_types
00122
00123 def serialize(self, buff):
00124 """
00125 serialize message into buffer
00126 @param buff: buffer
00127 @type buff: StringIO
00128 """
00129 try:
00130 _x = self
00131 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00132 _x = self.header.frame_id
00133 length = len(_x)
00134 buff.write(struct.pack('<I%ss'%length, length, _x))
00135 _x = self
00136 buff.write(_struct_6f2I.pack(_x.angle_min, _x.angle_max, _x.angle_increment, _x.time_increment, _x.range_min, _x.range_max, _x.readings_per_scan, _x.num_scans))
00137 length = len(self.ranges)
00138 buff.write(_struct_I.pack(length))
00139 pattern = '<%sf'%length
00140 buff.write(struct.pack(pattern, *self.ranges))
00141 length = len(self.intensities)
00142 buff.write(_struct_I.pack(length))
00143 pattern = '<%sf'%length
00144 buff.write(struct.pack(pattern, *self.intensities))
00145 length = len(self.scan_start)
00146 buff.write(_struct_I.pack(length))
00147 for val1 in self.scan_start:
00148 _x = val1
00149 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00150 except struct.error, se: self._check_types(se)
00151 except TypeError, te: self._check_types(te)
00152
00153 def deserialize(self, str):
00154 """
00155 unpack serialized message in str into this message instance
00156 @param str: byte array of serialized message
00157 @type str: str
00158 """
00159 try:
00160 if self.header is None:
00161 self.header = std_msgs.msg._Header.Header()
00162 end = 0
00163 _x = self
00164 start = end
00165 end += 12
00166 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00167 start = end
00168 end += 4
00169 (length,) = _struct_I.unpack(str[start:end])
00170 start = end
00171 end += length
00172 self.header.frame_id = str[start:end]
00173 _x = self
00174 start = end
00175 end += 32
00176 (_x.angle_min, _x.angle_max, _x.angle_increment, _x.time_increment, _x.range_min, _x.range_max, _x.readings_per_scan, _x.num_scans,) = _struct_6f2I.unpack(str[start:end])
00177 start = end
00178 end += 4
00179 (length,) = _struct_I.unpack(str[start:end])
00180 pattern = '<%sf'%length
00181 start = end
00182 end += struct.calcsize(pattern)
00183 self.ranges = struct.unpack(pattern, str[start:end])
00184 start = end
00185 end += 4
00186 (length,) = _struct_I.unpack(str[start:end])
00187 pattern = '<%sf'%length
00188 start = end
00189 end += struct.calcsize(pattern)
00190 self.intensities = struct.unpack(pattern, str[start:end])
00191 start = end
00192 end += 4
00193 (length,) = _struct_I.unpack(str[start:end])
00194 self.scan_start = []
00195 for i in xrange(0, length):
00196 val1 = roslib.rostime.Time()
00197 _x = val1
00198 start = end
00199 end += 8
00200 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00201 self.scan_start.append(val1)
00202 return self
00203 except struct.error, e:
00204 raise roslib.message.DeserializationError(e)
00205
00206
00207 def serialize_numpy(self, buff, numpy):
00208 """
00209 serialize message with numpy array types into buffer
00210 @param buff: buffer
00211 @type buff: StringIO
00212 @param numpy: numpy python module
00213 @type numpy module
00214 """
00215 try:
00216 _x = self
00217 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00218 _x = self.header.frame_id
00219 length = len(_x)
00220 buff.write(struct.pack('<I%ss'%length, length, _x))
00221 _x = self
00222 buff.write(_struct_6f2I.pack(_x.angle_min, _x.angle_max, _x.angle_increment, _x.time_increment, _x.range_min, _x.range_max, _x.readings_per_scan, _x.num_scans))
00223 length = len(self.ranges)
00224 buff.write(_struct_I.pack(length))
00225 pattern = '<%sf'%length
00226 buff.write(self.ranges.tostring())
00227 length = len(self.intensities)
00228 buff.write(_struct_I.pack(length))
00229 pattern = '<%sf'%length
00230 buff.write(self.intensities.tostring())
00231 length = len(self.scan_start)
00232 buff.write(_struct_I.pack(length))
00233 for val1 in self.scan_start:
00234 _x = val1
00235 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00236 except struct.error, se: self._check_types(se)
00237 except TypeError, te: self._check_types(te)
00238
00239 def deserialize_numpy(self, str, numpy):
00240 """
00241 unpack serialized message in str into this message instance using numpy for array types
00242 @param str: byte array of serialized message
00243 @type str: str
00244 @param numpy: numpy python module
00245 @type numpy: module
00246 """
00247 try:
00248 if self.header is None:
00249 self.header = std_msgs.msg._Header.Header()
00250 end = 0
00251 _x = self
00252 start = end
00253 end += 12
00254 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00255 start = end
00256 end += 4
00257 (length,) = _struct_I.unpack(str[start:end])
00258 start = end
00259 end += length
00260 self.header.frame_id = str[start:end]
00261 _x = self
00262 start = end
00263 end += 32
00264 (_x.angle_min, _x.angle_max, _x.angle_increment, _x.time_increment, _x.range_min, _x.range_max, _x.readings_per_scan, _x.num_scans,) = _struct_6f2I.unpack(str[start:end])
00265 start = end
00266 end += 4
00267 (length,) = _struct_I.unpack(str[start:end])
00268 pattern = '<%sf'%length
00269 start = end
00270 end += struct.calcsize(pattern)
00271 self.ranges = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00272 start = end
00273 end += 4
00274 (length,) = _struct_I.unpack(str[start:end])
00275 pattern = '<%sf'%length
00276 start = end
00277 end += struct.calcsize(pattern)
00278 self.intensities = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00279 start = end
00280 end += 4
00281 (length,) = _struct_I.unpack(str[start:end])
00282 self.scan_start = []
00283 for i in xrange(0, length):
00284 val1 = roslib.rostime.Time()
00285 _x = val1
00286 start = end
00287 end += 8
00288 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00289 self.scan_start.append(val1)
00290 return self
00291 except struct.error, e:
00292 raise roslib.message.DeserializationError(e)
00293
00294 _struct_I = roslib.message.struct_I
00295 _struct_3I = struct.Struct("<3I")
00296 _struct_2I = struct.Struct("<2I")
00297 _struct_6f2I = struct.Struct("<6f2I")