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