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


occupancy_grid_utils
Author(s): Bhaskara Marthi
autogenerated on Tue Jan 7 2014 11:17:09