00001 """autogenerated by genmsg_py from PoseArray.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geometry_msgs.msg
00006 import std_msgs.msg
00007
00008 class PoseArray(roslib.message.Message):
00009 _md5sum = "916c28c5764443f268b296bb671b9d97"
00010 _type = "geometry_msgs/PoseArray"
00011 _has_header = True
00012 _full_text = """# An array of poses with a header for global reference.
00013
00014 Header header
00015
00016 geometry_msgs/Pose[] poses
00017
00018 ================================================================================
00019 MSG: std_msgs/Header
00020 # Standard metadata for higher-level stamped data types.
00021 # This is generally used to communicate timestamped data
00022 # in a particular coordinate frame.
00023 #
00024 # sequence ID: consecutively increasing ID
00025 uint32 seq
00026 #Two-integer timestamp that is expressed as:
00027 # * stamp.secs: seconds (stamp_secs) since epoch
00028 # * stamp.nsecs: nanoseconds since stamp_secs
00029 # time-handling sugar is provided by the client library
00030 time stamp
00031 #Frame this data is associated with
00032 # 0: no frame
00033 # 1: global frame
00034 string frame_id
00035
00036 ================================================================================
00037 MSG: geometry_msgs/Pose
00038 # A representation of pose in free space, composed of postion and orientation.
00039 Point position
00040 Quaternion orientation
00041
00042 ================================================================================
00043 MSG: geometry_msgs/Point
00044 # This contains the position of a point in free space
00045 float64 x
00046 float64 y
00047 float64 z
00048
00049 ================================================================================
00050 MSG: geometry_msgs/Quaternion
00051 # This represents an orientation in free space in quaternion form.
00052
00053 float64 x
00054 float64 y
00055 float64 z
00056 float64 w
00057
00058 """
00059 __slots__ = ['header','poses']
00060 _slot_types = ['Header','geometry_msgs/Pose[]']
00061
00062 def __init__(self, *args, **kwds):
00063 """
00064 Constructor. Any message fields that are implicitly/explicitly
00065 set to None will be assigned a default value. The recommend
00066 use is keyword arguments as this is more robust to future message
00067 changes. You cannot mix in-order arguments and keyword arguments.
00068
00069 The available fields are:
00070 header,poses
00071
00072 @param args: complete set of field values, in .msg order
00073 @param kwds: use keyword arguments corresponding to message field names
00074 to set specific fields.
00075 """
00076 if args or kwds:
00077 super(PoseArray, self).__init__(*args, **kwds)
00078
00079 if self.header is None:
00080 self.header = std_msgs.msg._Header.Header()
00081 if self.poses is None:
00082 self.poses = []
00083 else:
00084 self.header = std_msgs.msg._Header.Header()
00085 self.poses = []
00086
00087 def _get_types(self):
00088 """
00089 internal API method
00090 """
00091 return self._slot_types
00092
00093 def serialize(self, buff):
00094 """
00095 serialize message into buffer
00096 @param buff: buffer
00097 @type buff: StringIO
00098 """
00099 try:
00100 _x = self
00101 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00102 _x = self.header.frame_id
00103 length = len(_x)
00104 buff.write(struct.pack('<I%ss'%length, length, _x))
00105 length = len(self.poses)
00106 buff.write(_struct_I.pack(length))
00107 for val1 in self.poses:
00108 _v1 = val1.position
00109 _x = _v1
00110 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00111 _v2 = val1.orientation
00112 _x = _v2
00113 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00114 except struct.error, se: self._check_types(se)
00115 except TypeError, te: self._check_types(te)
00116
00117 def deserialize(self, str):
00118 """
00119 unpack serialized message in str into this message instance
00120 @param str: byte array of serialized message
00121 @type str: str
00122 """
00123 try:
00124 if self.header is None:
00125 self.header = std_msgs.msg._Header.Header()
00126 end = 0
00127 _x = self
00128 start = end
00129 end += 12
00130 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00131 start = end
00132 end += 4
00133 (length,) = _struct_I.unpack(str[start:end])
00134 start = end
00135 end += length
00136 self.header.frame_id = str[start:end]
00137 start = end
00138 end += 4
00139 (length,) = _struct_I.unpack(str[start:end])
00140 self.poses = []
00141 for i in xrange(0, length):
00142 val1 = geometry_msgs.msg.Pose()
00143 _v3 = val1.position
00144 _x = _v3
00145 start = end
00146 end += 24
00147 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00148 _v4 = val1.orientation
00149 _x = _v4
00150 start = end
00151 end += 32
00152 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00153 self.poses.append(val1)
00154 return self
00155 except struct.error, e:
00156 raise roslib.message.DeserializationError(e)
00157
00158
00159 def serialize_numpy(self, buff, numpy):
00160 """
00161 serialize message with numpy array types into buffer
00162 @param buff: buffer
00163 @type buff: StringIO
00164 @param numpy: numpy python module
00165 @type numpy module
00166 """
00167 try:
00168 _x = self
00169 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00170 _x = self.header.frame_id
00171 length = len(_x)
00172 buff.write(struct.pack('<I%ss'%length, length, _x))
00173 length = len(self.poses)
00174 buff.write(_struct_I.pack(length))
00175 for val1 in self.poses:
00176 _v5 = val1.position
00177 _x = _v5
00178 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00179 _v6 = val1.orientation
00180 _x = _v6
00181 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00182 except struct.error, se: self._check_types(se)
00183 except TypeError, te: self._check_types(te)
00184
00185 def deserialize_numpy(self, str, numpy):
00186 """
00187 unpack serialized message in str into this message instance using numpy for array types
00188 @param str: byte array of serialized message
00189 @type str: str
00190 @param numpy: numpy python module
00191 @type numpy: module
00192 """
00193 try:
00194 if self.header is None:
00195 self.header = std_msgs.msg._Header.Header()
00196 end = 0
00197 _x = self
00198 start = end
00199 end += 12
00200 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00201 start = end
00202 end += 4
00203 (length,) = _struct_I.unpack(str[start:end])
00204 start = end
00205 end += length
00206 self.header.frame_id = str[start:end]
00207 start = end
00208 end += 4
00209 (length,) = _struct_I.unpack(str[start:end])
00210 self.poses = []
00211 for i in xrange(0, length):
00212 val1 = geometry_msgs.msg.Pose()
00213 _v7 = val1.position
00214 _x = _v7
00215 start = end
00216 end += 24
00217 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00218 _v8 = val1.orientation
00219 _x = _v8
00220 start = end
00221 end += 32
00222 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00223 self.poses.append(val1)
00224 return self
00225 except struct.error, e:
00226 raise roslib.message.DeserializationError(e)
00227
00228 _struct_I = roslib.message.struct_I
00229 _struct_3I = struct.Struct("<3I")
00230 _struct_4d = struct.Struct("<4d")
00231 _struct_3d = struct.Struct("<3d")