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