$search
00001 """autogenerated by genmsg_py from PositionMeasurement.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 PositionMeasurement(roslib.message.Message): 00009 _md5sum = "54fa938b4ec28728e01575b79eb0ec7c" 00010 _type = "srs_msgs/PositionMeasurement" 00011 _has_header = True #flag to mark the presence of a Header object 00012 _full_text = """Header header 00013 string name 00014 string object_id 00015 geometry_msgs/Point pos 00016 float64 reliability 00017 float64[9] covariance 00018 byte initialization 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/Point 00039 # This contains the position of a point in free space 00040 float64 x 00041 float64 y 00042 float64 z 00043 00044 """ 00045 __slots__ = ['header','name','object_id','pos','reliability','covariance','initialization'] 00046 _slot_types = ['Header','string','string','geometry_msgs/Point','float64','float64[9]','byte'] 00047 00048 def __init__(self, *args, **kwds): 00049 """ 00050 Constructor. Any message fields that are implicitly/explicitly 00051 set to None will be assigned a default value. The recommend 00052 use is keyword arguments as this is more robust to future message 00053 changes. You cannot mix in-order arguments and keyword arguments. 00054 00055 The available fields are: 00056 header,name,object_id,pos,reliability,covariance,initialization 00057 00058 @param args: complete set of field values, in .msg order 00059 @param kwds: use keyword arguments corresponding to message field names 00060 to set specific fields. 00061 """ 00062 if args or kwds: 00063 super(PositionMeasurement, self).__init__(*args, **kwds) 00064 #message fields cannot be None, assign default values for those that are 00065 if self.header is None: 00066 self.header = std_msgs.msg._Header.Header() 00067 if self.name is None: 00068 self.name = '' 00069 if self.object_id is None: 00070 self.object_id = '' 00071 if self.pos is None: 00072 self.pos = geometry_msgs.msg.Point() 00073 if self.reliability is None: 00074 self.reliability = 0. 00075 if self.covariance is None: 00076 self.covariance = [0.,0.,0.,0.,0.,0.,0.,0.,0.] 00077 if self.initialization is None: 00078 self.initialization = 0 00079 else: 00080 self.header = std_msgs.msg._Header.Header() 00081 self.name = '' 00082 self.object_id = '' 00083 self.pos = geometry_msgs.msg.Point() 00084 self.reliability = 0. 00085 self.covariance = [0.,0.,0.,0.,0.,0.,0.,0.,0.] 00086 self.initialization = 0 00087 00088 def _get_types(self): 00089 """ 00090 internal API method 00091 """ 00092 return self._slot_types 00093 00094 def serialize(self, buff): 00095 """ 00096 serialize message into buffer 00097 @param buff: buffer 00098 @type buff: StringIO 00099 """ 00100 try: 00101 _x = self 00102 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00103 _x = self.header.frame_id 00104 length = len(_x) 00105 buff.write(struct.pack('<I%ss'%length, length, _x)) 00106 _x = self.name 00107 length = len(_x) 00108 buff.write(struct.pack('<I%ss'%length, length, _x)) 00109 _x = self.object_id 00110 length = len(_x) 00111 buff.write(struct.pack('<I%ss'%length, length, _x)) 00112 _x = self 00113 buff.write(_struct_4d.pack(_x.pos.x, _x.pos.y, _x.pos.z, _x.reliability)) 00114 buff.write(_struct_9d.pack(*self.covariance)) 00115 buff.write(_struct_b.pack(self.initialization)) 00116 except struct.error as se: self._check_types(se) 00117 except TypeError as te: self._check_types(te) 00118 00119 def deserialize(self, str): 00120 """ 00121 unpack serialized message in str into this message instance 00122 @param str: byte array of serialized message 00123 @type str: str 00124 """ 00125 try: 00126 if self.header is None: 00127 self.header = std_msgs.msg._Header.Header() 00128 if self.pos is None: 00129 self.pos = geometry_msgs.msg.Point() 00130 end = 0 00131 _x = self 00132 start = end 00133 end += 12 00134 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00135 start = end 00136 end += 4 00137 (length,) = _struct_I.unpack(str[start:end]) 00138 start = end 00139 end += length 00140 self.header.frame_id = str[start:end] 00141 start = end 00142 end += 4 00143 (length,) = _struct_I.unpack(str[start:end]) 00144 start = end 00145 end += length 00146 self.name = str[start:end] 00147 start = end 00148 end += 4 00149 (length,) = _struct_I.unpack(str[start:end]) 00150 start = end 00151 end += length 00152 self.object_id = str[start:end] 00153 _x = self 00154 start = end 00155 end += 32 00156 (_x.pos.x, _x.pos.y, _x.pos.z, _x.reliability,) = _struct_4d.unpack(str[start:end]) 00157 start = end 00158 end += 72 00159 self.covariance = _struct_9d.unpack(str[start:end]) 00160 start = end 00161 end += 1 00162 (self.initialization,) = _struct_b.unpack(str[start:end]) 00163 return self 00164 except struct.error as e: 00165 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00166 00167 00168 def serialize_numpy(self, buff, numpy): 00169 """ 00170 serialize message with numpy array types into buffer 00171 @param buff: buffer 00172 @type buff: StringIO 00173 @param numpy: numpy python module 00174 @type numpy module 00175 """ 00176 try: 00177 _x = self 00178 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00179 _x = self.header.frame_id 00180 length = len(_x) 00181 buff.write(struct.pack('<I%ss'%length, length, _x)) 00182 _x = self.name 00183 length = len(_x) 00184 buff.write(struct.pack('<I%ss'%length, length, _x)) 00185 _x = self.object_id 00186 length = len(_x) 00187 buff.write(struct.pack('<I%ss'%length, length, _x)) 00188 _x = self 00189 buff.write(_struct_4d.pack(_x.pos.x, _x.pos.y, _x.pos.z, _x.reliability)) 00190 buff.write(self.covariance.tostring()) 00191 buff.write(_struct_b.pack(self.initialization)) 00192 except struct.error as se: self._check_types(se) 00193 except TypeError as te: self._check_types(te) 00194 00195 def deserialize_numpy(self, str, numpy): 00196 """ 00197 unpack serialized message in str into this message instance using numpy for array types 00198 @param str: byte array of serialized message 00199 @type str: str 00200 @param numpy: numpy python module 00201 @type numpy: module 00202 """ 00203 try: 00204 if self.header is None: 00205 self.header = std_msgs.msg._Header.Header() 00206 if self.pos is None: 00207 self.pos = geometry_msgs.msg.Point() 00208 end = 0 00209 _x = self 00210 start = end 00211 end += 12 00212 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00213 start = end 00214 end += 4 00215 (length,) = _struct_I.unpack(str[start:end]) 00216 start = end 00217 end += length 00218 self.header.frame_id = str[start:end] 00219 start = end 00220 end += 4 00221 (length,) = _struct_I.unpack(str[start:end]) 00222 start = end 00223 end += length 00224 self.name = str[start:end] 00225 start = end 00226 end += 4 00227 (length,) = _struct_I.unpack(str[start:end]) 00228 start = end 00229 end += length 00230 self.object_id = str[start:end] 00231 _x = self 00232 start = end 00233 end += 32 00234 (_x.pos.x, _x.pos.y, _x.pos.z, _x.reliability,) = _struct_4d.unpack(str[start:end]) 00235 start = end 00236 end += 72 00237 self.covariance = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9) 00238 start = end 00239 end += 1 00240 (self.initialization,) = _struct_b.unpack(str[start:end]) 00241 return self 00242 except struct.error as e: 00243 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00244 00245 _struct_I = roslib.message.struct_I 00246 _struct_3I = struct.Struct("<3I") 00247 _struct_b = struct.Struct("<b") 00248 _struct_4d = struct.Struct("<4d") 00249 _struct_9d = struct.Struct("<9d")