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