00001 """autogenerated by genpy from position_string_msgs/PositionStringList.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import geometry_msgs.msg
00008 import std_msgs.msg
00009
00010 class PositionStringList(genpy.Message):
00011 _md5sum = "fe8ec84f1863f31b277ef6e059c2b94a"
00012 _type = "position_string_msgs/PositionStringList"
00013 _has_header = True
00014 _full_text = """Header header
00015 geometry_msgs/Point32[] poses
00016 string[] texts
00017
00018
00019 ================================================================================
00020 MSG: std_msgs/Header
00021 # Standard metadata for higher-level stamped data types.
00022 # This is generally used to communicate timestamped data
00023 # in a particular coordinate frame.
00024 #
00025 # sequence ID: consecutively increasing ID
00026 uint32 seq
00027 #Two-integer timestamp that is expressed as:
00028 # * stamp.secs: seconds (stamp_secs) since epoch
00029 # * stamp.nsecs: nanoseconds since stamp_secs
00030 # time-handling sugar is provided by the client library
00031 time stamp
00032 #Frame this data is associated with
00033 # 0: no frame
00034 # 1: global frame
00035 string frame_id
00036
00037 ================================================================================
00038 MSG: geometry_msgs/Point32
00039 # This contains the position of a point in free space(with 32 bits of precision).
00040 # It is recommeded to use Point wherever possible instead of Point32.
00041 #
00042 # This recommendation is to promote interoperability.
00043 #
00044 # This message is designed to take up less space when sending
00045 # lots of points at once, as in the case of a PointCloud.
00046
00047 float32 x
00048 float32 y
00049 float32 z
00050 """
00051 __slots__ = ['header','poses','texts']
00052 _slot_types = ['std_msgs/Header','geometry_msgs/Point32[]','string[]']
00053
00054 def __init__(self, *args, **kwds):
00055 """
00056 Constructor. Any message fields that are implicitly/explicitly
00057 set to None will be assigned a default value. The recommend
00058 use is keyword arguments as this is more robust to future message
00059 changes. You cannot mix in-order arguments and keyword arguments.
00060
00061 The available fields are:
00062 header,poses,texts
00063
00064 :param args: complete set of field values, in .msg order
00065 :param kwds: use keyword arguments corresponding to message field names
00066 to set specific fields.
00067 """
00068 if args or kwds:
00069 super(PositionStringList, self).__init__(*args, **kwds)
00070
00071 if self.header is None:
00072 self.header = std_msgs.msg.Header()
00073 if self.poses is None:
00074 self.poses = []
00075 if self.texts is None:
00076 self.texts = []
00077 else:
00078 self.header = std_msgs.msg.Header()
00079 self.poses = []
00080 self.texts = []
00081
00082 def _get_types(self):
00083 """
00084 internal API method
00085 """
00086 return self._slot_types
00087
00088 def serialize(self, buff):
00089 """
00090 serialize message into buffer
00091 :param buff: buffer, ``StringIO``
00092 """
00093 try:
00094 _x = self
00095 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00096 _x = self.header.frame_id
00097 length = len(_x)
00098 if python3 or type(_x) == unicode:
00099 _x = _x.encode('utf-8')
00100 length = len(_x)
00101 buff.write(struct.pack('<I%ss'%length, length, _x))
00102 length = len(self.poses)
00103 buff.write(_struct_I.pack(length))
00104 for val1 in self.poses:
00105 _x = val1
00106 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00107 length = len(self.texts)
00108 buff.write(_struct_I.pack(length))
00109 for val1 in self.texts:
00110 length = len(val1)
00111 if python3 or type(val1) == unicode:
00112 val1 = val1.encode('utf-8')
00113 length = len(val1)
00114 buff.write(struct.pack('<I%ss'%length, length, val1))
00115 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00116 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00117
00118 def deserialize(self, str):
00119 """
00120 unpack serialized message in str into this message instance
00121 :param str: byte array of serialized message, ``str``
00122 """
00123 try:
00124 if self.header is None:
00125 self.header = std_msgs.msg.Header()
00126 if self.poses is None:
00127 self.poses = None
00128 end = 0
00129 _x = self
00130 start = end
00131 end += 12
00132 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00133 start = end
00134 end += 4
00135 (length,) = _struct_I.unpack(str[start:end])
00136 start = end
00137 end += length
00138 if python3:
00139 self.header.frame_id = str[start:end].decode('utf-8')
00140 else:
00141 self.header.frame_id = str[start:end]
00142 start = end
00143 end += 4
00144 (length,) = _struct_I.unpack(str[start:end])
00145 self.poses = []
00146 for i in range(0, length):
00147 val1 = geometry_msgs.msg.Point32()
00148 _x = val1
00149 start = end
00150 end += 12
00151 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00152 self.poses.append(val1)
00153 start = end
00154 end += 4
00155 (length,) = _struct_I.unpack(str[start:end])
00156 self.texts = []
00157 for i in range(0, length):
00158 start = end
00159 end += 4
00160 (length,) = _struct_I.unpack(str[start:end])
00161 start = end
00162 end += length
00163 if python3:
00164 val1 = str[start:end].decode('utf-8')
00165 else:
00166 val1 = str[start:end]
00167 self.texts.append(val1)
00168 return self
00169 except struct.error as e:
00170 raise genpy.DeserializationError(e)
00171
00172
00173 def serialize_numpy(self, buff, numpy):
00174 """
00175 serialize message with numpy array types into buffer
00176 :param buff: buffer, ``StringIO``
00177 :param numpy: numpy python module
00178 """
00179 try:
00180 _x = self
00181 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00182 _x = self.header.frame_id
00183 length = len(_x)
00184 if python3 or type(_x) == unicode:
00185 _x = _x.encode('utf-8')
00186 length = len(_x)
00187 buff.write(struct.pack('<I%ss'%length, length, _x))
00188 length = len(self.poses)
00189 buff.write(_struct_I.pack(length))
00190 for val1 in self.poses:
00191 _x = val1
00192 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00193 length = len(self.texts)
00194 buff.write(_struct_I.pack(length))
00195 for val1 in self.texts:
00196 length = len(val1)
00197 if python3 or type(val1) == unicode:
00198 val1 = val1.encode('utf-8')
00199 length = len(val1)
00200 buff.write(struct.pack('<I%ss'%length, length, val1))
00201 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00202 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00203
00204 def deserialize_numpy(self, str, numpy):
00205 """
00206 unpack serialized message in str into this message instance using numpy for array types
00207 :param str: byte array of serialized message, ``str``
00208 :param numpy: numpy python module
00209 """
00210 try:
00211 if self.header is None:
00212 self.header = std_msgs.msg.Header()
00213 if self.poses is None:
00214 self.poses = None
00215 end = 0
00216 _x = self
00217 start = end
00218 end += 12
00219 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00220 start = end
00221 end += 4
00222 (length,) = _struct_I.unpack(str[start:end])
00223 start = end
00224 end += length
00225 if python3:
00226 self.header.frame_id = str[start:end].decode('utf-8')
00227 else:
00228 self.header.frame_id = str[start:end]
00229 start = end
00230 end += 4
00231 (length,) = _struct_I.unpack(str[start:end])
00232 self.poses = []
00233 for i in range(0, length):
00234 val1 = geometry_msgs.msg.Point32()
00235 _x = val1
00236 start = end
00237 end += 12
00238 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00239 self.poses.append(val1)
00240 start = end
00241 end += 4
00242 (length,) = _struct_I.unpack(str[start:end])
00243 self.texts = []
00244 for i in range(0, length):
00245 start = end
00246 end += 4
00247 (length,) = _struct_I.unpack(str[start:end])
00248 start = end
00249 end += length
00250 if python3:
00251 val1 = str[start:end].decode('utf-8')
00252 else:
00253 val1 = str[start:end]
00254 self.texts.append(val1)
00255 return self
00256 except struct.error as e:
00257 raise genpy.DeserializationError(e)
00258
00259 _struct_I = genpy.struct_I
00260 _struct_3I = struct.Struct("<3I")
00261 _struct_3f = struct.Struct("<3f")