00001 """autogenerated by genmsg_py from ConstraintGraphDiff.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geometry_msgs.msg
00006 import roslib.rostime
00007 import graph_mapping_msgs.msg
00008
00009 class ConstraintGraphDiff(roslib.message.Message):
00010 _md5sum = "41fe5af4a764149d81007b53c054a7fe"
00011 _type = "graph_mapping_msgs/ConstraintGraphDiff"
00012 _has_header = False
00013 _full_text = """# The id of the graph or diff that this one refers to, or 0 if this is the first one
00014 uint64 id
00015
00016 time[] new_node_timestamps
00017 Node[] new_nodes
00018 Edge[] new_edges
00019
00020 ================================================================================
00021 MSG: graph_mapping_msgs/Node
00022 uint32 id
00023
00024 # This array has length 1 if the node has an optimized pose; 0 otherwise
00025 geometry_msgs/Pose[] optimized_pose
00026
00027
00028 ================================================================================
00029 MSG: geometry_msgs/Pose
00030 # A representation of pose in free space, composed of postion and orientation.
00031 Point position
00032 Quaternion orientation
00033
00034 ================================================================================
00035 MSG: geometry_msgs/Point
00036 # This contains the position of a point in free space
00037 float64 x
00038 float64 y
00039 float64 z
00040
00041 ================================================================================
00042 MSG: geometry_msgs/Quaternion
00043 # This represents an orientation in free space in quaternion form.
00044
00045 float64 x
00046 float64 y
00047 float64 z
00048 float64 w
00049
00050 ================================================================================
00051 MSG: graph_mapping_msgs/Edge
00052 uint32 id
00053 GraphConstraint constraint
00054
00055 ================================================================================
00056 MSG: graph_mapping_msgs/GraphConstraint
00057 uint32 src
00058 uint32 dest
00059 PoseWithPrecision constraint
00060 ================================================================================
00061 MSG: graph_mapping_msgs/PoseWithPrecision
00062 geometry_msgs/Pose pose
00063 float64[36] precision
00064 """
00065 __slots__ = ['id','new_node_timestamps','new_nodes','new_edges']
00066 _slot_types = ['uint64','time[]','graph_mapping_msgs/Node[]','graph_mapping_msgs/Edge[]']
00067
00068 def __init__(self, *args, **kwds):
00069 """
00070 Constructor. Any message fields that are implicitly/explicitly
00071 set to None will be assigned a default value. The recommend
00072 use is keyword arguments as this is more robust to future message
00073 changes. You cannot mix in-order arguments and keyword arguments.
00074
00075 The available fields are:
00076 id,new_node_timestamps,new_nodes,new_edges
00077
00078 @param args: complete set of field values, in .msg order
00079 @param kwds: use keyword arguments corresponding to message field names
00080 to set specific fields.
00081 """
00082 if args or kwds:
00083 super(ConstraintGraphDiff, self).__init__(*args, **kwds)
00084
00085 if self.id is None:
00086 self.id = 0
00087 if self.new_node_timestamps is None:
00088 self.new_node_timestamps = []
00089 if self.new_nodes is None:
00090 self.new_nodes = []
00091 if self.new_edges is None:
00092 self.new_edges = []
00093 else:
00094 self.id = 0
00095 self.new_node_timestamps = []
00096 self.new_nodes = []
00097 self.new_edges = []
00098
00099 def _get_types(self):
00100 """
00101 internal API method
00102 """
00103 return self._slot_types
00104
00105 def serialize(self, buff):
00106 """
00107 serialize message into buffer
00108 @param buff: buffer
00109 @type buff: StringIO
00110 """
00111 try:
00112 buff.write(_struct_Q.pack(self.id))
00113 length = len(self.new_node_timestamps)
00114 buff.write(_struct_I.pack(length))
00115 for val1 in self.new_node_timestamps:
00116 _x = val1
00117 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00118 length = len(self.new_nodes)
00119 buff.write(_struct_I.pack(length))
00120 for val1 in self.new_nodes:
00121 buff.write(_struct_I.pack(val1.id))
00122 length = len(val1.optimized_pose)
00123 buff.write(_struct_I.pack(length))
00124 for val2 in val1.optimized_pose:
00125 _v1 = val2.position
00126 _x = _v1
00127 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00128 _v2 = val2.orientation
00129 _x = _v2
00130 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00131 length = len(self.new_edges)
00132 buff.write(_struct_I.pack(length))
00133 for val1 in self.new_edges:
00134 buff.write(_struct_I.pack(val1.id))
00135 _v3 = val1.constraint
00136 _x = _v3
00137 buff.write(_struct_2I.pack(_x.src, _x.dest))
00138 _v4 = _v3.constraint
00139 _v5 = _v4.pose
00140 _v6 = _v5.position
00141 _x = _v6
00142 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00143 _v7 = _v5.orientation
00144 _x = _v7
00145 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00146 buff.write(_struct_36d.pack(*_v4.precision))
00147 except struct.error, se: self._check_types(se)
00148 except TypeError, te: self._check_types(te)
00149
00150 def deserialize(self, str):
00151 """
00152 unpack serialized message in str into this message instance
00153 @param str: byte array of serialized message
00154 @type str: str
00155 """
00156 try:
00157 end = 0
00158 start = end
00159 end += 8
00160 (self.id,) = _struct_Q.unpack(str[start:end])
00161 start = end
00162 end += 4
00163 (length,) = _struct_I.unpack(str[start:end])
00164 self.new_node_timestamps = []
00165 for i in xrange(0, length):
00166 val1 = roslib.rostime.Time()
00167 _x = val1
00168 start = end
00169 end += 8
00170 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00171 self.new_node_timestamps.append(val1)
00172 start = end
00173 end += 4
00174 (length,) = _struct_I.unpack(str[start:end])
00175 self.new_nodes = []
00176 for i in xrange(0, length):
00177 val1 = graph_mapping_msgs.msg.Node()
00178 start = end
00179 end += 4
00180 (val1.id,) = _struct_I.unpack(str[start:end])
00181 start = end
00182 end += 4
00183 (length,) = _struct_I.unpack(str[start:end])
00184 val1.optimized_pose = []
00185 for i in xrange(0, length):
00186 val2 = geometry_msgs.msg.Pose()
00187 _v8 = val2.position
00188 _x = _v8
00189 start = end
00190 end += 24
00191 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00192 _v9 = val2.orientation
00193 _x = _v9
00194 start = end
00195 end += 32
00196 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00197 val1.optimized_pose.append(val2)
00198 self.new_nodes.append(val1)
00199 start = end
00200 end += 4
00201 (length,) = _struct_I.unpack(str[start:end])
00202 self.new_edges = []
00203 for i in xrange(0, length):
00204 val1 = graph_mapping_msgs.msg.Edge()
00205 start = end
00206 end += 4
00207 (val1.id,) = _struct_I.unpack(str[start:end])
00208 _v10 = val1.constraint
00209 _x = _v10
00210 start = end
00211 end += 8
00212 (_x.src, _x.dest,) = _struct_2I.unpack(str[start:end])
00213 _v11 = _v10.constraint
00214 _v12 = _v11.pose
00215 _v13 = _v12.position
00216 _x = _v13
00217 start = end
00218 end += 24
00219 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00220 _v14 = _v12.orientation
00221 _x = _v14
00222 start = end
00223 end += 32
00224 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00225 start = end
00226 end += 288
00227 _v11.precision = _struct_36d.unpack(str[start:end])
00228 self.new_edges.append(val1)
00229 return self
00230 except struct.error, e:
00231 raise roslib.message.DeserializationError(e)
00232
00233
00234 def serialize_numpy(self, buff, numpy):
00235 """
00236 serialize message with numpy array types into buffer
00237 @param buff: buffer
00238 @type buff: StringIO
00239 @param numpy: numpy python module
00240 @type numpy module
00241 """
00242 try:
00243 buff.write(_struct_Q.pack(self.id))
00244 length = len(self.new_node_timestamps)
00245 buff.write(_struct_I.pack(length))
00246 for val1 in self.new_node_timestamps:
00247 _x = val1
00248 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00249 length = len(self.new_nodes)
00250 buff.write(_struct_I.pack(length))
00251 for val1 in self.new_nodes:
00252 buff.write(_struct_I.pack(val1.id))
00253 length = len(val1.optimized_pose)
00254 buff.write(_struct_I.pack(length))
00255 for val2 in val1.optimized_pose:
00256 _v15 = val2.position
00257 _x = _v15
00258 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00259 _v16 = val2.orientation
00260 _x = _v16
00261 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00262 length = len(self.new_edges)
00263 buff.write(_struct_I.pack(length))
00264 for val1 in self.new_edges:
00265 buff.write(_struct_I.pack(val1.id))
00266 _v17 = val1.constraint
00267 _x = _v17
00268 buff.write(_struct_2I.pack(_x.src, _x.dest))
00269 _v18 = _v17.constraint
00270 _v19 = _v18.pose
00271 _v20 = _v19.position
00272 _x = _v20
00273 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00274 _v21 = _v19.orientation
00275 _x = _v21
00276 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00277 buff.write(_v18.precision.tostring())
00278 except struct.error, se: self._check_types(se)
00279 except TypeError, te: self._check_types(te)
00280
00281 def deserialize_numpy(self, str, numpy):
00282 """
00283 unpack serialized message in str into this message instance using numpy for array types
00284 @param str: byte array of serialized message
00285 @type str: str
00286 @param numpy: numpy python module
00287 @type numpy: module
00288 """
00289 try:
00290 end = 0
00291 start = end
00292 end += 8
00293 (self.id,) = _struct_Q.unpack(str[start:end])
00294 start = end
00295 end += 4
00296 (length,) = _struct_I.unpack(str[start:end])
00297 self.new_node_timestamps = []
00298 for i in xrange(0, length):
00299 val1 = roslib.rostime.Time()
00300 _x = val1
00301 start = end
00302 end += 8
00303 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00304 self.new_node_timestamps.append(val1)
00305 start = end
00306 end += 4
00307 (length,) = _struct_I.unpack(str[start:end])
00308 self.new_nodes = []
00309 for i in xrange(0, length):
00310 val1 = graph_mapping_msgs.msg.Node()
00311 start = end
00312 end += 4
00313 (val1.id,) = _struct_I.unpack(str[start:end])
00314 start = end
00315 end += 4
00316 (length,) = _struct_I.unpack(str[start:end])
00317 val1.optimized_pose = []
00318 for i in xrange(0, length):
00319 val2 = geometry_msgs.msg.Pose()
00320 _v22 = val2.position
00321 _x = _v22
00322 start = end
00323 end += 24
00324 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00325 _v23 = val2.orientation
00326 _x = _v23
00327 start = end
00328 end += 32
00329 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00330 val1.optimized_pose.append(val2)
00331 self.new_nodes.append(val1)
00332 start = end
00333 end += 4
00334 (length,) = _struct_I.unpack(str[start:end])
00335 self.new_edges = []
00336 for i in xrange(0, length):
00337 val1 = graph_mapping_msgs.msg.Edge()
00338 start = end
00339 end += 4
00340 (val1.id,) = _struct_I.unpack(str[start:end])
00341 _v24 = val1.constraint
00342 _x = _v24
00343 start = end
00344 end += 8
00345 (_x.src, _x.dest,) = _struct_2I.unpack(str[start:end])
00346 _v25 = _v24.constraint
00347 _v26 = _v25.pose
00348 _v27 = _v26.position
00349 _x = _v27
00350 start = end
00351 end += 24
00352 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00353 _v28 = _v26.orientation
00354 _x = _v28
00355 start = end
00356 end += 32
00357 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00358 start = end
00359 end += 288
00360 _v25.precision = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=36)
00361 self.new_edges.append(val1)
00362 return self
00363 except struct.error, e:
00364 raise roslib.message.DeserializationError(e)
00365
00366 _struct_I = roslib.message.struct_I
00367 _struct_36d = struct.Struct("<36d")
00368 _struct_Q = struct.Struct("<Q")
00369 _struct_4d = struct.Struct("<4d")
00370 _struct_2I = struct.Struct("<2I")
00371 _struct_3d = struct.Struct("<3d")