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