$search
00001 """autogenerated by genmsg_py from VoxelGrid.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 import std_msgs.msg 00007 00008 class VoxelGrid(roslib.message.Message): 00009 _md5sum = "48a040827e1322073d78ece5a497029c" 00010 _type = "costmap_2d/VoxelGrid" 00011 _has_header = True #flag to mark the presence of a Header object 00012 _full_text = """Header header 00013 uint32[] data 00014 geometry_msgs/Point32 origin 00015 geometry_msgs/Vector3 resolutions 00016 uint32 size_x 00017 uint32 size_y 00018 uint32 size_z 00019 00020 00021 ================================================================================ 00022 MSG: std_msgs/Header 00023 # Standard metadata for higher-level stamped data types. 00024 # This is generally used to communicate timestamped data 00025 # in a particular coordinate frame. 00026 # 00027 # sequence ID: consecutively increasing ID 00028 uint32 seq 00029 #Two-integer timestamp that is expressed as: 00030 # * stamp.secs: seconds (stamp_secs) since epoch 00031 # * stamp.nsecs: nanoseconds since stamp_secs 00032 # time-handling sugar is provided by the client library 00033 time stamp 00034 #Frame this data is associated with 00035 # 0: no frame 00036 # 1: global frame 00037 string frame_id 00038 00039 ================================================================================ 00040 MSG: geometry_msgs/Point32 00041 # This contains the position of a point in free space(with 32 bits of precision). 00042 # It is recommeded to use Point wherever possible instead of Point32. 00043 # 00044 # This recommendation is to promote interoperability. 00045 # 00046 # This message is designed to take up less space when sending 00047 # lots of points at once, as in the case of a PointCloud. 00048 00049 float32 x 00050 float32 y 00051 float32 z 00052 ================================================================================ 00053 MSG: geometry_msgs/Vector3 00054 # This represents a vector in free space. 00055 00056 float64 x 00057 float64 y 00058 float64 z 00059 """ 00060 __slots__ = ['header','data','origin','resolutions','size_x','size_y','size_z'] 00061 _slot_types = ['Header','uint32[]','geometry_msgs/Point32','geometry_msgs/Vector3','uint32','uint32','uint32'] 00062 00063 def __init__(self, *args, **kwds): 00064 """ 00065 Constructor. Any message fields that are implicitly/explicitly 00066 set to None will be assigned a default value. The recommend 00067 use is keyword arguments as this is more robust to future message 00068 changes. You cannot mix in-order arguments and keyword arguments. 00069 00070 The available fields are: 00071 header,data,origin,resolutions,size_x,size_y,size_z 00072 00073 @param args: complete set of field values, in .msg order 00074 @param kwds: use keyword arguments corresponding to message field names 00075 to set specific fields. 00076 """ 00077 if args or kwds: 00078 super(VoxelGrid, self).__init__(*args, **kwds) 00079 #message fields cannot be None, assign default values for those that are 00080 if self.header is None: 00081 self.header = std_msgs.msg._Header.Header() 00082 if self.data is None: 00083 self.data = [] 00084 if self.origin is None: 00085 self.origin = geometry_msgs.msg.Point32() 00086 if self.resolutions is None: 00087 self.resolutions = geometry_msgs.msg.Vector3() 00088 if self.size_x is None: 00089 self.size_x = 0 00090 if self.size_y is None: 00091 self.size_y = 0 00092 if self.size_z is None: 00093 self.size_z = 0 00094 else: 00095 self.header = std_msgs.msg._Header.Header() 00096 self.data = [] 00097 self.origin = geometry_msgs.msg.Point32() 00098 self.resolutions = geometry_msgs.msg.Vector3() 00099 self.size_x = 0 00100 self.size_y = 0 00101 self.size_z = 0 00102 00103 def _get_types(self): 00104 """ 00105 internal API method 00106 """ 00107 return self._slot_types 00108 00109 def serialize(self, buff): 00110 """ 00111 serialize message into buffer 00112 @param buff: buffer 00113 @type buff: StringIO 00114 """ 00115 try: 00116 _x = self 00117 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00118 _x = self.header.frame_id 00119 length = len(_x) 00120 buff.write(struct.pack('<I%ss'%length, length, _x)) 00121 length = len(self.data) 00122 buff.write(_struct_I.pack(length)) 00123 pattern = '<%sI'%length 00124 buff.write(struct.pack(pattern, *self.data)) 00125 _x = self 00126 buff.write(_struct_3f3d3I.pack(_x.origin.x, _x.origin.y, _x.origin.z, _x.resolutions.x, _x.resolutions.y, _x.resolutions.z, _x.size_x, _x.size_y, _x.size_z)) 00127 except struct.error as se: self._check_types(se) 00128 except TypeError as te: self._check_types(te) 00129 00130 def deserialize(self, str): 00131 """ 00132 unpack serialized message in str into this message instance 00133 @param str: byte array of serialized message 00134 @type str: str 00135 """ 00136 try: 00137 if self.header is None: 00138 self.header = std_msgs.msg._Header.Header() 00139 if self.origin is None: 00140 self.origin = geometry_msgs.msg.Point32() 00141 if self.resolutions is None: 00142 self.resolutions = geometry_msgs.msg.Vector3() 00143 end = 0 00144 _x = self 00145 start = end 00146 end += 12 00147 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00148 start = end 00149 end += 4 00150 (length,) = _struct_I.unpack(str[start:end]) 00151 start = end 00152 end += length 00153 self.header.frame_id = str[start:end] 00154 start = end 00155 end += 4 00156 (length,) = _struct_I.unpack(str[start:end]) 00157 pattern = '<%sI'%length 00158 start = end 00159 end += struct.calcsize(pattern) 00160 self.data = struct.unpack(pattern, str[start:end]) 00161 _x = self 00162 start = end 00163 end += 48 00164 (_x.origin.x, _x.origin.y, _x.origin.z, _x.resolutions.x, _x.resolutions.y, _x.resolutions.z, _x.size_x, _x.size_y, _x.size_z,) = _struct_3f3d3I.unpack(str[start:end]) 00165 return self 00166 except struct.error as e: 00167 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00168 00169 00170 def serialize_numpy(self, buff, numpy): 00171 """ 00172 serialize message with numpy array types into buffer 00173 @param buff: buffer 00174 @type buff: StringIO 00175 @param numpy: numpy python module 00176 @type numpy module 00177 """ 00178 try: 00179 _x = self 00180 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00181 _x = self.header.frame_id 00182 length = len(_x) 00183 buff.write(struct.pack('<I%ss'%length, length, _x)) 00184 length = len(self.data) 00185 buff.write(_struct_I.pack(length)) 00186 pattern = '<%sI'%length 00187 buff.write(self.data.tostring()) 00188 _x = self 00189 buff.write(_struct_3f3d3I.pack(_x.origin.x, _x.origin.y, _x.origin.z, _x.resolutions.x, _x.resolutions.y, _x.resolutions.z, _x.size_x, _x.size_y, _x.size_z)) 00190 except struct.error as se: self._check_types(se) 00191 except TypeError as te: self._check_types(te) 00192 00193 def deserialize_numpy(self, str, numpy): 00194 """ 00195 unpack serialized message in str into this message instance using numpy for array types 00196 @param str: byte array of serialized message 00197 @type str: str 00198 @param numpy: numpy python module 00199 @type numpy: module 00200 """ 00201 try: 00202 if self.header is None: 00203 self.header = std_msgs.msg._Header.Header() 00204 if self.origin is None: 00205 self.origin = geometry_msgs.msg.Point32() 00206 if self.resolutions is None: 00207 self.resolutions = geometry_msgs.msg.Vector3() 00208 end = 0 00209 _x = self 00210 start = end 00211 end += 12 00212 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00213 start = end 00214 end += 4 00215 (length,) = _struct_I.unpack(str[start:end]) 00216 start = end 00217 end += length 00218 self.header.frame_id = str[start:end] 00219 start = end 00220 end += 4 00221 (length,) = _struct_I.unpack(str[start:end]) 00222 pattern = '<%sI'%length 00223 start = end 00224 end += struct.calcsize(pattern) 00225 self.data = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length) 00226 _x = self 00227 start = end 00228 end += 48 00229 (_x.origin.x, _x.origin.y, _x.origin.z, _x.resolutions.x, _x.resolutions.y, _x.resolutions.z, _x.size_x, _x.size_y, _x.size_z,) = _struct_3f3d3I.unpack(str[start:end]) 00230 return self 00231 except struct.error as e: 00232 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00233 00234 _struct_I = roslib.message.struct_I 00235 _struct_3I = struct.Struct("<3I") 00236 _struct_3f3d3I = struct.Struct("<3f3d3I")