_ElevationGrid.py
Go to the documentation of this file.
00001 """autogenerated by genpy from hector_elevation_msgs/ElevationGrid.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 genpy
00009 import hector_elevation_msgs.msg
00010 import std_msgs.msg
00011 
00012 class ElevationGrid(genpy.Message):
00013   _md5sum = "13f6dd2a4434f89ebecd8bfafa38cdf1"
00014   _type = "hector_elevation_msgs/ElevationGrid"
00015   _has_header = True #flag to mark the presence of a Header object
00016   _full_text = """# This represents a 2-D grid map, in which each cell represents the elevation.
00017 
00018 Header header 
00019 
00020 #MetaData for the map
00021 ElevationMapMetaData info
00022 
00023 # The map data, in row-major order, starting with (0,0).  Elevation values 
00024 # are in the range [0,32768].
00025 # -> 0 belongs to max negative elevation, 32767 to max positive elevation, "elevation_zero_level" coresponds to zero, -elevation_zero_level to unknown elevation
00026 int16[] data
00027 
00028 ================================================================================
00029 MSG: std_msgs/Header
00030 # Standard metadata for higher-level stamped data types.
00031 # This is generally used to communicate timestamped data 
00032 # in a particular coordinate frame.
00033 # 
00034 # sequence ID: consecutively increasing ID 
00035 uint32 seq
00036 #Two-integer timestamp that is expressed as:
00037 # * stamp.secs: seconds (stamp_secs) since epoch
00038 # * stamp.nsecs: nanoseconds since stamp_secs
00039 # time-handling sugar is provided by the client library
00040 time stamp
00041 #Frame this data is associated with
00042 # 0: no frame
00043 # 1: global frame
00044 string frame_id
00045 
00046 ================================================================================
00047 MSG: hector_elevation_msgs/ElevationMapMetaData
00048 # This hold basic information about the characterists of the EvaluationGrid
00049 
00050 # The time at which the map was loaded
00051 time map_load_time
00052 # Map resolution in xy plane [m/cell]
00053 float64 resolution_xy
00054 # Map resolution in height [m/cell]
00055 float64 resolution_z
00056 # min observed height [m]
00057 float64 min_elevation
00058 # max observed height [m]
00059 float64 max_elevation
00060 # Height zero value. For example 16384.
00061 int16 zero_elevation
00062 # Map width [cells]
00063 uint32 width
00064 # Map height [cells]
00065 uint32 height
00066 # The origin of the map [m, m, rad].  This is the real-world pose of the
00067 # cell (0,0) in the map.
00068 geometry_msgs/Pose origin
00069 
00070 
00071 
00072 ================================================================================
00073 MSG: geometry_msgs/Pose
00074 # A representation of pose in free space, composed of postion and orientation. 
00075 Point position
00076 Quaternion orientation
00077 
00078 ================================================================================
00079 MSG: geometry_msgs/Point
00080 # This contains the position of a point in free space
00081 float64 x
00082 float64 y
00083 float64 z
00084 
00085 ================================================================================
00086 MSG: geometry_msgs/Quaternion
00087 # This represents an orientation in free space in quaternion form.
00088 
00089 float64 x
00090 float64 y
00091 float64 z
00092 float64 w
00093 
00094 """
00095   __slots__ = ['header','info','data']
00096   _slot_types = ['std_msgs/Header','hector_elevation_msgs/ElevationMapMetaData','int16[]']
00097 
00098   def __init__(self, *args, **kwds):
00099     """
00100     Constructor. Any message fields that are implicitly/explicitly
00101     set to None will be assigned a default value. The recommend
00102     use is keyword arguments as this is more robust to future message
00103     changes.  You cannot mix in-order arguments and keyword arguments.
00104 
00105     The available fields are:
00106        header,info,data
00107 
00108     :param args: complete set of field values, in .msg order
00109     :param kwds: use keyword arguments corresponding to message field names
00110     to set specific fields.
00111     """
00112     if args or kwds:
00113       super(ElevationGrid, self).__init__(*args, **kwds)
00114       #message fields cannot be None, assign default values for those that are
00115       if self.header is None:
00116         self.header = std_msgs.msg.Header()
00117       if self.info is None:
00118         self.info = hector_elevation_msgs.msg.ElevationMapMetaData()
00119       if self.data is None:
00120         self.data = []
00121     else:
00122       self.header = std_msgs.msg.Header()
00123       self.info = hector_elevation_msgs.msg.ElevationMapMetaData()
00124       self.data = []
00125 
00126   def _get_types(self):
00127     """
00128     internal API method
00129     """
00130     return self._slot_types
00131 
00132   def serialize(self, buff):
00133     """
00134     serialize message into buffer
00135     :param buff: buffer, ``StringIO``
00136     """
00137     try:
00138       _x = self
00139       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00140       _x = self.header.frame_id
00141       length = len(_x)
00142       if python3 or type(_x) == unicode:
00143         _x = _x.encode('utf-8')
00144         length = len(_x)
00145       buff.write(struct.pack('<I%ss'%length, length, _x))
00146       _x = self
00147       buff.write(_struct_2I4dh2I7d.pack(_x.info.map_load_time.secs, _x.info.map_load_time.nsecs, _x.info.resolution_xy, _x.info.resolution_z, _x.info.min_elevation, _x.info.max_elevation, _x.info.zero_elevation, _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))
00148       length = len(self.data)
00149       buff.write(_struct_I.pack(length))
00150       pattern = '<%sh'%length
00151       buff.write(struct.pack(pattern, *self.data))
00152     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00153     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00154 
00155   def deserialize(self, str):
00156     """
00157     unpack serialized message in str into this message instance
00158     :param str: byte array of serialized message, ``str``
00159     """
00160     try:
00161       if self.header is None:
00162         self.header = std_msgs.msg.Header()
00163       if self.info is None:
00164         self.info = hector_elevation_msgs.msg.ElevationMapMetaData()
00165       end = 0
00166       _x = self
00167       start = end
00168       end += 12
00169       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00170       start = end
00171       end += 4
00172       (length,) = _struct_I.unpack(str[start:end])
00173       start = end
00174       end += length
00175       if python3:
00176         self.header.frame_id = str[start:end].decode('utf-8')
00177       else:
00178         self.header.frame_id = str[start:end]
00179       _x = self
00180       start = end
00181       end += 106
00182       (_x.info.map_load_time.secs, _x.info.map_load_time.nsecs, _x.info.resolution_xy, _x.info.resolution_z, _x.info.min_elevation, _x.info.max_elevation, _x.info.zero_elevation, _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_2I4dh2I7d.unpack(str[start:end])
00183       start = end
00184       end += 4
00185       (length,) = _struct_I.unpack(str[start:end])
00186       pattern = '<%sh'%length
00187       start = end
00188       end += struct.calcsize(pattern)
00189       self.data = struct.unpack(pattern, str[start:end])
00190       return self
00191     except struct.error as e:
00192       raise genpy.DeserializationError(e) #most likely buffer underfill
00193 
00194 
00195   def serialize_numpy(self, buff, numpy):
00196     """
00197     serialize message with numpy array types into buffer
00198     :param buff: buffer, ``StringIO``
00199     :param numpy: numpy python module
00200     """
00201     try:
00202       _x = self
00203       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00204       _x = self.header.frame_id
00205       length = len(_x)
00206       if python3 or type(_x) == unicode:
00207         _x = _x.encode('utf-8')
00208         length = len(_x)
00209       buff.write(struct.pack('<I%ss'%length, length, _x))
00210       _x = self
00211       buff.write(_struct_2I4dh2I7d.pack(_x.info.map_load_time.secs, _x.info.map_load_time.nsecs, _x.info.resolution_xy, _x.info.resolution_z, _x.info.min_elevation, _x.info.max_elevation, _x.info.zero_elevation, _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))
00212       length = len(self.data)
00213       buff.write(_struct_I.pack(length))
00214       pattern = '<%sh'%length
00215       buff.write(self.data.tostring())
00216     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00217     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00218 
00219   def deserialize_numpy(self, str, numpy):
00220     """
00221     unpack serialized message in str into this message instance using numpy for array types
00222     :param str: byte array of serialized message, ``str``
00223     :param numpy: numpy python module
00224     """
00225     try:
00226       if self.header is None:
00227         self.header = std_msgs.msg.Header()
00228       if self.info is None:
00229         self.info = hector_elevation_msgs.msg.ElevationMapMetaData()
00230       end = 0
00231       _x = self
00232       start = end
00233       end += 12
00234       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00235       start = end
00236       end += 4
00237       (length,) = _struct_I.unpack(str[start:end])
00238       start = end
00239       end += length
00240       if python3:
00241         self.header.frame_id = str[start:end].decode('utf-8')
00242       else:
00243         self.header.frame_id = str[start:end]
00244       _x = self
00245       start = end
00246       end += 106
00247       (_x.info.map_load_time.secs, _x.info.map_load_time.nsecs, _x.info.resolution_xy, _x.info.resolution_z, _x.info.min_elevation, _x.info.max_elevation, _x.info.zero_elevation, _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_2I4dh2I7d.unpack(str[start:end])
00248       start = end
00249       end += 4
00250       (length,) = _struct_I.unpack(str[start:end])
00251       pattern = '<%sh'%length
00252       start = end
00253       end += struct.calcsize(pattern)
00254       self.data = numpy.frombuffer(str[start:end], dtype=numpy.int16, count=length)
00255       return self
00256     except struct.error as e:
00257       raise genpy.DeserializationError(e) #most likely buffer underfill
00258 
00259 _struct_I = genpy.struct_I
00260 _struct_3I = struct.Struct("<3I")
00261 _struct_2I4dh2I7d = struct.Struct("<2I4dh2I7d")


hector_elevation_msgs
Author(s): Thorsten Graber
autogenerated on Mon Oct 6 2014 00:26:43