$search
00001 """autogenerated by genmsg_py from ObservationArray.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import art_msgs.msg 00006 import std_msgs.msg 00007 00008 class ObservationArray(roslib.message.Message): 00009 _md5sum = "b5eeab09687abc64c329078cb1e9065a" 00010 _type = "art_msgs/ObservationArray" 00011 _has_header = True #flag to mark the presence of a Header object 00012 _full_text = """# Observations from a set of observers 00013 # $Id: ObservationArray.msg 1628 2011-08-09 21:51:35Z jack.oquin $ 00014 00015 Header header 00016 Observation[] obs # vector of observations 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: art_msgs/Observation 00038 # result returned from a single observer 00039 # $Id: Observation.msg 1614 2011-08-06 21:02:59Z jack.oquin $ 00040 00041 # possible observer ID values 00042 int32 Nearest_forward = 0 # current or closest lane 00043 int32 Nearest_backward = 1 00044 int32 Adjacent_left = 2 # adjacent left or right lane 00045 int32 Adjacent_right = 3 00046 int32 All_left = 4 # all left or right lanes 00047 int32 All_right = 5 00048 int32 Merge_into_nearest = 6 # merge into nearest lane on diff seg 00049 int32 Merge_across_all = 7 # merge across all lanes on diff seg 00050 int32 Intersection = 8 # stop sign intersection precedence 00051 int32 N_Observers = 9 00052 00053 int32 oid # observer ID 00054 string name # observer name 00055 00056 bool applicable # true if obseravation is applicable 00057 bool clear # true if clear to go 00058 00059 # optional time and distance to nearest obstacle 00060 # (only reported by some observers) 00061 float32 time 00062 float32 distance 00063 float32 velocity 00064 int32 nobjects # number of objects 00065 00066 """ 00067 __slots__ = ['header','obs'] 00068 _slot_types = ['Header','art_msgs/Observation[]'] 00069 00070 def __init__(self, *args, **kwds): 00071 """ 00072 Constructor. Any message fields that are implicitly/explicitly 00073 set to None will be assigned a default value. The recommend 00074 use is keyword arguments as this is more robust to future message 00075 changes. You cannot mix in-order arguments and keyword arguments. 00076 00077 The available fields are: 00078 header,obs 00079 00080 @param args: complete set of field values, in .msg order 00081 @param kwds: use keyword arguments corresponding to message field names 00082 to set specific fields. 00083 """ 00084 if args or kwds: 00085 super(ObservationArray, self).__init__(*args, **kwds) 00086 #message fields cannot be None, assign default values for those that are 00087 if self.header is None: 00088 self.header = std_msgs.msg._Header.Header() 00089 if self.obs is None: 00090 self.obs = [] 00091 else: 00092 self.header = std_msgs.msg._Header.Header() 00093 self.obs = [] 00094 00095 def _get_types(self): 00096 """ 00097 internal API method 00098 """ 00099 return self._slot_types 00100 00101 def serialize(self, buff): 00102 """ 00103 serialize message into buffer 00104 @param buff: buffer 00105 @type buff: StringIO 00106 """ 00107 try: 00108 _x = self 00109 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00110 _x = self.header.frame_id 00111 length = len(_x) 00112 buff.write(struct.pack('<I%ss'%length, length, _x)) 00113 length = len(self.obs) 00114 buff.write(_struct_I.pack(length)) 00115 for val1 in self.obs: 00116 buff.write(_struct_i.pack(val1.oid)) 00117 _x = val1.name 00118 length = len(_x) 00119 buff.write(struct.pack('<I%ss'%length, length, _x)) 00120 _x = val1 00121 buff.write(_struct_2B3fi.pack(_x.applicable, _x.clear, _x.time, _x.distance, _x.velocity, _x.nobjects)) 00122 except struct.error as se: self._check_types(se) 00123 except TypeError as te: self._check_types(te) 00124 00125 def deserialize(self, str): 00126 """ 00127 unpack serialized message in str into this message instance 00128 @param str: byte array of serialized message 00129 @type str: str 00130 """ 00131 try: 00132 if self.header is None: 00133 self.header = std_msgs.msg._Header.Header() 00134 end = 0 00135 _x = self 00136 start = end 00137 end += 12 00138 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00139 start = end 00140 end += 4 00141 (length,) = _struct_I.unpack(str[start:end]) 00142 start = end 00143 end += length 00144 self.header.frame_id = str[start:end] 00145 start = end 00146 end += 4 00147 (length,) = _struct_I.unpack(str[start:end]) 00148 self.obs = [] 00149 for i in range(0, length): 00150 val1 = art_msgs.msg.Observation() 00151 start = end 00152 end += 4 00153 (val1.oid,) = _struct_i.unpack(str[start:end]) 00154 start = end 00155 end += 4 00156 (length,) = _struct_I.unpack(str[start:end]) 00157 start = end 00158 end += length 00159 val1.name = str[start:end] 00160 _x = val1 00161 start = end 00162 end += 18 00163 (_x.applicable, _x.clear, _x.time, _x.distance, _x.velocity, _x.nobjects,) = _struct_2B3fi.unpack(str[start:end]) 00164 val1.applicable = bool(val1.applicable) 00165 val1.clear = bool(val1.clear) 00166 self.obs.append(val1) 00167 return self 00168 except struct.error as e: 00169 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00170 00171 00172 def serialize_numpy(self, buff, numpy): 00173 """ 00174 serialize message with numpy array types into buffer 00175 @param buff: buffer 00176 @type buff: StringIO 00177 @param numpy: numpy python module 00178 @type numpy module 00179 """ 00180 try: 00181 _x = self 00182 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00183 _x = self.header.frame_id 00184 length = len(_x) 00185 buff.write(struct.pack('<I%ss'%length, length, _x)) 00186 length = len(self.obs) 00187 buff.write(_struct_I.pack(length)) 00188 for val1 in self.obs: 00189 buff.write(_struct_i.pack(val1.oid)) 00190 _x = val1.name 00191 length = len(_x) 00192 buff.write(struct.pack('<I%ss'%length, length, _x)) 00193 _x = val1 00194 buff.write(_struct_2B3fi.pack(_x.applicable, _x.clear, _x.time, _x.distance, _x.velocity, _x.nobjects)) 00195 except struct.error as se: self._check_types(se) 00196 except TypeError as te: self._check_types(te) 00197 00198 def deserialize_numpy(self, str, numpy): 00199 """ 00200 unpack serialized message in str into this message instance using numpy for array types 00201 @param str: byte array of serialized message 00202 @type str: str 00203 @param numpy: numpy python module 00204 @type numpy: module 00205 """ 00206 try: 00207 if self.header is None: 00208 self.header = std_msgs.msg._Header.Header() 00209 end = 0 00210 _x = self 00211 start = end 00212 end += 12 00213 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00214 start = end 00215 end += 4 00216 (length,) = _struct_I.unpack(str[start:end]) 00217 start = end 00218 end += length 00219 self.header.frame_id = str[start:end] 00220 start = end 00221 end += 4 00222 (length,) = _struct_I.unpack(str[start:end]) 00223 self.obs = [] 00224 for i in range(0, length): 00225 val1 = art_msgs.msg.Observation() 00226 start = end 00227 end += 4 00228 (val1.oid,) = _struct_i.unpack(str[start:end]) 00229 start = end 00230 end += 4 00231 (length,) = _struct_I.unpack(str[start:end]) 00232 start = end 00233 end += length 00234 val1.name = str[start:end] 00235 _x = val1 00236 start = end 00237 end += 18 00238 (_x.applicable, _x.clear, _x.time, _x.distance, _x.velocity, _x.nobjects,) = _struct_2B3fi.unpack(str[start:end]) 00239 val1.applicable = bool(val1.applicable) 00240 val1.clear = bool(val1.clear) 00241 self.obs.append(val1) 00242 return self 00243 except struct.error as e: 00244 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00245 00246 _struct_I = roslib.message.struct_I 00247 _struct_i = struct.Struct("<i") 00248 _struct_3I = struct.Struct("<3I") 00249 _struct_2B3fi = struct.Struct("<2B3fi")