00001 """autogenerated by genmsg_py from RoadmapEdge.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class RoadmapEdge(roslib.message.Message):
00007 _md5sum = "7bf8e455ec51d9b3f4f5b22c80145710"
00008 _type = "topological_nav_msgs/RoadmapEdge"
00009 _has_header = False
00010 _full_text = """# Info stored with an edge in the roadmap
00011
00012 # Id of this edge in the roadmap.
00013 uint32 id
00014
00015 # Grid this edge lives on
00016 uint32 grid
00017
00018 # Source node of the edge; must belong to the grid.
00019 uint32 src
00020
00021 # Target node of the edge; must belong to the grid.
00022 uint32 dest
00023
00024 # Cost of this edge
00025 float32 cost
00026 """
00027 __slots__ = ['id','grid','src','dest','cost']
00028 _slot_types = ['uint32','uint32','uint32','uint32','float32']
00029
00030 def __init__(self, *args, **kwds):
00031 """
00032 Constructor. Any message fields that are implicitly/explicitly
00033 set to None will be assigned a default value. The recommend
00034 use is keyword arguments as this is more robust to future message
00035 changes. You cannot mix in-order arguments and keyword arguments.
00036
00037 The available fields are:
00038 id,grid,src,dest,cost
00039
00040 @param args: complete set of field values, in .msg order
00041 @param kwds: use keyword arguments corresponding to message field names
00042 to set specific fields.
00043 """
00044 if args or kwds:
00045 super(RoadmapEdge, self).__init__(*args, **kwds)
00046
00047 if self.id is None:
00048 self.id = 0
00049 if self.grid is None:
00050 self.grid = 0
00051 if self.src is None:
00052 self.src = 0
00053 if self.dest is None:
00054 self.dest = 0
00055 if self.cost is None:
00056 self.cost = 0.
00057 else:
00058 self.id = 0
00059 self.grid = 0
00060 self.src = 0
00061 self.dest = 0
00062 self.cost = 0.
00063
00064 def _get_types(self):
00065 """
00066 internal API method
00067 """
00068 return self._slot_types
00069
00070 def serialize(self, buff):
00071 """
00072 serialize message into buffer
00073 @param buff: buffer
00074 @type buff: StringIO
00075 """
00076 try:
00077 _x = self
00078 buff.write(_struct_4If.pack(_x.id, _x.grid, _x.src, _x.dest, _x.cost))
00079 except struct.error, se: self._check_types(se)
00080 except TypeError, te: self._check_types(te)
00081
00082 def deserialize(self, str):
00083 """
00084 unpack serialized message in str into this message instance
00085 @param str: byte array of serialized message
00086 @type str: str
00087 """
00088 try:
00089 end = 0
00090 _x = self
00091 start = end
00092 end += 20
00093 (_x.id, _x.grid, _x.src, _x.dest, _x.cost,) = _struct_4If.unpack(str[start:end])
00094 return self
00095 except struct.error, e:
00096 raise roslib.message.DeserializationError(e)
00097
00098
00099 def serialize_numpy(self, buff, numpy):
00100 """
00101 serialize message with numpy array types into buffer
00102 @param buff: buffer
00103 @type buff: StringIO
00104 @param numpy: numpy python module
00105 @type numpy module
00106 """
00107 try:
00108 _x = self
00109 buff.write(_struct_4If.pack(_x.id, _x.grid, _x.src, _x.dest, _x.cost))
00110 except struct.error, se: self._check_types(se)
00111 except TypeError, te: self._check_types(te)
00112
00113 def deserialize_numpy(self, str, numpy):
00114 """
00115 unpack serialized message in str into this message instance using numpy for array types
00116 @param str: byte array of serialized message
00117 @type str: str
00118 @param numpy: numpy python module
00119 @type numpy: module
00120 """
00121 try:
00122 end = 0
00123 _x = self
00124 start = end
00125 end += 20
00126 (_x.id, _x.grid, _x.src, _x.dest, _x.cost,) = _struct_4If.unpack(str[start:end])
00127 return self
00128 except struct.error, e:
00129 raise roslib.message.DeserializationError(e)
00130
00131 _struct_I = roslib.message.struct_I
00132 _struct_4If = struct.Struct("<4If")