_CompressedOccupancyGrid.py
Go to the documentation of this file.
00001 """autogenerated by genpy from map_compressor/CompressedOccupancyGrid.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 geometry_msgs.msg
00008 import nav_msgs.msg
00009 import genpy
00010 import std_msgs.msg
00011 
00012 class CompressedOccupancyGrid(genpy.Message):
00013   _md5sum = "4a0685de3ed14662c76d0e78e9589b5c"
00014   _type = "map_compressor/CompressedOccupancyGrid"
00015   _has_header = True #flag to mark the presence of a Header object
00016   _full_text = """std_msgs/Header header
00017 nav_msgs/MapMetaData info
00018 int64[] data
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 MSG: nav_msgs/MapMetaData
00039 # This hold basic information about the characterists of the OccupancyGrid
00040 
00041 # The time at which the map was loaded
00042 time map_load_time
00043 # The map resolution [m/cell]
00044 float32 resolution
00045 # Map width [cells]
00046 uint32 width
00047 # Map height [cells]
00048 uint32 height
00049 # The origin of the map [m, m, rad].  This is the real-world pose of the
00050 # cell (0,0) in the map.
00051 geometry_msgs/Pose origin
00052 ================================================================================
00053 MSG: geometry_msgs/Pose
00054 # A representation of pose in free space, composed of postion and orientation. 
00055 Point position
00056 Quaternion orientation
00057 
00058 ================================================================================
00059 MSG: geometry_msgs/Point
00060 # This contains the position of a point in free space
00061 float64 x
00062 float64 y
00063 float64 z
00064 
00065 ================================================================================
00066 MSG: geometry_msgs/Quaternion
00067 # This represents an orientation in free space in quaternion form.
00068 
00069 float64 x
00070 float64 y
00071 float64 z
00072 float64 w
00073 
00074 """
00075   __slots__ = ['header','info','data']
00076   _slot_types = ['std_msgs/Header','nav_msgs/MapMetaData','int64[]']
00077 
00078   def __init__(self, *args, **kwds):
00079     """
00080     Constructor. Any message fields that are implicitly/explicitly
00081     set to None will be assigned a default value. The recommend
00082     use is keyword arguments as this is more robust to future message
00083     changes.  You cannot mix in-order arguments and keyword arguments.
00084 
00085     The available fields are:
00086        header,info,data
00087 
00088     :param args: complete set of field values, in .msg order
00089     :param kwds: use keyword arguments corresponding to message field names
00090     to set specific fields.
00091     """
00092     if args or kwds:
00093       super(CompressedOccupancyGrid, self).__init__(*args, **kwds)
00094       #message fields cannot be None, assign default values for those that are
00095       if self.header is None:
00096         self.header = std_msgs.msg.Header()
00097       if self.info is None:
00098         self.info = nav_msgs.msg.MapMetaData()
00099       if self.data is None:
00100         self.data = []
00101     else:
00102       self.header = std_msgs.msg.Header()
00103       self.info = nav_msgs.msg.MapMetaData()
00104       self.data = []
00105 
00106   def _get_types(self):
00107     """
00108     internal API method
00109     """
00110     return self._slot_types
00111 
00112   def serialize(self, buff):
00113     """
00114     serialize message into buffer
00115     :param buff: buffer, ``StringIO``
00116     """
00117     try:
00118       _x = self
00119       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00120       _x = self.header.frame_id
00121       length = len(_x)
00122       if python3 or type(_x) == unicode:
00123         _x = _x.encode('utf-8')
00124         length = len(_x)
00125       buff.write(struct.pack('<I%ss'%length, length, _x))
00126       _x = self
00127       buff.write(_struct_2If2I7d.pack(_x.info.map_load_time.secs, _x.info.map_load_time.nsecs, _x.info.resolution, _x.info.width, _x.info.height, _x.info.origin.position.x, _x.info.origin.position.y, _x.info.origin.position.z, _x.info.origin.orientation.x, _x.info.origin.orientation.y, _x.info.origin.orientation.z, _x.info.origin.orientation.w))
00128       length = len(self.data)
00129       buff.write(_struct_I.pack(length))
00130       pattern = '<%sq'%length
00131       buff.write(struct.pack(pattern, *self.data))
00132     except struct.error as se: self._check_types(se)
00133     except TypeError as te: self._check_types(te)
00134 
00135   def deserialize(self, str):
00136     """
00137     unpack serialized message in str into this message instance
00138     :param str: byte array of serialized message, ``str``
00139     """
00140     try:
00141       if self.header is None:
00142         self.header = std_msgs.msg.Header()
00143       if self.info is None:
00144         self.info = nav_msgs.msg.MapMetaData()
00145       end = 0
00146       _x = self
00147       start = end
00148       end += 12
00149       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00150       start = end
00151       end += 4
00152       (length,) = _struct_I.unpack(str[start:end])
00153       start = end
00154       end += length
00155       if python3:
00156         self.header.frame_id = str[start:end].decode('utf-8')
00157       else:
00158         self.header.frame_id = str[start:end]
00159       _x = self
00160       start = end
00161       end += 76
00162       (_x.info.map_load_time.secs, _x.info.map_load_time.nsecs, _x.info.resolution, _x.info.width, _x.info.height, _x.info.origin.position.x, _x.info.origin.position.y, _x.info.origin.position.z, _x.info.origin.orientation.x, _x.info.origin.orientation.y, _x.info.origin.orientation.z, _x.info.origin.orientation.w,) = _struct_2If2I7d.unpack(str[start:end])
00163       start = end
00164       end += 4
00165       (length,) = _struct_I.unpack(str[start:end])
00166       pattern = '<%sq'%length
00167       start = end
00168       end += struct.calcsize(pattern)
00169       self.data = struct.unpack(pattern, str[start:end])
00170       return self
00171     except struct.error as e:
00172       raise genpy.DeserializationError(e) #most likely buffer underfill
00173 
00174 
00175   def serialize_numpy(self, buff, numpy):
00176     """
00177     serialize message with numpy array types into buffer
00178     :param buff: buffer, ``StringIO``
00179     :param numpy: numpy python module
00180     """
00181     try:
00182       _x = self
00183       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00184       _x = self.header.frame_id
00185       length = len(_x)
00186       if python3 or type(_x) == unicode:
00187         _x = _x.encode('utf-8')
00188         length = len(_x)
00189       buff.write(struct.pack('<I%ss'%length, length, _x))
00190       _x = self
00191       buff.write(_struct_2If2I7d.pack(_x.info.map_load_time.secs, _x.info.map_load_time.nsecs, _x.info.resolution, _x.info.width, _x.info.height, _x.info.origin.position.x, _x.info.origin.position.y, _x.info.origin.position.z, _x.info.origin.orientation.x, _x.info.origin.orientation.y, _x.info.origin.orientation.z, _x.info.origin.orientation.w))
00192       length = len(self.data)
00193       buff.write(_struct_I.pack(length))
00194       pattern = '<%sq'%length
00195       buff.write(self.data.tostring())
00196     except struct.error as se: self._check_types(se)
00197     except TypeError as te: self._check_types(te)
00198 
00199   def deserialize_numpy(self, str, numpy):
00200     """
00201     unpack serialized message in str into this message instance using numpy for array types
00202     :param str: byte array of serialized message, ``str``
00203     :param numpy: numpy python module
00204     """
00205     try:
00206       if self.header is None:
00207         self.header = std_msgs.msg.Header()
00208       if self.info is None:
00209         self.info = nav_msgs.msg.MapMetaData()
00210       end = 0
00211       _x = self
00212       start = end
00213       end += 12
00214       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00215       start = end
00216       end += 4
00217       (length,) = _struct_I.unpack(str[start:end])
00218       start = end
00219       end += length
00220       if python3:
00221         self.header.frame_id = str[start:end].decode('utf-8')
00222       else:
00223         self.header.frame_id = str[start:end]
00224       _x = self
00225       start = end
00226       end += 76
00227       (_x.info.map_load_time.secs, _x.info.map_load_time.nsecs, _x.info.resolution, _x.info.width, _x.info.height, _x.info.origin.position.x, _x.info.origin.position.y, _x.info.origin.position.z, _x.info.origin.orientation.x, _x.info.origin.orientation.y, _x.info.origin.orientation.z, _x.info.origin.orientation.w,) = _struct_2If2I7d.unpack(str[start:end])
00228       start = end
00229       end += 4
00230       (length,) = _struct_I.unpack(str[start:end])
00231       pattern = '<%sq'%length
00232       start = end
00233       end += struct.calcsize(pattern)
00234       self.data = numpy.frombuffer(str[start:end], dtype=numpy.int64, count=length)
00235       return self
00236     except struct.error as e:
00237       raise genpy.DeserializationError(e) #most likely buffer underfill
00238 
00239 _struct_I = genpy.struct_I
00240 _struct_3I = struct.Struct("<3I")
00241 _struct_2If2I7d = struct.Struct("<2If2I7d")


map_compressor
Author(s): Bener Suay
autogenerated on Fri Jan 3 2014 11:11:19