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