00001 """autogenerated by genmsg_py from Node.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geometry_msgs.msg
00006
00007 class Node(roslib.message.Message):
00008 _md5sum = "dfb1b96190d69168cc51c2adf3e7b27d"
00009 _type = "graph_mapping_msgs/Node"
00010 _has_header = False
00011 _full_text = """uint32 id
00012
00013 # This array has length 1 if the node has an optimized pose; 0 otherwise
00014 geometry_msgs/Pose[] optimized_pose
00015
00016
00017 ================================================================================
00018 MSG: geometry_msgs/Pose
00019 # A representation of pose in free space, composed of postion and orientation.
00020 Point position
00021 Quaternion orientation
00022
00023 ================================================================================
00024 MSG: geometry_msgs/Point
00025 # This contains the position of a point in free space
00026 float64 x
00027 float64 y
00028 float64 z
00029
00030 ================================================================================
00031 MSG: geometry_msgs/Quaternion
00032 # This represents an orientation in free space in quaternion form.
00033
00034 float64 x
00035 float64 y
00036 float64 z
00037 float64 w
00038
00039 """
00040 __slots__ = ['id','optimized_pose']
00041 _slot_types = ['uint32','geometry_msgs/Pose[]']
00042
00043 def __init__(self, *args, **kwds):
00044 """
00045 Constructor. Any message fields that are implicitly/explicitly
00046 set to None will be assigned a default value. The recommend
00047 use is keyword arguments as this is more robust to future message
00048 changes. You cannot mix in-order arguments and keyword arguments.
00049
00050 The available fields are:
00051 id,optimized_pose
00052
00053 @param args: complete set of field values, in .msg order
00054 @param kwds: use keyword arguments corresponding to message field names
00055 to set specific fields.
00056 """
00057 if args or kwds:
00058 super(Node, self).__init__(*args, **kwds)
00059
00060 if self.id is None:
00061 self.id = 0
00062 if self.optimized_pose is None:
00063 self.optimized_pose = []
00064 else:
00065 self.id = 0
00066 self.optimized_pose = []
00067
00068 def _get_types(self):
00069 """
00070 internal API method
00071 """
00072 return self._slot_types
00073
00074 def serialize(self, buff):
00075 """
00076 serialize message into buffer
00077 @param buff: buffer
00078 @type buff: StringIO
00079 """
00080 try:
00081 buff.write(_struct_I.pack(self.id))
00082 length = len(self.optimized_pose)
00083 buff.write(_struct_I.pack(length))
00084 for val1 in self.optimized_pose:
00085 _v1 = val1.position
00086 _x = _v1
00087 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00088 _v2 = val1.orientation
00089 _x = _v2
00090 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00091 except struct.error, se: self._check_types(se)
00092 except TypeError, te: self._check_types(te)
00093
00094 def deserialize(self, str):
00095 """
00096 unpack serialized message in str into this message instance
00097 @param str: byte array of serialized message
00098 @type str: str
00099 """
00100 try:
00101 end = 0
00102 start = end
00103 end += 4
00104 (self.id,) = _struct_I.unpack(str[start:end])
00105 start = end
00106 end += 4
00107 (length,) = _struct_I.unpack(str[start:end])
00108 self.optimized_pose = []
00109 for i in xrange(0, length):
00110 val1 = geometry_msgs.msg.Pose()
00111 _v3 = val1.position
00112 _x = _v3
00113 start = end
00114 end += 24
00115 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00116 _v4 = val1.orientation
00117 _x = _v4
00118 start = end
00119 end += 32
00120 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00121 self.optimized_pose.append(val1)
00122 return self
00123 except struct.error, e:
00124 raise roslib.message.DeserializationError(e)
00125
00126
00127 def serialize_numpy(self, buff, numpy):
00128 """
00129 serialize message with numpy array types into buffer
00130 @param buff: buffer
00131 @type buff: StringIO
00132 @param numpy: numpy python module
00133 @type numpy module
00134 """
00135 try:
00136 buff.write(_struct_I.pack(self.id))
00137 length = len(self.optimized_pose)
00138 buff.write(_struct_I.pack(length))
00139 for val1 in self.optimized_pose:
00140 _v5 = val1.position
00141 _x = _v5
00142 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00143 _v6 = val1.orientation
00144 _x = _v6
00145 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00146 except struct.error, se: self._check_types(se)
00147 except TypeError, te: self._check_types(te)
00148
00149 def deserialize_numpy(self, str, numpy):
00150 """
00151 unpack serialized message in str into this message instance using numpy for array types
00152 @param str: byte array of serialized message
00153 @type str: str
00154 @param numpy: numpy python module
00155 @type numpy: module
00156 """
00157 try:
00158 end = 0
00159 start = end
00160 end += 4
00161 (self.id,) = _struct_I.unpack(str[start:end])
00162 start = end
00163 end += 4
00164 (length,) = _struct_I.unpack(str[start:end])
00165 self.optimized_pose = []
00166 for i in xrange(0, length):
00167 val1 = geometry_msgs.msg.Pose()
00168 _v7 = val1.position
00169 _x = _v7
00170 start = end
00171 end += 24
00172 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00173 _v8 = val1.orientation
00174 _x = _v8
00175 start = end
00176 end += 32
00177 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00178 self.optimized_pose.append(val1)
00179 return self
00180 except struct.error, e:
00181 raise roslib.message.DeserializationError(e)
00182
00183 _struct_I = roslib.message.struct_I
00184 _struct_4d = struct.Struct("<4d")
00185 _struct_3d = struct.Struct("<3d")