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