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