00001 """autogenerated by genmsg_py from OverlayClouds.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geometry_msgs.msg
00006 import nav_msgs.msg
00007 import roslib.rostime
00008 import std_msgs.msg
00009
00010 class OverlayClouds(roslib.message.Message):
00011 _md5sum = "a1dfac662600ca9b91b434a76485a5d9"
00012 _type = "occupancy_grid_utils/OverlayClouds"
00013 _has_header = False
00014 _full_text = """nav_msgs/OccupancyGrid grid
00015 string frame_id
00016 float32 occupancy_threshold
00017 float32 max_distance
00018 float32 min_pass_through
00019 int32[] hit_counts
00020 int32[] pass_through_counts
00021 ================================================================================
00022 MSG: nav_msgs/OccupancyGrid
00023 # This represents a 2-D grid map, in which each cell represents the probability of
00024 # occupancy.
00025
00026 Header header
00027
00028 #MetaData for the map
00029 MapMetaData info
00030
00031 # The map data, in row-major order, starting with (0,0). Occupancy
00032 # probabilities are in the range [0,100]. Unknown is -1.
00033 int8[] data
00034
00035 ================================================================================
00036 MSG: std_msgs/Header
00037 # Standard metadata for higher-level stamped data types.
00038 # This is generally used to communicate timestamped data
00039 # in a particular coordinate frame.
00040 #
00041 # sequence ID: consecutively increasing ID
00042 uint32 seq
00043 #Two-integer timestamp that is expressed as:
00044 # * stamp.secs: seconds (stamp_secs) since epoch
00045 # * stamp.nsecs: nanoseconds since stamp_secs
00046 # time-handling sugar is provided by the client library
00047 time stamp
00048 #Frame this data is associated with
00049 # 0: no frame
00050 # 1: global frame
00051 string frame_id
00052
00053 ================================================================================
00054 MSG: nav_msgs/MapMetaData
00055 # This hold basic information about the characterists of the OccupancyGrid
00056
00057 # The time at which the map was loaded
00058 time map_load_time
00059 # The map resolution [m/cell]
00060 float32 resolution
00061 # Map width [cells]
00062 uint32 width
00063 # Map height [cells]
00064 uint32 height
00065 # The origin of the map [m, m, rad]. This is the real-world pose of the
00066 # cell (0,0) in the map.
00067 geometry_msgs/Pose origin
00068 ================================================================================
00069 MSG: geometry_msgs/Pose
00070 # A representation of pose in free space, composed of postion and orientation.
00071 Point position
00072 Quaternion orientation
00073
00074 ================================================================================
00075 MSG: geometry_msgs/Point
00076 # This contains the position of a point in free space
00077 float64 x
00078 float64 y
00079 float64 z
00080
00081 ================================================================================
00082 MSG: geometry_msgs/Quaternion
00083 # This represents an orientation in free space in quaternion form.
00084
00085 float64 x
00086 float64 y
00087 float64 z
00088 float64 w
00089
00090 """
00091 __slots__ = ['grid','frame_id','occupancy_threshold','max_distance','min_pass_through','hit_counts','pass_through_counts']
00092 _slot_types = ['nav_msgs/OccupancyGrid','string','float32','float32','float32','int32[]','int32[]']
00093
00094 def __init__(self, *args, **kwds):
00095 """
00096 Constructor. Any message fields that are implicitly/explicitly
00097 set to None will be assigned a default value. The recommend
00098 use is keyword arguments as this is more robust to future message
00099 changes. You cannot mix in-order arguments and keyword arguments.
00100
00101 The available fields are:
00102 grid,frame_id,occupancy_threshold,max_distance,min_pass_through,hit_counts,pass_through_counts
00103
00104 @param args: complete set of field values, in .msg order
00105 @param kwds: use keyword arguments corresponding to message field names
00106 to set specific fields.
00107 """
00108 if args or kwds:
00109 super(OverlayClouds, self).__init__(*args, **kwds)
00110
00111 if self.grid is None:
00112 self.grid = nav_msgs.msg.OccupancyGrid()
00113 if self.frame_id is None:
00114 self.frame_id = ''
00115 if self.occupancy_threshold is None:
00116 self.occupancy_threshold = 0.
00117 if self.max_distance is None:
00118 self.max_distance = 0.
00119 if self.min_pass_through is None:
00120 self.min_pass_through = 0.
00121 if self.hit_counts is None:
00122 self.hit_counts = []
00123 if self.pass_through_counts is None:
00124 self.pass_through_counts = []
00125 else:
00126 self.grid = nav_msgs.msg.OccupancyGrid()
00127 self.frame_id = ''
00128 self.occupancy_threshold = 0.
00129 self.max_distance = 0.
00130 self.min_pass_through = 0.
00131 self.hit_counts = []
00132 self.pass_through_counts = []
00133
00134 def _get_types(self):
00135 """
00136 internal API method
00137 """
00138 return self._slot_types
00139
00140 def serialize(self, buff):
00141 """
00142 serialize message into buffer
00143 @param buff: buffer
00144 @type buff: StringIO
00145 """
00146 try:
00147 _x = self
00148 buff.write(_struct_3I.pack(_x.grid.header.seq, _x.grid.header.stamp.secs, _x.grid.header.stamp.nsecs))
00149 _x = self.grid.header.frame_id
00150 length = len(_x)
00151 buff.write(struct.pack('<I%ss'%length, length, _x))
00152 _x = self
00153 buff.write(_struct_2If2I7d.pack(_x.grid.info.map_load_time.secs, _x.grid.info.map_load_time.nsecs, _x.grid.info.resolution, _x.grid.info.width, _x.grid.info.height, _x.grid.info.origin.position.x, _x.grid.info.origin.position.y, _x.grid.info.origin.position.z, _x.grid.info.origin.orientation.x, _x.grid.info.origin.orientation.y, _x.grid.info.origin.orientation.z, _x.grid.info.origin.orientation.w))
00154 length = len(self.grid.data)
00155 buff.write(_struct_I.pack(length))
00156 pattern = '<%sb'%length
00157 buff.write(struct.pack(pattern, *self.grid.data))
00158 _x = self.frame_id
00159 length = len(_x)
00160 buff.write(struct.pack('<I%ss'%length, length, _x))
00161 _x = self
00162 buff.write(_struct_3f.pack(_x.occupancy_threshold, _x.max_distance, _x.min_pass_through))
00163 length = len(self.hit_counts)
00164 buff.write(_struct_I.pack(length))
00165 pattern = '<%si'%length
00166 buff.write(struct.pack(pattern, *self.hit_counts))
00167 length = len(self.pass_through_counts)
00168 buff.write(_struct_I.pack(length))
00169 pattern = '<%si'%length
00170 buff.write(struct.pack(pattern, *self.pass_through_counts))
00171 except struct.error, se: self._check_types(se)
00172 except TypeError, te: self._check_types(te)
00173
00174 def deserialize(self, str):
00175 """
00176 unpack serialized message in str into this message instance
00177 @param str: byte array of serialized message
00178 @type str: str
00179 """
00180 try:
00181 if self.grid is None:
00182 self.grid = nav_msgs.msg.OccupancyGrid()
00183 end = 0
00184 _x = self
00185 start = end
00186 end += 12
00187 (_x.grid.header.seq, _x.grid.header.stamp.secs, _x.grid.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00188 start = end
00189 end += 4
00190 (length,) = _struct_I.unpack(str[start:end])
00191 start = end
00192 end += length
00193 self.grid.header.frame_id = str[start:end]
00194 _x = self
00195 start = end
00196 end += 76
00197 (_x.grid.info.map_load_time.secs, _x.grid.info.map_load_time.nsecs, _x.grid.info.resolution, _x.grid.info.width, _x.grid.info.height, _x.grid.info.origin.position.x, _x.grid.info.origin.position.y, _x.grid.info.origin.position.z, _x.grid.info.origin.orientation.x, _x.grid.info.origin.orientation.y, _x.grid.info.origin.orientation.z, _x.grid.info.origin.orientation.w,) = _struct_2If2I7d.unpack(str[start:end])
00198 start = end
00199 end += 4
00200 (length,) = _struct_I.unpack(str[start:end])
00201 pattern = '<%sb'%length
00202 start = end
00203 end += struct.calcsize(pattern)
00204 self.grid.data = struct.unpack(pattern, str[start:end])
00205 start = end
00206 end += 4
00207 (length,) = _struct_I.unpack(str[start:end])
00208 start = end
00209 end += length
00210 self.frame_id = str[start:end]
00211 _x = self
00212 start = end
00213 end += 12
00214 (_x.occupancy_threshold, _x.max_distance, _x.min_pass_through,) = _struct_3f.unpack(str[start:end])
00215 start = end
00216 end += 4
00217 (length,) = _struct_I.unpack(str[start:end])
00218 pattern = '<%si'%length
00219 start = end
00220 end += struct.calcsize(pattern)
00221 self.hit_counts = struct.unpack(pattern, str[start:end])
00222 start = end
00223 end += 4
00224 (length,) = _struct_I.unpack(str[start:end])
00225 pattern = '<%si'%length
00226 start = end
00227 end += struct.calcsize(pattern)
00228 self.pass_through_counts = struct.unpack(pattern, str[start:end])
00229 return self
00230 except struct.error, e:
00231 raise roslib.message.DeserializationError(e)
00232
00233
00234 def serialize_numpy(self, buff, numpy):
00235 """
00236 serialize message with numpy array types into buffer
00237 @param buff: buffer
00238 @type buff: StringIO
00239 @param numpy: numpy python module
00240 @type numpy module
00241 """
00242 try:
00243 _x = self
00244 buff.write(_struct_3I.pack(_x.grid.header.seq, _x.grid.header.stamp.secs, _x.grid.header.stamp.nsecs))
00245 _x = self.grid.header.frame_id
00246 length = len(_x)
00247 buff.write(struct.pack('<I%ss'%length, length, _x))
00248 _x = self
00249 buff.write(_struct_2If2I7d.pack(_x.grid.info.map_load_time.secs, _x.grid.info.map_load_time.nsecs, _x.grid.info.resolution, _x.grid.info.width, _x.grid.info.height, _x.grid.info.origin.position.x, _x.grid.info.origin.position.y, _x.grid.info.origin.position.z, _x.grid.info.origin.orientation.x, _x.grid.info.origin.orientation.y, _x.grid.info.origin.orientation.z, _x.grid.info.origin.orientation.w))
00250 length = len(self.grid.data)
00251 buff.write(_struct_I.pack(length))
00252 pattern = '<%sb'%length
00253 buff.write(self.grid.data.tostring())
00254 _x = self.frame_id
00255 length = len(_x)
00256 buff.write(struct.pack('<I%ss'%length, length, _x))
00257 _x = self
00258 buff.write(_struct_3f.pack(_x.occupancy_threshold, _x.max_distance, _x.min_pass_through))
00259 length = len(self.hit_counts)
00260 buff.write(_struct_I.pack(length))
00261 pattern = '<%si'%length
00262 buff.write(self.hit_counts.tostring())
00263 length = len(self.pass_through_counts)
00264 buff.write(_struct_I.pack(length))
00265 pattern = '<%si'%length
00266 buff.write(self.pass_through_counts.tostring())
00267 except struct.error, se: self._check_types(se)
00268 except TypeError, te: self._check_types(te)
00269
00270 def deserialize_numpy(self, str, numpy):
00271 """
00272 unpack serialized message in str into this message instance using numpy for array types
00273 @param str: byte array of serialized message
00274 @type str: str
00275 @param numpy: numpy python module
00276 @type numpy: module
00277 """
00278 try:
00279 if self.grid is None:
00280 self.grid = nav_msgs.msg.OccupancyGrid()
00281 end = 0
00282 _x = self
00283 start = end
00284 end += 12
00285 (_x.grid.header.seq, _x.grid.header.stamp.secs, _x.grid.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00286 start = end
00287 end += 4
00288 (length,) = _struct_I.unpack(str[start:end])
00289 start = end
00290 end += length
00291 self.grid.header.frame_id = str[start:end]
00292 _x = self
00293 start = end
00294 end += 76
00295 (_x.grid.info.map_load_time.secs, _x.grid.info.map_load_time.nsecs, _x.grid.info.resolution, _x.grid.info.width, _x.grid.info.height, _x.grid.info.origin.position.x, _x.grid.info.origin.position.y, _x.grid.info.origin.position.z, _x.grid.info.origin.orientation.x, _x.grid.info.origin.orientation.y, _x.grid.info.origin.orientation.z, _x.grid.info.origin.orientation.w,) = _struct_2If2I7d.unpack(str[start:end])
00296 start = end
00297 end += 4
00298 (length,) = _struct_I.unpack(str[start:end])
00299 pattern = '<%sb'%length
00300 start = end
00301 end += struct.calcsize(pattern)
00302 self.grid.data = numpy.frombuffer(str[start:end], dtype=numpy.int8, count=length)
00303 start = end
00304 end += 4
00305 (length,) = _struct_I.unpack(str[start:end])
00306 start = end
00307 end += length
00308 self.frame_id = str[start:end]
00309 _x = self
00310 start = end
00311 end += 12
00312 (_x.occupancy_threshold, _x.max_distance, _x.min_pass_through,) = _struct_3f.unpack(str[start:end])
00313 start = end
00314 end += 4
00315 (length,) = _struct_I.unpack(str[start:end])
00316 pattern = '<%si'%length
00317 start = end
00318 end += struct.calcsize(pattern)
00319 self.hit_counts = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00320 start = end
00321 end += 4
00322 (length,) = _struct_I.unpack(str[start:end])
00323 pattern = '<%si'%length
00324 start = end
00325 end += struct.calcsize(pattern)
00326 self.pass_through_counts = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00327 return self
00328 except struct.error, e:
00329 raise roslib.message.DeserializationError(e)
00330
00331 _struct_I = roslib.message.struct_I
00332 _struct_3I = struct.Struct("<3I")
00333 _struct_3f = struct.Struct("<3f")
00334 _struct_2If2I7d = struct.Struct("<2If2I7d")